On Mon, 2026-11-16 at 15:21 +0100, Andreas Hindborg wrote: > From: Oliver Mangold > > There are types where it may both be reference counted in some cases and > owned in others. For such types, obtaining an `ARef` from a `&T` may be > unsound, as it allows creation of an `ARef` from a `&Owned`. > > Therefore, we split `AlwaysRefCounted` into `RefCounted` (which `ARef` > would require) and a marker trait to indicate that the `&T` -> `ARef` > conversion is sound for the type. A type that implements `Ownable` may > only implement the marker trait if it allows an `ARef` to exist > together with an `Owned`. > > - 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 > Signed-off-by: Oliver Mangold > [ Andreas: Updated commit message, rebased on v7.4-rc2, converted new > implementers, relaxed the `ForeignOwnable` bound for `ARef`, updated > safety comments. ] > Acked-by: Igor Korotin > Acked-by: Danilo Krummrich > Acked-by: Viresh Kumar > Co-developed-by: Andreas Hindborg > Signed-off-by: Andreas Hindborg > Acked-by: Uwe Kleine-König # 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 Thanks - Markus Probst