]> git.lizzy.rs Git - rust.git/blob - src/test/ui/binding/nested-pattern.rs
Merge commit '6ed6f1e6a1a8f414ba7e6d9b8222e7e5a1686e42' into clippyup
[rust.git] / src / test / ui / binding / nested-pattern.rs
1 // run-pass
2 #![allow(dead_code)]
3 #![allow(non_camel_case_types)]
4
5 // a bug was causing this to complain about leaked memory on exit
6
7 enum t { foo(isize, usize), bar(isize, Option<isize>), }
8
9 fn nested(o: t) {
10     match o {
11         t::bar(_i, Some::<isize>(_)) => { println!("wrong pattern matched"); panic!(); }
12         _ => { println!("succeeded"); }
13     }
14 }
15
16 pub fn main() { nested(t::bar(1, None::<isize>)); }