Re: [PATCH] rust: macros: Replace match + panic in const context with const expect
From: Miguel Ojeda
Date: Thu May 28 2026 - 05:34:22 EST
On Wed, Apr 8, 2026 at 10:10 PM CastilloDel
<delcastillodelarosadaniel@xxxxxxxxx> wrote:
>
> This patch replaces an instance of match + panic with const expect,
> which is now usable in const contexts after the MSRV was was updated to
> 1.85.0 (it was available since Rust 1.83.0).
>
> Signed-off-by: Daniel del Castillo <delcastillodelarosadaniel@xxxxxxxxx>
> Suggested-by: Gary Guo <gary@xxxxxxxxxxx>
> Link: https://github.com/Rust-for-Linux/linux/issues/1229
Applied to `rust-next` -- thanks!
[ Adjusted Git author's name with the Signed-off-by value. Reworded
slightly and removed duplicated word. - Miguel ]
Please shout if the author adjustment is not correct (and please check
your Git settings so that Git uses the right one when creating the
commit for the future).
By the way, `scripts/checkpatch.pl` can help you catch nits like that :)
Cheers,
Miguel