Skip to content

Commit

Permalink
Gather together usefulness tests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Nadrieril committed Oct 27, 2019
1 parent 0f677c6 commit 09f9947
Show file tree
Hide file tree
Showing 55 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/librustc_mir/hair/pattern/_match.rs
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
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
|
= 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
|
= 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>,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 09f9947

Please sign in to comment.