1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10 // pretty-expanded FIXME #23616
12 #![feature(box_patterns)]
13 #![feature(box_syntax)]
16 StructVar { boxed: Box<i32> }
21 // Test matching each shorthand notation for field patterns.
22 let mut a
= E
::StructVar { boxed: box 3 }
;
24 E
::StructVar { box boxed }
=> { }
27 E
::StructVar { box ref boxed }
=> { }
30 E
::StructVar { box mut boxed }
=> { }
33 E
::StructVar { box ref mut boxed }
=> { }
36 E
::StructVar { ref boxed }
=> { }
39 E
::StructVar { ref mut boxed }
=> { }
42 E
::StructVar { mut boxed }
=> { }
45 // Test matching non shorthand notation. Recreate a since last test
47 let mut a
= E
::StructVar { boxed: box 3 }
;
49 E
::StructVar { boxed: box ref mut num }
=> { }
52 E
::StructVar { boxed: ref mut num }
=> { }