On Mon, 2026-11-16 at 15:21 +0100, Andreas Hindborg wrote: > From: Oliver Mangold <[email protected]> > > 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 <[email protected]> > Signed-off-by: Oliver Mangold <[email protected]> > [ 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 <[email protected]> > Acked-by: Danilo Krummrich <[email protected]> > Acked-by: Viresh Kumar <[email protected]> > Co-developed-by: Andreas Hindborg <[email protected]> > Signed-off-by: Andreas Hindborg <[email protected]> > Acked-by: Uwe Kleine-König <[email protected]> # 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 <[email protected]> Thanks - Markus Probst
signature.asc
Description: This is a digitally signed message part
