Re: [PATCH v5] rust: aref: make `AlwaysRefCounted::inc_ref` an associated function

kernel test robot <[email protected]>
Newsgroups dev.linux.lists.llvm,dev.linux.lists.oe-kbuild-all
Message-ID <[email protected]>
Hi Trevor,

kernel test robot noticed the following build errors:

[auto build test ERROR on driver-core/driver-core-linus]
[also build test ERROR on rust/rust-next akpm-mm/mm-everything linus/master v7.2-rc7]
[cannot apply to driver-core/driver-core-testing driver-core/driver-core-next drm/drm-next next-20260811]
[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/Trevor-Chan/rust-aref-make-AlwaysRefCounted-inc_ref-an-associated-function/20260812-112718
base:   driver-core/driver-core-linus
patch link:    https://lore.kernel.org/r/20260628092853.16550-1-trev%40trevrosa.dev
patch subject: [PATCH v5] rust: aref: make `AlwaysRefCounted::inc_ref` an associated function
config: x86_64-randconfig-016-20260812 (https://download.01.org/0day-ci/archive/20260813/[email protected]/config)
compiler: clang version 22.1.3 (https://github.com/llvm/llvm-project e9846648fd6183ee6d8cbdb4502213fcf902a211)
rustc: rustc 1.96.0 (ac68faa20 2026-05-25)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260813/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> error[E0185]: method `inc_ref` has a `&self` declaration in the impl, but not in the trait
   --> rust/kernel/opp.rs:1046:5
   |
   1046 |     fn inc_ref(&self) {
   |     ^^^^^^^^^^^^^^^^^ `&self` used in impl
   |
   ::: rust/kernel/sync/aref.rs:50:5
   |
   50 |     fn inc_ref(obj: &Self);
   |     ----------------------- trait method declared without `&self`

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.