]> git.lizzy.rs Git - rust.git/blob - src/test/ui/empty/empty-struct-braces-pat-2.rs
Merge commit '8da837185714cefbb261e93e9846afb11c1dc60e' into sync-rustfmt-subtree
[rust.git] / src / test / ui / empty / empty-struct-braces-pat-2.rs
1 // Can't use empty braced struct as enum pattern
2
3 // aux-build:empty-struct.rs
4
5 extern crate empty_struct;
6 use empty_struct::*;
7
8 struct Empty1 {}
9
10 fn main() {
11     let e1 = Empty1 {};
12     let xe1 = XEmpty1 {};
13
14     match e1 {
15         Empty1() => () //~ ERROR expected tuple struct or tuple variant, found struct `Empty1`
16     }
17     match xe1 {
18         XEmpty1() => () //~ ERROR expected tuple struct or tuple variant, found struct `XEmpty1`
19     }
20     match e1 {
21         Empty1(..) => () //~ ERROR expected tuple struct or tuple variant, found struct `Empty1`
22     }
23     match xe1 {
24         XEmpty1(..) => () //~ ERROR expected tuple struct or tuple variant, found struct `XEmpty1`
25     }
26 }