Re: [PATCH v22 4/5] rust: rename `AlwaysRefCounted` to `RefCounted`

From: Markus Probst

Date: Fri Nov 20 2026 - 08:41:15 EST


On Mon, 2026-11-16 at 15:21 +0100, Andreas Hindborg wrote:
> From: Oliver Mangold <oliver.mangold@xxxxx>
>
> There are types where it may both be reference counted in some cases and
> owned in others. For such types, obtaining an `ARef<T>` from a `&T` may be
> unsound, as it allows creation of an `ARef<T>` from a `&Owned<T>`.
>
> Therefore, we split `AlwaysRefCounted` into `RefCounted` (which `ARef<T>`
> would require) and a marker trait to indicate that the `&T` -> `ARef<T>`
> conversion is sound for the type. A type that implements `Ownable` may
> only implement the marker trait if it allows an `ARef<T>` to exist
> together with an `Owned<T>`.
>
> - Rename `AlwaysRefCounted` to `RefCounted`.
> - Add a new unsafe trait `AlwaysRefCounted`.
> - Implement the new trait `AlwaysRefCounted` for the newly renamed
> `RefCounted` implementations. This leaves functionality of existing
> implementers of `AlwaysRefCounted` intact.
>
> Suggested-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
> Signed-off-by: Oliver Mangold <oliver.mangold@xxxxx>
> [ Andreas: Updated commit message, rebased on v7.4-rc2, converted new
> implementers, relaxed the `ForeignOwnable` bound for `ARef<T>`, updated
> safety comments. ]
> Acked-by: Igor Korotin <igor.korotin.linux@xxxxxxxxx>
> Acked-by: Danilo Krummrich <dakr@xxxxxxxxxx>
> Acked-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>
> Co-developed-by: Andreas Hindborg <a.hindborg@xxxxxxxxxx>
> Signed-off-by: Andreas Hindborg <a.hindborg@xxxxxxxxxx>
> Acked-by: Uwe Kleine-König <ukleinek@xxxxxxxxxx> # for pwm.rs

I haven't unterstood yet what use case this has, so I am trusting the
other ACKs here. Maybe a precise example would help?

For serdev:

Acked-by: Markus Probst <markus.probst@xxxxxxxxx>

Thanks
- Markus Probst

Attachment: signature.asc
Description: This is a digitally signed message part