Re: error[E0560]: struct `kunit_suite` has no field named `suite_init`

From: Philip Li

Date: Wed Dec 03 2025 - 09:24:08 EST


On Wed, Dec 03, 2025 at 08:58:48PM +0800, David Gow wrote:
> Hi all,
>
> Le 03/12/2025 à 7:45 PM, kernel test robot a écrit :
> > ::::::
> > :::::: Manual check reason: "arm-randconfig-r121-20251201 results in various rust failures"
> > ::::::
> >
> > BCC: lkp@xxxxxxxxx
> > CC: oe-kbuild-all@xxxxxxxxxxxxxxx
> > CC: linux-kernel@xxxxxxxxxxxxxxx
> > TO: "Thomas Weißschuh" <thomas.weissschuh@xxxxxxxxxxxxx>
> > CC: Daniel Gomez <da.gomez@xxxxxxxxxxx>
> >
> > Hi Thomas,
> >
> > FYI, the error/warning still remains.
> >
> > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > head: 3f9f0252130e7dd60d41be0802bf58f6471c691d
> > commit: 818783c804bc051f7faf0ac226b5597f8259c6f8 module: make structure definitions always visible
> > date: 4 months ago
> > :::::: branch date: 9 hours ago
> > :::::: commit date: 4 months ago
> > config: arm-randconfig-r121-20251201 (https://download.01.org/0day-ci/archive/20251203/202512031957.BoFx2PMx-lkp@xxxxxxxxx/config)
> > compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project b3428bb966f1de8aa48375ffee0eba04ede133b7)
> > rustc: rustc 1.88.0 (6b00bc388 2025-06-23)
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251203/202512031957.BoFx2PMx-lkp@xxxxxxxxx/reproduce)
> >
>
> The current best theory for the cause of these errors (which, alas, I've
> still not been able to reproduce locally) is the following bindgen bug:
> https://github.com/rust-lang/rust-bindgen/issues/3264
>
> bindgen 0.72.1 has been released to fix this issue:
> https://github.com/rust-lang/rust-bindgen/releases/tag/v0.72.1
>
> It looks like all of the test robot failures are from builds using both
> clang 22 and bindgen 0.72.0, which would meet the criteria for that bug. Is
> there any chance you could upgrade the bindgen version used and see if that
> makes the issues go away?

Thanks for the information, I will update bot logic to use 0.72.1 from now on
to avoid these kind of false positives.

>
> > 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/r/202512031957.BoFx2PMx-lkp@xxxxxxxxx/
> >
> > All errors (new ones prefixed by >>):
> >
> > > > error[E0560]: struct `kunit_suite` has no field named `suite_init`
> > --> rust/kernel/kunit.rs:291:21
> > |
> > 291 | suite_init: None,
> > | ^^^^^^^^^^ `kunit_suite` does not have this field
> > |
> > ::: rust/kernel/alloc/kvec.rs:1244:1
> > |
> > 1244 | #[macros::kunit_tests(rust_kvec_kunit)]
> > | --------------------------------------- in this procedural macro expansion
> > |
> > = note: all struct fields are already assigned
> > = note: this error originates in the macro `::kernel::kunit_unsafe_test_suite` which comes from the expansion of the attribute macro `macros::kunit_tests` (in Nightly builds, run with -Z macro-backtrace for more info)
> > --
> > > > error[E0560]: struct `kunit_suite` has no field named `suite_exit`
> > --> rust/kernel/kunit.rs:292:21
> > |
> > 292 | suite_exit: None,
> > | ^^^^^^^^^^ `kunit_suite` does not have this field
> > |
> > ::: rust/kernel/alloc/kvec.rs:1244:1
> > |
> > 1244 | #[macros::kunit_tests(rust_kvec_kunit)]
> > | --------------------------------------- in this procedural macro expansion
> > |
> > = note: all struct fields are already assigned
> > = note: this error originates in the macro `::kernel::kunit_unsafe_test_suite` which comes from the expansion of the attribute macro `macros::kunit_tests` (in Nightly builds, run with -Z macro-backtrace for more info)
> > --
>
> (...)
>
> Cheers,
> -- David
>