]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/ignore-all-the-things.rs
Auto merge of #54265 - arielb1:civilize-proc-macros, r=alexcrichton
[rust.git] / src / test / run-pass / ignore-all-the-things.rs
1 // Copyright 2012 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.
4 //
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
11 #![allow(non_shorthand_field_patterns)]
12 #![allow(dead_code)]
13 #![allow(unused_variables)]
14 // pretty-expanded FIXME #23616
15
16 #![feature(slice_patterns)]
17
18 struct Foo(isize, isize, isize, isize);
19 struct Bar{a: isize, b: isize, c: isize, d: isize}
20
21 pub fn main() {
22     let Foo(..) = Foo(5, 5, 5, 5);
23     let Foo(..) = Foo(5, 5, 5, 5);
24     let Bar{..} = Bar{a: 5, b: 5, c: 5, d: 5};
25     let (..) = (5, 5, 5, 5);
26     let Foo(a, b, ..) = Foo(5, 5, 5, 5);
27     let Foo(.., d) = Foo(5, 5, 5, 5);
28     let (a, b, ..) = (5, 5, 5, 5);
29     let (.., c, d) = (5, 5, 5, 5);
30     let Bar{b: b, ..} = Bar{a: 5, b: 5, c: 5, d: 5};
31     match [5, 5, 5, 5] {
32         [..] => { }
33     }
34     match [5, 5, 5, 5] {
35         [a, ..] => { }
36     }
37     match [5, 5, 5, 5] {
38         [.., b] => { }
39     }
40     match [5, 5, 5, 5] {
41         [a, .., b] => { }
42     }
43     match [5, 5, 5] {
44         [..] => { }
45     }
46     match [5, 5, 5] {
47         [a, ..] => { }
48     }
49     match [5, 5, 5] {
50         [.., a] => { }
51     }
52     match [5, 5, 5] {
53         [a, .., b] => { }
54     }
55 }