Use enum Void to avoid mistmatched types error Signed-off-by: Shunpoco <tkngsnsk313320@gmail.com>
15 lines
304 B
Rust
15 lines
304 B
Rust
#![feature(never_type)]
|
|
#![feature(never_patterns)]
|
|
#![allow(incomplete_features)]
|
|
|
|
enum Void {}
|
|
|
|
fn foo(x: Void) {
|
|
match x {
|
|
(!|!) if true => {} //~ ERROR a never pattern is always unreachable
|
|
(!|!) if true => {} //~ ERROR a never pattern is always unreachable
|
|
}
|
|
}
|
|
|
|
fn main() {}
|