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 {
1212
1313fn main() {
1414 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`
1817 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]
2122 }
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`
2623}
Original file line number Diff line number Diff line change @@ -12,15 +12,12 @@ enum B {
1212
1313fn main ( ) {
1414 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`
1817 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]
2122 }
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`
2623}
Original file line number Diff line number Diff line change @@ -15,13 +15,14 @@ LL | if let B::Fst = a.b {};
1515 | ^^^
1616
1717error[E0308]: mismatched types
18- --> $DIR/field-access.rs:19 :9
18+ --> $DIR/field-access.rs:20 :9
1919 |
2020LL | Fst,
2121 | --- unit variant defined here
2222...
2323LL | match a {
2424 | - this expression has type `A`
25+ ...
2526LL | B::Fst => (),
2627 | ^^^^^^ expected struct `A`, found enum `B`
2728 |
@@ -31,14 +32,14 @@ LL | match a.b {
3132 | ^^^
3233
3334error[E0308]: mismatched types
34- --> $DIR/field-access.rs:20 :9
35+ --> $DIR/field-access.rs:21 :9
3536 |
3637LL | Snd,
3738 | --- unit variant defined here
3839...
3940LL | match a {
4041 | - this expression has type `A`
41- LL | B::Fst => (),
42+ ...
4243LL | B::Snd => (),
4344 | ^^^^^^ expected struct `A`, found enum `B`
4445 |
You can’t perform that action at this time.
0 commit comments