Re: [PATCH v2 1/3] rust: num: add cv! macro to create values from constant expressions
From: Miguel Ojeda
Date: Tue Sep 01 2026 - 19:19:29 EST
On Tue, Sep 1, 2026 at 10:19 PM John Hubbard <jhubbard@xxxxxxxxxx> wrote:
>
> Remarkable, in the sense that it seems like an oversight at the Rust
> language level.
>
> Alex, Miguel, is this worth mentioning at Kangrejos?
Yeah, it wouldn't hurt to discuss it if we have time, since we will
want an improvement here one way or another.
I raised it to upstream Rust in our last meeting last week (we also
discussed integer casts), i.e. they are aware and they agree some of
this can definitely be improved. It is of course not a new thing for
them, e.g. this issue:
https://github.com/rust-lang/rust/issues/69329
I also have it in our usual lists ("Better `NonZero` ergonomics
(`f(1)` integer literal coercion, `1nz` literals or other
solutions)"):
https://github.com/Rust-for-Linux/linux/issues/354
I hope that helps!
Cheers,
Miguel