rust/src/test/run-pass/expr-if-panic-all.rs

11 lines
224 B
Rust
Raw Normal View History

// 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
};
}