Re: [PATCH] rust: alloc: allow coercion from `Box` to `Box` if T implements U

Miguel Ojeda
2025-04-08T10:35:55Z

On Tue, Apr 8, 2025 at 12:22 PM Benno Lossin <benno.lossin@proton.me> 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);

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