Skip to content

Commit

Permalink
Rollup merge of #65880 - Nadrieril:gather-usefulness-tests, r=varkor
Browse files Browse the repository at this point in the history
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. I found it helpful to have them all in the same place when working on the usefulness algorithm.
  • Loading branch information
Centril authored Oct 28, 2019
2 parents 75a127c + 09f9947 commit 606743e
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 606743e

Please sign in to comment.