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 - 10:03:28 EST


On Tue, Apr 8, 2025 at 3:19 PM Alexandre Courbot <acourbot@xxxxxxxxxx> wrote:
>
> Apologies for that, I had no idea how to build using a specific
> toolchain and did the wrong thing, which is sending without proper
> testing.

No worries at all! It is completely normal :)

> I had some trouble finding how to 1) find out the minimum supported Rust
> version, and 2) how to build using a specific toolchain.

For 1), the minimum versions for tools the Linux kernel uses is documented at:

https://docs.kernel.org/process/changes.html#current-minimal-requirements

`min-tool-version.sh` is also fine, of course.

For 2), similarly, it works like for other tools: either you override
your binary in the `$PATH` (that is easy with Rust with the command
you mention or simply with `rustup default X`), or you provide other
binaries via e.g. `make RUSTC=...` like you would do with `make
CC=...`.

> I can send a patch against the Coding Guidelines adding a section to
> encourage testing against the minimum version and explain how to force a
> specific Rust version if you can confirm this would be helpful (and that
> min-tool-version.sh is the correct way to check the minimum supported
> Rust version).

So that sort of thing is supposed to be documented in the "Submit
Checklist Addendum" section of the "Maintainer Entry Profile" document
(`P:` field in `MAINTAINERS`) of a given subsystem, and in particular
for Rust is at:

https://rust-for-linux.com/contributing#submit-checklist-addendum

I agree that linking from the Coding Guidelines or perhaps the root of
the Rust docs would probably help others to find it, since different
people go to different places when starting, so please feel free to
send a patch!

Cheers,
Miguel