2021-01-29 07:33:15 +00:00
|
|
|
// run-rustfix
|
|
|
|
#![allow(dead_code)]
|
|
|
|
|
2021-01-28 20:43:35 +00:00
|
|
|
struct A {
|
|
|
|
b: B,
|
|
|
|
}
|
|
|
|
|
|
|
|
enum B {
|
|
|
|
Fst,
|
|
|
|
Snd,
|
|
|
|
}
|
|
|
|
|
|
|
|
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`
|
2021-01-29 07:28:53 +00:00
|
|
|
match a {
|
|
|
|
B::Fst => (),
|
|
|
|
B::Snd => (),
|
|
|
|
}
|
|
|
|
//~^^^ 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`
|
2021-01-28 20:43:35 +00:00
|
|
|
}
|