diff --git a/src/test/ui/suggestions/field-access.fixed b/src/test/ui/suggestions/field-access.fixed index d580902f2e7..72b29d7656a 100644 --- a/src/test/ui/suggestions/field-access.fixed +++ b/src/test/ui/suggestions/field-access.fixed @@ -12,15 +12,12 @@ enum B { fn main() { let a = A { b: B::Fst }; - if let B::Fst = a.b {}; - //~^ ERROR mismatched types [E0308] - // note: you might have meant to use field `b` of type `B` + if let B::Fst = a.b {}; //~ ERROR mismatched types [E0308] + //~^ HELP you might have meant to use field `b` of type `B` match a.b { - B::Fst => (), - B::Snd => (), + //~^ HELP you might have meant to use field `b` of type `B` + //~| HELP you might have meant to use field `b` of type `B` + B::Fst => (), //~ ERROR mismatched types [E0308] + B::Snd => (), //~ ERROR mismatched types [E0308] } - //~^^^ ERROR mismatched types [E0308] - // note: you might have meant to use field `b` of type `B` - //~^^^^ ERROR mismatched types [E0308] - // note: you might have meant to use field `b` of type `B` } diff --git a/src/test/ui/suggestions/field-access.rs b/src/test/ui/suggestions/field-access.rs index ed6f9b2112b..2710ead4dfb 100644 --- a/src/test/ui/suggestions/field-access.rs +++ b/src/test/ui/suggestions/field-access.rs @@ -12,15 +12,12 @@ enum B { fn main() { let a = A { b: B::Fst }; - if let B::Fst = a {}; - //~^ ERROR mismatched types [E0308] - // note: you might have meant to use field `b` of type `B` + if let B::Fst = a {}; //~ ERROR mismatched types [E0308] + //~^ HELP you might have meant to use field `b` of type `B` match a { - B::Fst => (), - B::Snd => (), + //~^ HELP you might have meant to use field `b` of type `B` + //~| HELP you might have meant to use field `b` of type `B` + B::Fst => (), //~ ERROR mismatched types [E0308] + B::Snd => (), //~ ERROR mismatched types [E0308] } - //~^^^ ERROR mismatched types [E0308] - // note: you might have meant to use field `b` of type `B` - //~^^^^ ERROR mismatched types [E0308] - // note: you might have meant to use field `b` of type `B` } diff --git a/src/test/ui/suggestions/field-access.stderr b/src/test/ui/suggestions/field-access.stderr index ba7e145c217..228510902f5 100644 --- a/src/test/ui/suggestions/field-access.stderr +++ b/src/test/ui/suggestions/field-access.stderr @@ -15,13 +15,14 @@ LL | if let B::Fst = a.b {}; | ^^^ error[E0308]: mismatched types - --> $DIR/field-access.rs:19:9 + --> $DIR/field-access.rs:20:9 | LL | Fst, | --- unit variant defined here ... LL | match a { | - this expression has type `A` +... LL | B::Fst => (), | ^^^^^^ expected struct `A`, found enum `B` | @@ -31,14 +32,14 @@ LL | match a.b { | ^^^ error[E0308]: mismatched types - --> $DIR/field-access.rs:20:9 + --> $DIR/field-access.rs:21:9 | LL | Snd, | --- unit variant defined here ... LL | match a { | - this expression has type `A` -LL | B::Fst => (), +... LL | B::Snd => (), | ^^^^^^ expected struct `A`, found enum `B` |