Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'rust-fixes-6.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linux

Pull Rust fixes from Miguel Ojeda:
"Toolchain and infrastructure:

- Fix build and modpost confusion for the upcoming Rust 1.89.0
release

- Clean objtool warning for the upcoming Rust 1.89.0 release by
adding one more noreturn function

'kernel' crate:

- Fix build error when using generics in the 'try_{,pin_}init!'
macros"

* tag 'rust-fixes-6.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linux:
rust: use `#[used(compiler)]` to fix build and `modpost` with Rust >= 1.89.0
objtool/rust: add one more `noreturn` Rust function for Rust 1.89.0
rust: init: Fix generics in *_init! macros

+18 -12
+1
rust/Makefile
··· 194 194 RUST_MODFILE=test.rs \ 195 195 OBJTREE=$(abspath $(objtree)) \ 196 196 $(RUSTDOC) --test $(rust_common_flags) \ 197 + -Zcrate-attr='feature(used_with_arg)' \ 197 198 @$(objtree)/include/generated/rustc_cfg \ 198 199 $(rustc_target_flags) $(rustdoc_test_target_flags) \ 199 200 $(rustdoc_test_quiet) \
+1 -1
rust/kernel/firmware.rs
··· 202 202 }; 203 203 204 204 #[link_section = ".modinfo"] 205 - #[used] 205 + #[used(compiler)] 206 206 static __MODULE_FIRMWARE: [u8; $($builder)*::create(__MODULE_FIRMWARE_PREFIX) 207 207 .build_length()] = $($builder)*::create(__MODULE_FIRMWARE_PREFIX).build(); 208 208 };
+4 -4
rust/kernel/init.rs
··· 231 231 ($(&$this:ident in)? $t:ident $(::<$($generics:ty),* $(,)?>)? { 232 232 $($fields:tt)* 233 233 }) => { 234 - ::pin_init::try_init!($(&$this in)? $t $(::<$($generics),* $(,)?>)? { 234 + ::pin_init::try_init!($(&$this in)? $t $(::<$($generics),*>)? { 235 235 $($fields)* 236 236 }? $crate::error::Error) 237 237 }; 238 238 ($(&$this:ident in)? $t:ident $(::<$($generics:ty),* $(,)?>)? { 239 239 $($fields:tt)* 240 240 }? $err:ty) => { 241 - ::pin_init::try_init!($(&$this in)? $t $(::<$($generics),* $(,)?>)? { 241 + ::pin_init::try_init!($(&$this in)? $t $(::<$($generics),*>)? { 242 242 $($fields)* 243 243 }? $err) 244 244 }; ··· 291 291 ($(&$this:ident in)? $t:ident $(::<$($generics:ty),* $(,)?>)? { 292 292 $($fields:tt)* 293 293 }) => { 294 - ::pin_init::try_pin_init!($(&$this in)? $t $(::<$($generics),* $(,)?>)? { 294 + ::pin_init::try_pin_init!($(&$this in)? $t $(::<$($generics),*>)? { 295 295 $($fields)* 296 296 }? $crate::error::Error) 297 297 }; 298 298 ($(&$this:ident in)? $t:ident $(::<$($generics:ty),* $(,)?>)? { 299 299 $($fields:tt)* 300 300 }? $err:ty) => { 301 - ::pin_init::try_pin_init!($(&$this in)? $t $(::<$($generics),* $(,)?>)? { 301 + ::pin_init::try_pin_init!($(&$this in)? $t $(::<$($generics),*>)? { 302 302 $($fields)* 303 303 }? $err) 304 304 };
+1 -1
rust/kernel/kunit.rs
··· 302 302 is_init: false, 303 303 }; 304 304 305 - #[used] 305 + #[used(compiler)] 306 306 #[allow(unused_unsafe)] 307 307 #[cfg_attr(not(target_os = "macos"), link_section = ".kunit_test_suites")] 308 308 static mut KUNIT_TEST_SUITE_ENTRY: *const ::kernel::bindings::kunit_suite =
+3
rust/kernel/lib.rs
··· 34 34 // Expected to become stable. 35 35 #![feature(arbitrary_self_types)] 36 36 // 37 + // To be determined. 38 + #![feature(used_with_arg)] 39 + // 37 40 // `feature(derive_coerce_pointee)` is expected to become stable. Before Rust 38 41 // 1.84.0, it did not exist, so enable the predecessor features. 39 42 #![cfg_attr(CONFIG_RUSTC_HAS_COERCE_POINTEE, feature(derive_coerce_pointee))]
+5 -5
rust/macros/module.rs
··· 57 57 {cfg} 58 58 #[doc(hidden)] 59 59 #[cfg_attr(not(target_os = \"macos\"), link_section = \".modinfo\")] 60 - #[used] 60 + #[used(compiler)] 61 61 pub static __{module}_{counter}: [u8; {length}] = *{string}; 62 62 ", 63 63 cfg = if builtin { ··· 249 249 // key or a new section. For the moment, keep it simple. 250 250 #[cfg(MODULE)] 251 251 #[doc(hidden)] 252 - #[used] 252 + #[used(compiler)] 253 253 static __IS_RUST_MODULE: () = (); 254 254 255 255 static mut __MOD: ::core::mem::MaybeUninit<{type_}> = ··· 273 273 274 274 #[cfg(MODULE)] 275 275 #[doc(hidden)] 276 - #[used] 276 + #[used(compiler)] 277 277 #[link_section = \".init.data\"] 278 278 static __UNIQUE_ID___addressable_init_module: unsafe extern \"C\" fn() -> i32 = init_module; 279 279 ··· 293 293 294 294 #[cfg(MODULE)] 295 295 #[doc(hidden)] 296 - #[used] 296 + #[used(compiler)] 297 297 #[link_section = \".exit.data\"] 298 298 static __UNIQUE_ID___addressable_cleanup_module: extern \"C\" fn() = cleanup_module; 299 299 ··· 303 303 #[cfg(not(CONFIG_HAVE_ARCH_PREL32_RELOCATIONS))] 304 304 #[doc(hidden)] 305 305 #[link_section = \"{initcall_section}\"] 306 - #[used] 306 + #[used(compiler)] 307 307 pub static __{ident}_initcall: extern \"C\" fn() -> 308 308 ::kernel::ffi::c_int = __{ident}_init; 309 309
+2 -1
scripts/Makefile.build
··· 312 312 # - Stable since Rust 1.82.0: `feature(asm_const)`, `feature(raw_ref_op)`. 313 313 # - Stable since Rust 1.87.0: `feature(asm_goto)`. 314 314 # - Expected to become stable: `feature(arbitrary_self_types)`. 315 + # - To be determined: `feature(used_with_arg)`. 315 316 # 316 317 # Please see https://github.com/Rust-for-Linux/linux/issues/2 for details on 317 318 # the unstable features in use. 318 - rust_allowed_features := asm_const,asm_goto,arbitrary_self_types,lint_reasons,raw_ref_op 319 + rust_allowed_features := asm_const,asm_goto,arbitrary_self_types,lint_reasons,raw_ref_op,used_with_arg 319 320 320 321 # `--out-dir` is required to avoid temporaries being created by `rustc` in the 321 322 # current working directory, which may be not accessible in the out-of-tree
+1
tools/objtool/check.c
··· 224 224 str_ends_with(func->name, "_4core9panicking14panic_explicit") || 225 225 str_ends_with(func->name, "_4core9panicking14panic_nounwind") || 226 226 str_ends_with(func->name, "_4core9panicking18panic_bounds_check") || 227 + str_ends_with(func->name, "_4core9panicking18panic_nounwind_fmt") || 227 228 str_ends_with(func->name, "_4core9panicking19assert_failed_inner") || 228 229 str_ends_with(func->name, "_4core9panicking30panic_null_pointer_dereference") || 229 230 str_ends_with(func->name, "_4core9panicking36panic_misaligned_pointer_dereference") ||