Re: [PATCH v9] rust: transmute: Add methods for FromBytes trait

From: kernel test robot
Date: Tue Aug 12 2025 - 21:07:39 EST


Hi Christian,

kernel test robot noticed the following build errors:

[auto build test ERROR on rust/rust-next]
[also build test ERROR on linus/master v6.17-rc1 next-20250812]
[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/Christian-S-Lima/rust-transmute-Add-methods-for-FromBytes-trait/20250812-054010
base: https://github.com/Rust-for-Linux/linux rust-next
patch link: https://lore.kernel.org/r/20250811213851.65644-1-christiansantoslima21%40gmail.com
patch subject: [PATCH v9] rust: transmute: Add methods for FromBytes trait
config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20250813/202508130702.MtRUndHU-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/20250813/202508130702.MtRUndHU-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/202508130702.MtRUndHU-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> error[E0046]: not all trait items implemented, missing: `from_bytes`, `from_bytes_mut`
--> rust/doctests_kernel_generated.rs:4749:1
|
4749 | unsafe impl kernel::transmute::FromBytes for MyStruct{};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `from_bytes`, `from_bytes_mut` in implementation
|
= help: implement the missing item: `fn from_bytes(_: &[u8]) -> Option<&Self> { todo!() }`
= help: implement the missing item: `fn from_bytes_mut<Self>(_: &mut [u8]) -> Option<&mut Self> where Self: AsBytes { todo!() }`
--
>> error[E0046]: not all trait items implemented, missing: `from_bytes`, `from_bytes_mut`
--> rust/doctests_kernel_generated.rs:4814:1
|
4814 | unsafe impl kernel::transmute::FromBytes for MyStruct{};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `from_bytes`, `from_bytes_mut` in implementation
|
= help: implement the missing item: `fn from_bytes(_: &[u8]) -> Option<&Self> { todo!() }`
= help: implement the missing item: `fn from_bytes_mut<Self>(_: &mut [u8]) -> Option<&mut Self> where Self: AsBytes { todo!() }`
--
>> error[E0046]: not all trait items implemented, missing: `from_bytes`, `from_bytes_mut`
--> samples/rust/rust_dma.rs:42:1
|
42 | unsafe impl kernel::transmute::FromBytes for MyStruct {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `from_bytes`, `from_bytes_mut` in implementation
|
= help: implement the missing item: `fn from_bytes(_: &[u8]) -> Option<&Self> { todo!() }`
= help: implement the missing item: `fn from_bytes_mut<Self>(_: &mut [u8]) -> Option<&mut Self> where Self: AsBytes { todo!() }`

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