]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unique/unique-pat-2.rs
Merge commit '984330a6ee3c4d15626685d6dc8b7b759ff630bd' into clippyup
[rust.git] / src / test / ui / unique / unique-pat-2.rs
1 // run-pass
2 #![allow(dead_code)]
3 #![allow(non_camel_case_types)]
4 #![allow(non_shorthand_field_patterns)]
5
6 #![feature(box_patterns)]
7
8 struct Foo {a: isize, b: usize}
9
10 enum bar { u(Box<Foo>), w(isize), }
11
12 pub fn main() {
13     let v = match bar::u(Box::new(Foo{ a: 10, b: 40 })) {
14         bar::u(box Foo{ a: a, b: b }) => { a + (b as isize) }
15         _ => { 66 }
16     };
17     assert_eq!(v, 50);
18 }