mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 05:03:21 +00:00
Add a test for regular wildcard
fix
This commit is contained in:
parent
055f349670
commit
ebb0759bb3
3 changed files with 19 additions and 1 deletions
|
@ -146,5 +146,11 @@ mod issue9993 {
|
|||
Foo::A(false) => 2,
|
||||
Foo::B => 3,
|
||||
};
|
||||
|
||||
let _ = match Foo::B {
|
||||
_ if false => 0,
|
||||
Foo::A(_) => 1,
|
||||
Foo::B => 2,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -146,5 +146,11 @@ mod issue9993 {
|
|||
Foo::A(false) => 2,
|
||||
Foo::B => 3,
|
||||
};
|
||||
|
||||
let _ = match Foo::B {
|
||||
_ if false => 0,
|
||||
Foo::A(_) => 1,
|
||||
_ => 2,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,5 +48,11 @@ error: wildcard matches only a single variant and will also match any future add
|
|||
LL | _ => (),
|
||||
| ^ help: try this: `Color::Blue`
|
||||
|
||||
error: aborting due to 8 previous errors
|
||||
error: wildcard matches only a single variant and will also match any future added variants
|
||||
--> $DIR/match_wildcard_for_single_variants.rs:153:13
|
||||
|
|
||||
LL | _ => 2,
|
||||
| ^ help: try this: `Foo::B`
|
||||
|
||||
error: aborting due to 9 previous errors
|
||||
|
||||
|
|
Loading…
Reference in a new issue