Re: [PATCH RESEND] rust: replace `build_assert!` with `const_assert!`
From: kernel test robot
Date: Tue May 26 2026 - 00:35:12 EST
Hi Mohamad,
kernel test robot noticed the following build errors:
[auto build test ERROR on rust/xarray-next]
[cannot apply to rust/rust-next driver-core/driver-core-testing driver-core/driver-core-next driver-core/driver-core-linus tip/locking/core linus/master v7.1-rc5 next-20260525]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Mohamad-Alsadhan/rust-replace-build_assert-with-const_assert/20260523-202931
base: https://github.com/Rust-for-Linux/linux xarray-next
patch link: https://lore.kernel.org/r/20260523122759.30317-1-mo%40sdhn.cc
patch subject: [PATCH RESEND] rust: replace `build_assert!` with `const_assert!`
config: x86_64-randconfig-161-20260526 (https://download.01.org/0day-ci/archive/20260526/202605261249.YsIyj5Ye-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)
smatch: v0.5.0-9185-gbcc58b9c
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260526/202605261249.YsIyj5Ye-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/202605261249.YsIyj5Ye-lkp@xxxxxxxxx/
All error/warnings (new ones prefixed by >>):
>> error[E0432]: unresolved import `crate::const_assert`
--> rust/kernel/sync/locked_by.rs:6:5
|
6 | use crate::const_assert;
| ^^^^^^^------------
| | |
| | help: a similar name exists in the module: `kunit_assert`
| no `const_assert` in the root
--
>> error[E0432]: unresolved import `crate::const_assert`
--> rust/kernel/xarray.rs:8:22
|
8 | alloc, bindings, const_assert,
| ^^^^^^^^^^^^
| |
| no `const_assert` in the root
| help: a similar name exists in the module: `kunit_assert`
--
>> error: cannot find macro `const_assert` in this scope
--> rust/kernel/list/arc.rs:254:9
|
254 | const_assert!(ID != ID2);
| ^^^^^^^^^^^^
--
>> error: cannot find macro `const_assert` in this scope
--> rust/kernel/i2c.rs:105:9
|
105 | const_assert!(
| ^^^^^^^^^^^^
--
>> error: cannot find macro `const_assert` in this scope
--> rust/kernel/dma.rs:386:9
|
386 | const_assert!(
| ^^^^^^^^^^^^
--
>> warning: unused import: `mem::size_of`
--> rust/kernel/sync/locked_by.rs:7:30
|
7 | use core::{cell::UnsafeCell, mem::size_of, ptr};
| ^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki