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

From: Andreas Hindborg

Date: Wed Aug 05 2026 - 05:32:40 EST


"Trevor Chan" <trev@xxxxxxxxxxxx> writes:

> `AlwaysRefCounted::inc_ref` is a function that shouldn't be called lightly.
>
> To prevent accidentally calling it, change `inc_ref` to be an associated function.
>
> Modify all `AlwaysRefCounted` implementors to work with this change.
>
> Suggested-by: Benno Lossin <lossin@xxxxxxxxxx>
> Link: https://github.com/Rust-for-Linux/linux/issues/1177
> Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
> Signed-off-by: Trevor Chan <trev@xxxxxxxxxxxx>

Reviewed-by: Andreas Hindborg <a.hindborg@xxxxxxxxxx>

Best regards,
Andreas Hindborg