Fix test to check help message as well
This commit is contained in:
parent
f641f5133b
commit
ad9f707bf5
@ -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`
|
||||
}
|
||||
|
@ -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`
|
||||
}
|
||||
|
@ -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`
|
||||
|
|
||||
|
Loading…
Reference in New Issue
Block a user