[ Sasha's backport helper bot ]
Hi,
✅ All tests passed successfully. No issues detected. No action required from the submitter.
The upstream commit SHA1 provided is correct: 7498159226772d66f150dd406be462d75964a366
Note: The patch differs from the upstream commit: --- 1: 749815922677 ! 1: a3a4555a1d32 rust: use `#[used(compiler)]` to fix build and `modpost` with Rust >= 1.89.0 @@ Commit message Acked-by: Björn Roy Baron bjorn3_gh@protonmail.com Link: https://lore.kernel.org/r/20250712160103.1244945-3-ojeda@kernel.org Signed-off-by: Miguel Ojeda ojeda@kernel.org + (cherry picked from commit 7498159226772d66f150dd406be462d75964a366) + Signed-off-by: Miguel Ojeda ojeda@kernel.org
## rust/Makefile ## @@ rust/Makefile: quiet_cmd_rustdoc_test = RUSTDOC T $< @@ rust/kernel/kunit.rs: macro_rules! kunit_unsafe_test_suite {
## rust/kernel/lib.rs ## @@ - // Expected to become stable. - #![feature(arbitrary_self_types)] - // + #![feature(const_mut_refs)] + #![feature(const_ptr_write)] + #![feature(const_refs_to_cell)] +// To be determined. +#![feature(used_with_arg)] -+// - // `feature(derive_coerce_pointee)` is expected to become stable. Before Rust - // 1.84.0, it did not exist, so enable the predecessor features. - #![cfg_attr(CONFIG_RUSTC_HAS_COERCE_POINTEE, feature(derive_coerce_pointee))] + + // Ensure conditional compilation based on the kernel configuration works; + // otherwise we may silently break things like initcall handling.
## rust/macros/module.rs ## @@ rust/macros/module.rs: fn emit_base(&mut self, field: &str, content: &str, builtin: bool) { @@ rust/macros/module.rs: mod __module_init {{ + #[used(compiler)] static __IS_RUST_MODULE: () = ();
- static mut __MOD: ::core::mem::MaybeUninit<{type_}> = + static mut __MOD: core::mem::MaybeUninit<{type_}> = @@ rust/macros/module.rs: mod __module_init {{
#[cfg(MODULE)] @@ rust/macros/module.rs: mod __module_init {{ #[link_section = "{initcall_section}"] - #[used] + #[used(compiler)] - pub static __{ident}_initcall: extern "C" fn() -> - ::kernel::ffi::c_int = __{ident}_init; + pub static __{name}_initcall: extern "C" fn() -> kernel::ffi::c_int = __{name}_init;
+ #[cfg(not(MODULE))]
## scripts/Makefile.build ## @@ scripts/Makefile.build: $(obj)/%.lst: $(obj)/%.c FORCE - # - Stable since Rust 1.82.0: `feature(asm_const)`, `feature(raw_ref_op)`. - # - Stable since Rust 1.87.0: `feature(asm_goto)`. - # - Expected to become stable: `feature(arbitrary_self_types)`. -+# - To be determined: `feature(used_with_arg)`. - # - # Please see https://github.com/Rust-for-Linux/linux/issues/2 for details on - # the unstable features in use. + # Compile Rust sources (.rs) + # --------------------------------------------------------------------------- + -rust_allowed_features := asm_const,asm_goto,arbitrary_self_types,lint_reasons,raw_ref_op +rust_allowed_features := asm_const,asm_goto,arbitrary_self_types,lint_reasons,raw_ref_op,used_with_arg
---
Results of testing on various branches:
| Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | origin/linux-6.15.y | Success | Success |