blob: c38ea6ab9ad019473d3b59c5d4d2d7372a03feb0 [file] [log] [blame]
#![deny(unreachable_code)]
#![allow(dead_code)]
fn foo(x: !) -> bool {
// Explicit matches on the never type are unwarned.
match x {}
// But matches in unreachable code are warned.
match x {} //~ ERROR unreachable expression
}
fn bar() {
match (return) {
() => () //~ ERROR unreachable arm
}
}
fn main() {
return;
match () { //~ ERROR unreachable expression
() => (),
}
}