Gather together usefulness tests
I took most tests that were testing only for match exhaustiveness, pattern refutability or match arm reachability, and put them in the same test folder.
This commit is contained in:
parent
0f677c65e8
commit
09f9947ebc
@ -1,3 +1,6 @@
|
||||
/// Note: most tests relevant to this file can be found (at the time of writing)
|
||||
/// in src/tests/ui/pattern/usefulness.
|
||||
///
|
||||
/// This file includes the logic for exhaustiveness and usefulness checking for
|
||||
/// pattern-matching. Specifically, given a list of patterns for a type, we can
|
||||
/// tell whether:
|
||||
|
@ -1,5 +1,5 @@
|
||||
error[E0004]: non-exhaustive patterns: `(true, false)` not covered
|
||||
--> $DIR/match-argm-statics-2.rs:17:11
|
||||
--> $DIR/match-arm-statics-2.rs:17:11
|
||||
|
|
||||
LL | match (true, false) {
|
||||
| ^^^^^^^^^^^^^ pattern `(true, false)` not covered
|
||||
@ -7,7 +7,7 @@ LL | match (true, false) {
|
||||
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `Some(Some(West))` not covered
|
||||
--> $DIR/match-argm-statics-2.rs:29:11
|
||||
--> $DIR/match-arm-statics-2.rs:29:11
|
||||
|
|
||||
LL | match Some(Some(North)) {
|
||||
| ^^^^^^^^^^^^^^^^^ pattern `Some(Some(West))` not covered
|
||||
@ -15,7 +15,7 @@ LL | match Some(Some(North)) {
|
||||
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `Foo { bar: Some(North), baz: NewBool(true) }` not covered
|
||||
--> $DIR/match-argm-statics-2.rs:48:11
|
||||
--> $DIR/match-arm-statics-2.rs:48:11
|
||||
|
|
||||
LL | / struct Foo {
|
||||
LL | | bar: Option<Direction>,
|
Loading…
x
Reference in New Issue
Block a user