Files
rust/tests/ui/rfcs/rfc-0000-never_patterns/ICE-133063-never-arm-no-otherwise-block.rs
Shunpoco d8a216b866 address review: modify ICE-133063-never-arm-no-otherwise-block.rs
- Use enum Void to avoid mismatched types error
- We don't need to use if let to check the ICE

Signed-off-by: Shunpoco <tkngsnsk313320@gmail.com>
2025-01-22 01:27:15 +00:00

17 lines
278 B
Rust

#![feature(never_type)]
#![feature(never_patterns)]
#![allow(incomplete_features)]
enum Void {}
fn foo(x: Void) {
loop {
match x {
(!|!) if false => {} //~ ERROR a never pattern is always unreachable
_ => {}
}
}
}
fn main() {}