Skip to contentSkip to conversation

rust: init: use explicit ABI to clean warning in future compilers

PATCH Applied Miguel Ojeda 5 participants 6 messages Jan 21, 2025 – Feb 5, 2025

Subsystems (2)
lore
Share & tools
lore

Miguel Ojeda

author maintainer
#0 lore raw

PATCH 1/1 rust: init: use explicit ABI to clean warning in future compilers

Starting with Rust 1.86.0 (currently in nightly, to be released on 2025-04-03), the missing_abi lint is warn-by-default [1]:

error: extern declarations without an explicit ABI are deprecated
--> rust/doctests_kernel_generated.rs:3158:1
|
3158 | extern {
| ^^^^^^ help: explicitly specify the C ABI: extern "C" |
= note: -D missing-abi implied by -D warnings = help: to override -D warnings add #[allow(missing_abi)]

Thus clean it up.

---
 rust/kernel/init.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
rust/kernel/init.rs +1 -1
index 347049df556b..c962029f96e1 100644
@@ -854,7 +854,7 @@ pub unsafe trait PinInit<T: ?Sized, E = Infallible>: Sized {
     /// use kernel::{types::Opaque, init::pin_init_from_closure};
     /// #[repr(C)]
     /// struct RawFoo([u8; 16]);
-    /// extern {
+    /// extern "C" {
     ///     fn init_foo(_: *mut RawFoo);
     /// }
     ///

base-commit: 100ceb4817a2ac650e29f107cf97161ce3e2289a

Signature · 1 line
2.48.1
#1 lore raw
Quoted 13 lines · Miguel Ojeda

Starting with Rust 1.86.0 (currently in nightly, to be released on 2025-04-03), the missing_abi lint is warn-by-default [1]:

error: extern declarations without an explicit ABI are deprecated
--> rust/doctests_kernel_generated.rs:3158:1
|
3158 | extern {
| ^^^^^^ help: explicitly specify the C ABI: extern "C" |
= note: -D missing-abi implied by -D warnings = help: to override -D warnings add #[allow(missing_abi)]

Quoted 4 lines

Thus clean it up.

Cc: <[email protected]> # Needed in 6.12.y only (Rust is pinned in older LTSs).

And while there was nothing wrong back then with the commit, as usual:

    Fixes: 7f8977a7fe6d ("rust: init: add `{pin_}chain` functions to

{Pin}Init<T, E>")

Cheers,
Miguel

reviewer Reviewed-by on v1 1/1
#2 lore raw
In reply to Miguel Ojeda
Quoted 13 lines · Miguel Ojeda

Starting with Rust 1.86.0 (currently in nightly, to be released on 2025-04-03), the missing_abi lint is warn-by-default [1]:

error: extern declarations without an explicit ABI are deprecated
--> rust/doctests_kernel_generated.rs:3158:1
|
3158 | extern {
| ^^^^^^ help: explicitly specify the C ABI: extern "C" |
= note: -D missing-abi implied by -D warnings = help: to override -D warnings add #[allow(missing_abi)]

Quoted 4 lines

Thus clean it up.

Reviewed-by on v1 1/1
#3 lore raw
In reply to Miguel Ojeda
Quoted 12 lines · Miguel Ojeda

Starting with Rust 1.86.0 (currently in nightly, to be released on 2025-04-03), the missing_abi lint is warn-by-default [1]:

error: extern declarations without an explicit ABI are deprecated
--> rust/doctests_kernel_generated.rs:3158:1
|
3158 | extern {
| ^^^^^^ help: explicitly specify the C ABI: extern "C" |
= note: -D missing-abi implied by -D warnings = help: to override -D warnings add #[allow(missing_abi)]

Quoted 4 lines

Thus clean it up.

Quoted 21 lines
---
 rust/kernel/init.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
rust/kernel/init.rs +1 -1
index 347049df556b..c962029f96e1 100644
@@ -854,7 +854,7 @@ pub unsafe trait PinInit<T: ?Sized, E = Infallible>: Sized {
     /// use kernel::{types::Opaque, init::pin_init_from_closure};
     /// #[repr(C)]
     /// struct RawFoo([u8; 16]);
-    /// extern {
+    /// extern "C" {
     ///     fn init_foo(_: *mut RawFoo);
     /// }
     ///

base-commit: 100ceb4817a2ac650e29f107cf97161ce3e2289a

Signature · 1 line
2.48.1
maintainer Reviewed-by on v1 1/1
#4 lore raw
In reply to Miguel Ojeda
Quoted 12 lines · On Tue, 21 Jan 2025 21:09:34 +0100 Miguel Ojeda <[email protected]> wrote:

Starting with Rust 1.86.0 (currently in nightly, to be released on 2025-04-03), the missing_abi lint is warn-by-default [1]:

error: extern declarations without an explicit ABI are deprecated
--> rust/doctests_kernel_generated.rs:3158:1
|
3158 | extern {
| ^^^^^^ help: explicitly specify the C ABI: extern "C" |
= note: -D missing-abi implied by -D warnings = help: to override -D warnings add #[allow(missing_abi)]

Quoted 4 lines

Thus clean it up.

Quoted 19 lines
---
 rust/kernel/init.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
rust/kernel/init.rs +1 -1
index 347049df556b..c962029f96e1 100644
@@ -854,7 +854,7 @@ pub unsafe trait PinInit<T: ?Sized, E = Infallible>: Sized {
     /// use kernel::{types::Opaque, init::pin_init_from_closure};
     /// #[repr(C)]
     /// struct RawFoo([u8; 16]);
-    /// extern {
+    /// extern "C" {
     ///     fn init_foo(_: *mut RawFoo);
     /// }
     ///

base-commit: 100ceb4817a2ac650e29f107cf97161ce3e2289a

Applied
#5 lore raw
In reply to Miguel Ojeda
Quoted 13 lines · Miguel Ojeda

Starting with Rust 1.86.0 (currently in nightly, to be released on 2025-04-03), the missing_abi lint is warn-by-default [1]:

error: extern declarations without an explicit ABI are deprecated
--> rust/doctests_kernel_generated.rs:3158:1
|
3158 | extern {
| ^^^^^^ help: explicitly specify the C ABI: extern "C" |
= note: -D missing-abi implied by -D warnings = help: to override -D warnings add #[allow(missing_abi)]

Quoted 4 lines

Thus clean it up.

Applied to rust-fixes -- thanks everyone!

[ Added 6.13.y to Cc: stable tag. - Miguel ]

Cheers,
Miguel