File tree Expand file tree Collapse file tree 3 files changed +16
-21
lines changed Expand file tree Collapse file tree 3 files changed +16
-21
lines changed Original file line number Diff line number Diff line change @@ -12,15 +12,12 @@ enum B {
12
12
13
13
fn main() {
14
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`
15
+ if let B::Fst = a.b {}; //~ ERROR mismatched types [E0308]
16
+ //~^ HELP you might have meant to use field `b` of type `B`
18
17
match a.b {
19
- B::Fst => (),
20
- B::Snd => (),
18
+ //~^ HELP you might have meant to use field `b` of type `B`
19
+ //~| HELP you might have meant to use field `b` of type `B`
20
+ B::Fst => (), //~ ERROR mismatched types [E0308]
21
+ B::Snd => (), //~ ERROR mismatched types [E0308]
21
22
}
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
23
}
Original file line number Diff line number Diff line change @@ -12,15 +12,12 @@ enum B {
12
12
13
13
fn main ( ) {
14
14
let a = A { b : B :: Fst } ;
15
- if let B :: Fst = a { } ;
16
- //~^ ERROR mismatched types [E0308]
17
- // note: you might have meant to use field `b` of type `B`
15
+ if let B :: Fst = a { } ; //~ ERROR mismatched types [E0308]
16
+ //~^ HELP you might have meant to use field `b` of type `B`
18
17
match a {
19
- B :: Fst => ( ) ,
20
- B :: Snd => ( ) ,
18
+ //~^ HELP you might have meant to use field `b` of type `B`
19
+ //~| HELP you might have meant to use field `b` of type `B`
20
+ B :: Fst => ( ) , //~ ERROR mismatched types [E0308]
21
+ B :: Snd => ( ) , //~ ERROR mismatched types [E0308]
21
22
}
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
23
}
Original file line number Diff line number Diff line change @@ -15,13 +15,14 @@ LL | if let B::Fst = a.b {};
15
15
| ^^^
16
16
17
17
error[E0308]: mismatched types
18
- --> $DIR/field-access.rs:19 :9
18
+ --> $DIR/field-access.rs:20 :9
19
19
|
20
20
LL | Fst,
21
21
| --- unit variant defined here
22
22
...
23
23
LL | match a {
24
24
| - this expression has type `A`
25
+ ...
25
26
LL | B::Fst => (),
26
27
| ^^^^^^ expected struct `A`, found enum `B`
27
28
|
@@ -31,14 +32,14 @@ LL | match a.b {
31
32
| ^^^
32
33
33
34
error[E0308]: mismatched types
34
- --> $DIR/field-access.rs:20 :9
35
+ --> $DIR/field-access.rs:21 :9
35
36
|
36
37
LL | Snd,
37
38
| --- unit variant defined here
38
39
...
39
40
LL | match a {
40
41
| - this expression has type `A`
41
- LL | B::Fst => (),
42
+ ...
42
43
LL | B::Snd => (),
43
44
| ^^^^^^ expected struct `A`, found enum `B`
44
45
|
You can’t perform that action at this time.
0 commit comments