- 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>
17 lines
278 B
Rust
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() {}
|