Re: [PATCH v2 2/5] rust: num: add `shr` and `shl` methods to `Bounded`

From: kernel test robot

Date: Wed Jan 21 2026 - 12:50:57 EST


Hi Alexandre,

kernel test robot noticed the following build warnings:

[auto build test WARNING on c259cd7ea3c9ad369c473ba2385d82e3432088b1]

url: https://github.com/intel-lab-lkp/linux/commits/Alexandre-Courbot/rust-enable-the-generic_arg_infer-feature/20260121-152936
base: c259cd7ea3c9ad369c473ba2385d82e3432088b1
patch link: https://lore.kernel.org/r/20260121-register-v2-2-79d9b8d5e36a%40nvidia.com
patch subject: [PATCH v2 2/5] rust: num: add `shr` and `shl` methods to `Bounded`
config: x86_64-randconfig-071-20260121 (https://download.01.org/0day-ci/archive/20260122/202601220119.LQY1LLC8-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/20260122/202601220119.LQY1LLC8-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/202601220119.LQY1LLC8-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> warning: unnecessary `unsafe` block
--> rust/kernel/num/bounded.rs:491:9
|
491 | unsafe { Bounded::__new(self.0 >> SHIFT) }
| ^^^^^^ unnecessary `unsafe` block
|
= note: `#[warn(unused_unsafe)]` on by default
--
>> warning: unnecessary `unsafe` block
--> rust/kernel/num/bounded.rs:511:9
|
511 | unsafe { Bounded::__new(self.0 << SHIFT) }
| ^^^^^^ unnecessary `unsafe` block

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