rust/tests/ui/match/expr-match-panic-fn.rs

20 lines
230 B
Rust
Raw Permalink Normal View History

//@ run-fail
//@ error-pattern:explicit panic
//@ needs-subprocess
2011-06-11 00:27:34 +00:00
2016-05-27 02:39:36 +00:00
fn f() -> ! {
panic!()
}
2011-06-11 00:27:34 +00:00
2016-05-27 02:39:36 +00:00
fn g() -> isize {
let x = match true {
true => f(),
false => 10,
};
return x;
}
2011-06-11 00:27:34 +00:00
2016-05-27 02:39:36 +00:00
fn main() {
g();
}