]> git.lizzy.rs Git - rust.git/blob - src/test/ui/empty/empty-struct-braces-pat-3.rs
Rollup merge of #103159 - cuviper:check_pow-final-try_opt, r=Mark-Simulacrum
[rust.git] / src / test / ui / empty / empty-struct-braces-pat-3.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 enum E {
9     Empty3 {}
10 }
11
12 fn main() {
13     let e3 = E::Empty3 {};
14     let xe3 = XE::XEmpty3 {};
15
16     match e3 {
17         E::Empty3() => ()
18         //~^ ERROR expected tuple struct or tuple variant, found struct variant `E::Empty3`
19     }
20     match xe3 {
21         XE::XEmpty3() => ()
22         //~^ ERROR expected tuple struct or tuple variant, found struct variant `XE::XEmpty3`
23     }
24     match e3 {
25         E::Empty3(..) => ()
26         //~^ ERROR expected tuple struct or tuple variant, found struct variant `E::Empty3`
27     }
28     match xe3 {
29         XE::XEmpty3(..) => ()
30         //~^ ERROR expected tuple struct or tuple variant, found struct variant `XE::XEmpty3
31     }
32 }