summaryrefslogtreecommitdiffstats
path: root/tests/ui/binding/nested-matchs.rs
blob: 29490fd48887b98ca7a8342818dc5314882a4054 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// 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(); } }
        println!("{}", bar);
      }
      None::<isize> => { println!("hello"); }
    }
}

pub fn main() { foo(); }