]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-51102.rs
Rollup merge of #62337 - Mark-Simulacrum:fix-cpu-usage-script, r=alexcrichton
[rust.git] / src / test / ui / issues / issue-51102.rs
1 enum SimpleEnum {
2     NoState,
3 }
4
5 struct SimpleStruct {
6     no_state_here: u64,
7 }
8
9 fn main() {
10     let _ = |simple| {
11         match simple {
12             SimpleStruct {
13                 state: 0,
14                 //~^ struct `SimpleStruct` does not have a field named `state` [E0026]
15                 ..
16             } => (),
17         }
18     };
19
20     let _ = |simple| {
21         match simple {
22             SimpleStruct {
23                 no_state_here: 0,
24                 no_state_here: 1
25                 //~^ ERROR field `no_state_here` bound multiple times in the pattern [E0025]
26             } => (),
27         }
28     };
29
30     let _ = |simple| {
31         match simple {
32             SimpleEnum::NoState {
33                 state: 0
34                 //~^ ERROR variant `SimpleEnum::NoState` does not have a field named `state` [E0026]
35             } => (),
36         }
37     };
38 }