Re: [PATCH v14 2/9] rust: rename `AlwaysRefCounted` to `RefCounted`.

From: kernel test robot

Date: Wed Feb 04 2026 - 17:51:28 EST


Hi Andreas,

kernel test robot noticed the following build errors:

[auto build test ERROR on 63804fed149a6750ffd28610c5c1c98cce6bd377]

url: https://github.com/intel-lab-lkp/linux/commits/Andreas-Hindborg/rust-types-Add-Ownable-Owned-types/20260204-200041
base: 63804fed149a6750ffd28610c5c1c98cce6bd377
patch link: https://lore.kernel.org/r/20260204-unique-ref-v14-2-17cb29ebacbb%40kernel.org
patch subject: [PATCH v14 2/9] rust: rename `AlwaysRefCounted` to `RefCounted`.
config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20260204/202602042300.Ec1WiMLA-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/20260204/202602042300.Ec1WiMLA-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/202602042300.Ec1WiMLA-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> error[E0407]: method `inc_ref` is not a member of trait `AlwaysRefCounted`
--> rust/kernel/usb.rs:378:5
|
378 | / fn inc_ref(&self) {
... |
383 | | }
| |_____^ not a member of trait `AlwaysRefCounted`
--
>> error[E0407]: method `dec_ref` is not a member of trait `AlwaysRefCounted`
--> rust/kernel/usb.rs:385:5
|
385 | / unsafe fn dec_ref(obj: NonNull<Self>) {
386 | | // SAFETY: The safety requirements guarantee that the refcount is non-zero.
387 | | unsafe { bindings::usb_put_intf(obj.cast().as_ptr()) }
388 | | }
| |_____^ not a member of trait `AlwaysRefCounted`
--
>> error[E0277]: the trait bound `usb::Interface: sync::aref::RefCounted` is not satisfied
--> rust/kernel/device.rs:700:17
|
700 | (&**dev).into()
| ^^^^^^^^^^^^^^^ the trait `sync::aref::RefCounted` is not implemented for `usb::Interface`
|
::: rust/kernel/usb.rs:352:1
|
352 | kernel::impl_device_context_into_aref!(Interface);
| ------------------------------------------------- in this macro invocation
|
= help: the following other types implement trait `sync::aref::RefCounted`:
auxiliary::Device
block::mq::request::Request<T>
cred::Credential
device::Device
device::property::FwNode
fs::file::File
fs::file::LocalFile
i2c::I2cAdapter
and 8 others
note: required by a bound in `sync::aref::ARef`
--> rust/kernel/sync/aref.rs:86:20
|
86 | pub struct ARef<T: RefCounted> {
| ^^^^^^^^^^ required by this bound in `ARef`
= note: this error originates in the macro `::kernel::__impl_device_context_into_aref` which comes from the expansion of the macro `kernel::impl_device_context_into_aref` (in Nightly builds, run with -Z macro-backtrace for more info)
--
>> error[E0277]: the trait bound `usb::Device: sync::aref::RefCounted` is not satisfied
--> rust/kernel/device.rs:700:17
|
700 | (&**dev).into()
| ^^^^^^^^^^^^^^^ the trait `sync::aref::RefCounted` is not implemented for `usb::Device`
|
::: rust/kernel/usb.rs:425:1
|
425 | kernel::impl_device_context_into_aref!(Device);
| ---------------------------------------------- in this macro invocation
|
= help: the following other types implement trait `sync::aref::RefCounted`:
auxiliary::Device
block::mq::request::Request<T>
cred::Credential
device::Device
device::property::FwNode
fs::file::File
fs::file::LocalFile
i2c::I2cAdapter
and 8 others
note: required by a bound in `sync::aref::ARef`
--> rust/kernel/sync/aref.rs:86:20
|
86 | pub struct ARef<T: RefCounted> {
| ^^^^^^^^^^ required by this bound in `ARef`
= note: this error originates in the macro `::kernel::__impl_device_context_into_aref` which comes from the expansion of the macro `kernel::impl_device_context_into_aref` (in Nightly builds, run with -Z macro-backtrace for more info)
--
>> error[E0407]: method `inc_ref` is not a member of trait `AlwaysRefCounted`
--> rust/kernel/usb.rs:429:5
|
429 | / fn inc_ref(&self) {
... |
434 | | }
| |_____^ not a member of trait `AlwaysRefCounted`
--
>> error[E0407]: method `dec_ref` is not a member of trait `AlwaysRefCounted`
--> rust/kernel/usb.rs:436:5
|
436 | / unsafe fn dec_ref(obj: NonNull<Self>) {
437 | | // SAFETY: The safety requirements guarantee that the refcount is non-zero.
438 | | unsafe { bindings::usb_put_dev(obj.cast().as_ptr()) }
439 | | }
| |_____^ not a member of trait `AlwaysRefCounted`
--
>> error[E0277]: the trait bound `usb::Interface: sync::aref::RefCounted` is not satisfied
--> rust/kernel/device.rs:698:56
|
698 | impl ::core::convert::From<&$device<$src>> for $crate::sync::aref::ARef<$device> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `sync::aref::RefCounted` is not implemented for `usb::Interface`
|
::: rust/kernel/usb.rs:352:1
|
352 | kernel::impl_device_context_into_aref!(Interface);
| ------------------------------------------------- in this macro invocation
|
= help: the following other types implement trait `sync::aref::RefCounted`:
auxiliary::Device
block::mq::request::Request<T>
cred::Credential
device::Device
device::property::FwNode
fs::file::File
fs::file::LocalFile
i2c::I2cAdapter
and 8 others
note: required by a bound in `sync::aref::ARef`
--> rust/kernel/sync/aref.rs:86:20
|
86 | pub struct ARef<T: RefCounted> {
| ^^^^^^^^^^ required by this bound in `ARef`
= note: this error originates in the macro `::kernel::__impl_device_context_into_aref` which comes from the expansion of the macro `kernel::impl_device_context_into_aref` (in Nightly builds, run with -Z macro-backtrace for more info)
--
>> error[E0277]: the trait bound `usb::Interface: sync::aref::RefCounted` is not satisfied
--> rust/kernel/usb.rs:377:34
|
377 | unsafe impl AlwaysRefCounted for Interface {
| ^^^^^^^^^ the trait `sync::aref::RefCounted` is not implemented for `usb::Interface`
|
= help: the following other types implement trait `sync::aref::RefCounted`:
auxiliary::Device
block::mq::request::Request<T>
cred::Credential
device::Device
device::property::FwNode
fs::file::File
fs::file::LocalFile
i2c::I2cAdapter
and 8 others
note: required by a bound in `sync::aref::AlwaysRefCounted`
--> rust/kernel/sync/aref.rs:74:36
|
74 | pub unsafe trait AlwaysRefCounted: RefCounted {}
| ^^^^^^^^^^ required by this bound in `AlwaysRefCounted`
--
>> error[E0277]: the trait bound `usb::Device: sync::aref::RefCounted` is not satisfied
--> rust/kernel/device.rs:698:56
|
698 | impl ::core::convert::From<&$device<$src>> for $crate::sync::aref::ARef<$device> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `sync::aref::RefCounted` is not implemented for `usb::Device`
|
::: rust/kernel/usb.rs:425:1
|
425 | kernel::impl_device_context_into_aref!(Device);
| ---------------------------------------------- in this macro invocation
|
= help: the following other types implement trait `sync::aref::RefCounted`:
auxiliary::Device
block::mq::request::Request<T>
cred::Credential
device::Device
device::property::FwNode
fs::file::File
fs::file::LocalFile
i2c::I2cAdapter
and 8 others
note: required by a bound in `sync::aref::ARef`
--> rust/kernel/sync/aref.rs:86:20
|
86 | pub struct ARef<T: RefCounted> {
| ^^^^^^^^^^ required by this bound in `ARef`
= note: this error originates in the macro `::kernel::__impl_device_context_into_aref` which comes from the expansion of the macro `kernel::impl_device_context_into_aref` (in Nightly builds, run with -Z macro-backtrace for more info)
--
>> error[E0277]: the trait bound `usb::Device: sync::aref::RefCounted` is not satisfied
--> rust/kernel/usb.rs:428:34
|
428 | unsafe impl AlwaysRefCounted for Device {
| ^^^^^^ the trait `sync::aref::RefCounted` is not implemented for `usb::Device`
|
= help: the following other types implement trait `sync::aref::RefCounted`:
auxiliary::Device
block::mq::request::Request<T>
cred::Credential
device::Device
device::property::FwNode
fs::file::File
fs::file::LocalFile
i2c::I2cAdapter
and 8 others
note: required by a bound in `sync::aref::AlwaysRefCounted`
--> rust/kernel/sync/aref.rs:74:36
|
74 | pub unsafe trait AlwaysRefCounted: RefCounted {}
| ^^^^^^^^^^ required by this bound in `AlwaysRefCounted`
--
>> error[E0277]: the trait bound `usb::Interface: sync::aref::RefCounted` is not satisfied
--> rust/kernel/device.rs:699:45
|
699 | fn from(dev: &$device<$src>) -> Self {
| ^^^^ the trait `sync::aref::RefCounted` is not implemented for `usb::Interface`
|
::: rust/kernel/usb.rs:352:1
|
352 | kernel::impl_device_context_into_aref!(Interface);
| ------------------------------------------------- in this macro invocation
|
= help: the following other types implement trait `sync::aref::RefCounted`:
auxiliary::Device
block::mq::request::Request<T>
cred::Credential
device::Device
device::property::FwNode
fs::file::File
fs::file::LocalFile
i2c::I2cAdapter
and 8 others
note: required by a bound in `sync::aref::ARef`
--> rust/kernel/sync/aref.rs:86:20
|
86 | pub struct ARef<T: RefCounted> {
| ^^^^^^^^^^ required by this bound in `ARef`
= note: this error originates in the macro `::kernel::__impl_device_context_into_aref` which comes from the expansion of the macro `kernel::impl_device_context_into_aref` (in Nightly builds, run with -Z macro-backtrace for more info)
..

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