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

Andreas Hindborg <[email protected]> Wed, 05 Aug 2026 11:26:34 +0200
Newsgroups gmane.linux.kernel.pci,gmane.linux.kernel.rust,gmane.linux.kernel,gmane.linux.block,gmane.linux.kernel.lsm,gmane.comp.video.dri.devel,gmane.linux.file-systems,gmane.linux.kernel.mm,gmane.linux.power-management.general,gmane.linux.pwm
Message-ID <[email protected]>
"Trevor Chan" <[email protected]> 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 <[email protected]>
> Link: https://github.com/Rust-for-Linux/linux/issues/1177
> Reviewed-by: Alice Ryhl <[email protected]>
> Signed-off-by: Trevor Chan <[email protected]>

Reviewed-by: Andreas Hindborg <[email protected]>

Best regards,
Andreas Hindborg