Re: [PATCH v4] rust: kernel: introduce `unsafe_precondition_assert!` macro

From: kernel test robot
Date: Tue Aug 12 2025 - 11:56:04 EST


Hi Ritvik,

kernel test robot noticed the following build errors:

[auto build test ERROR on 37816488247ddddbc3de113c78c83572274b1e2e]

url: https://github.com/intel-lab-lkp/linux/commits/Ritvik-Gupta/rust-kernel-introduce-unsafe_precondition_assert-macro/20250809-032122
base: 37816488247ddddbc3de113c78c83572274b1e2e
patch link: https://lore.kernel.org/r/20250808192005.209188-1-ritvikfoss%40gmail.com
patch subject: [PATCH v4] rust: kernel: introduce `unsafe_precondition_assert!` macro
config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20250812/202508122341.rb7U1Q2P-lkp@xxxxxxxxx/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
rustc: rustc 1.88.0 (6b00bc388 2025-06-23)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250812/202508122341.rb7U1Q2P-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202508122341.rb7U1Q2P-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> error[E0423]: cannot initialize a tuple struct which contains private fields
--> rust/doctests_kernel_generated.rs:8841:5
|
8841 | CpuId(id)
| ^^^^^
|
note: constructor is not visible here due to private fields
--> rust/kernel/cpu.rs:47:18
|
47 | pub struct CpuId(u32);
| ^^^ private field
help: you might have meant to use an associated function to build this type
|
8841 - CpuId(id)
8841 + CpuId::from_i32_unchecked(_)
|
8841 - CpuId(id)
8841 + CpuId::from_u32_unchecked(_)
|
8841 - CpuId(id)
8841 + CpuId::current()
|

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki