Re: [PATCH v3 4/7] rust: auxiliary: sample: demonstrate ForLt with invariant Mutex type

From: Alexandre Courbot

Date: Wed Jun 24 2026 - 10:38:07 EST


On Fri Jun 19, 2026 at 8:08 AM JST, Danilo Krummrich wrote:
> Extend the auxiliary driver sample to demonstrate both access patterns:
>
> - registration_data() with CovariantForLt!(Data<'_>) for the covariant
> data type that holds a plain &'bound reference.
>
> - registration_data_with() with ForLt!(MutexData<'_>) for an invariant
> data type that wraps a Mutex<&'bound Device>. Since Mutex<T> is
> invariant over T, MutexData cannot implement CovariantForLt and must
> use the closure-based accessor.
>
> Signed-off-by: Danilo Krummrich <dakr@xxxxxxxxxx>

Reviewed-by: Alexandre Courbot <acourbot@xxxxxxxxxx>