Re: [PATCH] rust: alloc: allow coercion from `Box<T>` to `Box<dyn U>` if T implements U
From: Miguel Ojeda
Date: Tue Apr 08 2025 - 06:41:08 EST
On Tue, Apr 8, 2025 at 12:22 PM Benno Lossin <benno.lossin@xxxxxxxxx> wrote:
>
> You forgot to add the `A: Allocator` generic here and in the impl below.
Yeah, for this sort of changes (ideally, all patches, really), please
test with both the minimum supported version and the latest.
For instance, there is another issue, `#[pointee]` is only applicable
when you have the feature:
error: cannot find attribute `pointee` in this scope
--> rust/kernel/alloc/kbox.rs:66:18
|
66 | pub struct Box<#[pointee] T: ?Sized, A:
Allocator>(NonNull<T>, PhantomData<A>);
By the way, I would suggest taking the chance to move the sentence in
the docs below to the "Examples section" and providing one.
Thanks!
Cheers,
Miguel