]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/field-access.fixed
Add rust-fix test
[rust.git] / src / test / ui / suggestions / field-access.fixed
1 // run-rustfix
2 #![allow(dead_code)]
3
4 struct A {
5     b: B,
6 }
7
8 enum B {
9     Fst,
10     Snd,
11 }
12
13 fn main() {
14     let a = A { b: B::Fst };
15     if let B::Fst = a.b {};
16     //~^ ERROR mismatched types [E0308]
17     // note: you might have meant to use field `b` of type `B`
18     match a.b {
19         B::Fst => (),
20         B::Snd => (),
21     }
22     //~^^^ ERROR mismatched types [E0308]
23     // note: you might have meant to use field `b` of type `B`
24     //~^^^^ ERROR mismatched types [E0308]
25     // note: you might have meant to use field `b` of type `B`
26 }