rust/tests/ui/did_you_mean/compatible-variants-in-pat.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
656 B
Rust
Raw Normal View History

enum Foo {
Bar(Bar),
}
struct Bar {
x: i32,
}
fn a(f: Foo) {
match f {
Bar { x } => {
//~^ ERROR mismatched types
//~| HELP try wrapping
}
}
}
struct S;
fn b(s: Option<S>) {
match s {
S => {
//~^ ERROR mismatched types
//~| HELP try wrapping
//~| HELP introduce a new binding instead
}
_ => {}
}
}
fn c(s: Result<S, S>) {
match s {
S => {
//~^ ERROR mismatched types
//~| HELP try wrapping
//~| HELP introduce a new binding instead
}
_ => {}
}
}
fn main() {}