rust/tests/ui/match/match-tail-expr-never-type-...

17 lines
233 B
Rust

fn never() -> ! {
loop {}
}
fn bar(a: bool) {
match a {
true => 1,
false => {
never() //~ ERROR `match` arms have incompatible types
}
}
}
fn main() {
bar(true);
bar(false);
}