Skip to content

Commit 606743e

Browse files
authored
Rollup merge of rust-lang#65880 - Nadrieril:gather-usefulness-tests, r=varkor
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.
2 parents 75a127c + 09f9947 commit 606743e

File tree

55 files changed

+6
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+6
-3
lines changed

src/librustc_mir/hair/pattern/_match.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/// Note: most tests relevant to this file can be found (at the time of writing)
2+
/// in src/tests/ui/pattern/usefulness.
3+
///
14
/// This file includes the logic for exhaustiveness and usefulness checking for
25
/// pattern-matching. Specifically, given a list of patterns for a type, we can
36
/// tell whether:

src/test/ui/match/match-argm-statics-2.stderr renamed to src/test/ui/pattern/usefulness/match-arm-statics-2.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
error[E0004]: non-exhaustive patterns: `(true, false)` not covered
2-
--> $DIR/match-argm-statics-2.rs:17:11
2+
--> $DIR/match-arm-statics-2.rs:17:11
33
|
44
LL | match (true, false) {
55
| ^^^^^^^^^^^^^ pattern `(true, false)` not covered
66
|
77
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
88

99
error[E0004]: non-exhaustive patterns: `Some(Some(West))` not covered
10-
--> $DIR/match-argm-statics-2.rs:29:11
10+
--> $DIR/match-arm-statics-2.rs:29:11
1111
|
1212
LL | match Some(Some(North)) {
1313
| ^^^^^^^^^^^^^^^^^ pattern `Some(Some(West))` not covered
1414
|
1515
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
1616

1717
error[E0004]: non-exhaustive patterns: `Foo { bar: Some(North), baz: NewBool(true) }` not covered
18-
--> $DIR/match-argm-statics-2.rs:48:11
18+
--> $DIR/match-arm-statics-2.rs:48:11
1919
|
2020
LL | / struct Foo {
2121
LL | | bar: Option<Direction>,

0 commit comments

Comments
 (0)