summaryrefslogtreecommitdiffstats
path: root/src/test/ui/binding/nested-pattern.rs
blob: 7d14c9ad9b730a95f36e64448a27c0185249451c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// run-pass
#![allow(dead_code)]
#![allow(non_camel_case_types)]

// a bug was causing this to complain about leaked memory on exit

enum t { foo(isize, usize), bar(isize, Option<isize>), }

fn nested(o: t) {
    match o {
        t::bar(_i, Some::<isize>(_)) => { println!("wrong pattern matched"); panic!(); }
        _ => { println!("succeeded"); }
    }
}

pub fn main() { nested(t::bar(1, None::<isize>)); }