rust/tests/ui/binding/nested-matchs.rs

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

17 lines
394 B
Rust
Raw Normal View History

// run-pass
#![allow(unused_mut)] // under NLL we get warning about `bar` below
fn baz() -> ! { panic!(); }
fn foo() {
match Some::<isize>(5) {
Some::<isize>(_x) => {
let mut bar;
match None::<isize> { None::<isize> => { bar = 5; } _ => { baz(); } }
2014-10-15 01:07:11 +00:00
println!("{}", bar);
2011-07-27 12:19:39 +00:00
}
None::<isize> => { println!("hello"); }
}
}
pub fn main() { foo(); }