]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust: error: replace match + panic in const context with const expect
authorDaniel del Castillo <delcastillodelarosadaniel@gmail.com>
Wed, 8 Apr 2026 20:09:39 +0000 (22:09 +0200)
committerMiguel Ojeda <ojeda@kernel.org>
Thu, 28 May 2026 09:08:27 +0000 (11:08 +0200)
commit2da76b814ec068e88d2260da5fa8575012227a5a
tree18e8fce4adf3f91673e245c02074c2b491578938
parent3cd202c03934a2c0d95e12aff90def47ec2e20f7
rust: error: replace match + panic in const context with const expect

This patch replaces an instance of match + panic with const expect,
which is now usable in const contexts after the MSRV was updated to
1.85.0 (it was available since Rust 1.83.0).

Suggested-by: Gary Guo <gary@garyguo.net>
Link: https://github.com/Rust-for-Linux/linux/issues/1229
Signed-off-by: Daniel del Castillo <delcastillodelarosadaniel@gmail.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://patch.msgid.link/20260408200949.99059-1-delcastillodelarosadaniel@gmail.com
[ Adjusted Git author's name with the Signed-off-by value. Reworded
  slightly and removed duplicated word. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/error.rs