rust/tests/ui/expr-if-panic-all.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
237 B
Rust
Raw Normal View History

//@ run-pass
// When all branches of an if expression result in panic, the entire if
// expression results in panic.
2013-08-17 15:37:42 +00:00
pub fn main() {
let _x = if true {
2015-01-25 21:05:03 +00:00
10
2013-08-17 15:37:42 +00:00
} else {
if true { panic!() } else { panic!() }
2013-08-17 15:37:42 +00:00
};
}