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

20 lines
230 B
Rust
Raw Normal View History

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