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
+
1
4
struct A {
2
5
b : B ,
3
6
}
Original file line number Diff line number Diff line change 1
1
error[E0308]: mismatched types
2
- --> $DIR/field-access.rs:12 :12
2
+ --> $DIR/field-access.rs:15 :12
3
3
|
4
4
LL | Fst,
5
5
| --- unit variant defined here
@@ -15,7 +15,7 @@ LL | if let B::Fst = a.b {};
15
15
| ^^^
16
16
17
17
error[E0308]: mismatched types
18
- --> $DIR/field-access.rs:16 :9
18
+ --> $DIR/field-access.rs:19 :9
19
19
|
20
20
LL | Fst,
21
21
| --- unit variant defined here
@@ -31,7 +31,7 @@ LL | match a.b {
31
31
| ^^^
32
32
33
33
error[E0308]: mismatched types
34
- --> $DIR/field-access.rs:17 :9
34
+ --> $DIR/field-access.rs:20 :9
35
35
|
36
36
LL | Snd,
37
37
| --- unit variant defined here
You can’t perform that action at this time.
0 commit comments