File tree Expand file tree Collapse file tree 3 files changed +32
-3
lines changed Expand file tree Collapse file tree 3 files changed +32
-3
lines changed Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 1+ // run-rustfix
2+ #![ allow( dead_code) ]
3+
14struct A {
25 b : B ,
36}
Original file line number Diff line number Diff line change 11error[E0308]: mismatched types
2- --> $DIR/field-access.rs:12 :12
2+ --> $DIR/field-access.rs:15 :12
33 |
44LL | Fst,
55 | --- unit variant defined here
@@ -15,7 +15,7 @@ LL | if let B::Fst = a.b {};
1515 | ^^^
1616
1717error[E0308]: mismatched types
18- --> $DIR/field-access.rs:16 :9
18+ --> $DIR/field-access.rs:19 :9
1919 |
2020LL | Fst,
2121 | --- unit variant defined here
@@ -31,7 +31,7 @@ LL | match a.b {
3131 | ^^^
3232
3333error[E0308]: mismatched types
34- --> $DIR/field-access.rs:17 :9
34+ --> $DIR/field-access.rs:20 :9
3535 |
3636LL | Snd,
3737 | --- unit variant defined here
You can’t perform that action at this time.
0 commit comments