Skip to content

Commit c21bdb3

Browse files
committed
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. Cc: <stable@vger.kernel.org> # Needed in 6.12.y and 6.13.y only (Rust is pinned in older LTSs). Fixes: 7f8977a ("rust: init: add `{pin_}chain` functions to `{Pin}Init<T, E>`") Link: rust-lang/rust#132397 [1] Reviewed-by: Gary Guo <gary@garyguo.net> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Fiona Behrens <me@kloenk.dev> Link: https://lore.kernel.org/r/20250121200934.222075-1-ojeda@kernel.org [ Added 6.13.y to Cc: stable tag. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent b174943 commit c21bdb3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rust/kernel/init.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ pub unsafe trait PinInit<T: ?Sized, E = Infallible>: Sized {
870870
/// use kernel::{types::Opaque, init::pin_init_from_closure};
871871
/// #[repr(C)]
872872
/// struct RawFoo([u8; 16]);
873-
/// extern {
873+
/// extern "C" {
874874
/// fn init_foo(_: *mut RawFoo);
875875
/// }
876876
///

0 commit comments

Comments
 (0)