]> git.lizzy.rs Git - rust.git/blob - tests/ui/did_you_mean/compatible-variants-in-pat.rs
Rollup merge of #103236 - tspiteri:redoc-int-adc-sbb, r=m-ou-se
[rust.git] / tests / ui / did_you_mean / compatible-variants-in-pat.rs
1 enum Foo {
2     Bar(Bar),
3 }
4 struct Bar {
5     x: i32,
6 }
7
8 fn a(f: Foo) {
9     match f {
10         Bar { x } => {
11             //~^ ERROR mismatched types
12             //~| HELP try wrapping
13         }
14     }
15 }
16
17 struct S;
18
19 fn b(s: Option<S>) {
20     match s {
21         S => {
22             //~^ ERROR mismatched types
23             //~| HELP try wrapping
24             //~| HELP introduce a new binding instead
25         }
26         _ => {}
27     }
28 }
29
30 fn c(s: Result<S, S>) {
31     match s {
32         S => {
33             //~^ ERROR mismatched types
34             //~| HELP try wrapping
35             //~| HELP introduce a new binding instead
36         }
37         _ => {}
38     }
39 }
40
41 fn main() {}