Skip to content

Commit

Permalink
Deduplicate some tests using revisions
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadrieril committed Jan 12, 2021
1 parent 497c9a2 commit 622bfdb
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 227 deletions.
@@ -1,59 +1,59 @@
error: unreachable pattern
--> $DIR/match-empty-exhaustive_patterns.rs:52:9
--> $DIR/empty-match.rs:53:9
|
LL | _ => {},
| ^
|
note: the lint level is defined here
--> $DIR/match-empty-exhaustive_patterns.rs:5:9
--> $DIR/empty-match.rs:6:9
|
LL | #![deny(unreachable_patterns)]
| ^^^^^^^^^^^^^^^^^^^^

error: unreachable pattern
--> $DIR/match-empty-exhaustive_patterns.rs:55:9
--> $DIR/empty-match.rs:56:9
|
LL | _ if false => {},
| ^

error: unreachable pattern
--> $DIR/match-empty-exhaustive_patterns.rs:62:9
--> $DIR/empty-match.rs:63:9
|
LL | _ => {},
| ^

error: unreachable pattern
--> $DIR/match-empty-exhaustive_patterns.rs:65:9
--> $DIR/empty-match.rs:66:9
|
LL | _ if false => {},
| ^

error: unreachable pattern
--> $DIR/match-empty-exhaustive_patterns.rs:72:9
--> $DIR/empty-match.rs:73:9
|
LL | _ => {},
| ^

error: unreachable pattern
--> $DIR/match-empty-exhaustive_patterns.rs:75:9
--> $DIR/empty-match.rs:76:9
|
LL | _ if false => {},
| ^

error: unreachable pattern
--> $DIR/match-empty-exhaustive_patterns.rs:82:9
--> $DIR/empty-match.rs:83:9
|
LL | Some(_) => {}
| ^^^^^^^

error: unreachable pattern
--> $DIR/match-empty-exhaustive_patterns.rs:86:9
--> $DIR/empty-match.rs:87:9
|
LL | Some(_) => {}
| ^^^^^^^

error[E0004]: non-exhaustive patterns: type `u8` is non-empty
--> $DIR/match-empty-exhaustive_patterns.rs:89:18
--> $DIR/empty-match.rs:90:18
|
LL | match_empty!(0u8);
| ^^^
Expand All @@ -62,7 +62,7 @@ LL | match_empty!(0u8);
= note: the matched value is of type `u8`

error[E0004]: non-exhaustive patterns: type `NonEmptyStruct` is non-empty
--> $DIR/match-empty-exhaustive_patterns.rs:91:18
--> $DIR/empty-match.rs:92:18
|
LL | struct NonEmptyStruct(bool);
| ---------------------------- `NonEmptyStruct` defined here
Expand All @@ -74,7 +74,7 @@ LL | match_empty!(NonEmptyStruct(true));
= note: the matched value is of type `NonEmptyStruct`

error[E0004]: non-exhaustive patterns: type `NonEmptyUnion1` is non-empty
--> $DIR/match-empty-exhaustive_patterns.rs:93:18
--> $DIR/empty-match.rs:94:18
|
LL | / union NonEmptyUnion1 {
LL | | foo: (),
Expand All @@ -88,7 +88,7 @@ LL | match_empty!((NonEmptyUnion1 { foo: () }));
= note: the matched value is of type `NonEmptyUnion1`

error[E0004]: non-exhaustive patterns: type `NonEmptyUnion2` is non-empty
--> $DIR/match-empty-exhaustive_patterns.rs:95:18
--> $DIR/empty-match.rs:96:18
|
LL | / union NonEmptyUnion2 {
LL | | foo: (),
Expand All @@ -103,7 +103,7 @@ LL | match_empty!((NonEmptyUnion2 { foo: () }));
= note: the matched value is of type `NonEmptyUnion2`

error[E0004]: non-exhaustive patterns: `Foo(_)` not covered
--> $DIR/match-empty-exhaustive_patterns.rs:97:18
--> $DIR/empty-match.rs:98:18
|
LL | / enum NonEmptyEnum1 {
LL | | Foo(bool),
Expand All @@ -120,7 +120,7 @@ LL | match_empty!(NonEmptyEnum1::Foo(true));
= note: the matched value is of type `NonEmptyEnum1`

error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered
--> $DIR/match-empty-exhaustive_patterns.rs:99:18
--> $DIR/empty-match.rs:100:18
|
LL | / enum NonEmptyEnum2 {
LL | | Foo(bool),
Expand All @@ -141,7 +141,7 @@ LL | match_empty!(NonEmptyEnum2::Foo(true));
= note: the matched value is of type `NonEmptyEnum2`

error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered
--> $DIR/match-empty-exhaustive_patterns.rs:101:18
--> $DIR/empty-match.rs:102:18
|
LL | / enum NonEmptyEnum5 {
LL | | V1, V2, V3, V4, V5,
Expand All @@ -155,7 +155,7 @@ LL | match_empty!(NonEmptyEnum5::V1);
= note: the matched value is of type `NonEmptyEnum5`

error[E0004]: non-exhaustive patterns: `_` not covered
--> $DIR/match-empty-exhaustive_patterns.rs:104:18
--> $DIR/empty-match.rs:105:18
|
LL | match_false!(0u8);
| ^^^ pattern `_` not covered
Expand All @@ -164,7 +164,7 @@ LL | match_false!(0u8);
= note: the matched value is of type `u8`

error[E0004]: non-exhaustive patterns: `NonEmptyStruct(_)` not covered
--> $DIR/match-empty-exhaustive_patterns.rs:106:18
--> $DIR/empty-match.rs:107:18
|
LL | struct NonEmptyStruct(bool);
| ---------------------------- `NonEmptyStruct` defined here
Expand All @@ -176,7 +176,7 @@ LL | match_false!(NonEmptyStruct(true));
= note: the matched value is of type `NonEmptyStruct`

error[E0004]: non-exhaustive patterns: `NonEmptyUnion1 { .. }` not covered
--> $DIR/match-empty-exhaustive_patterns.rs:108:18
--> $DIR/empty-match.rs:109:18
|
LL | / union NonEmptyUnion1 {
LL | | foo: (),
Expand All @@ -190,7 +190,7 @@ LL | match_false!((NonEmptyUnion1 { foo: () }));
= note: the matched value is of type `NonEmptyUnion1`

error[E0004]: non-exhaustive patterns: `NonEmptyUnion2 { .. }` not covered
--> $DIR/match-empty-exhaustive_patterns.rs:110:18
--> $DIR/empty-match.rs:111:18
|
LL | / union NonEmptyUnion2 {
LL | | foo: (),
Expand All @@ -205,7 +205,7 @@ LL | match_false!((NonEmptyUnion2 { foo: () }));
= note: the matched value is of type `NonEmptyUnion2`

error[E0004]: non-exhaustive patterns: `Foo(_)` not covered
--> $DIR/match-empty-exhaustive_patterns.rs:112:18
--> $DIR/empty-match.rs:113:18
|
LL | / enum NonEmptyEnum1 {
LL | | Foo(bool),
Expand All @@ -222,7 +222,7 @@ LL | match_false!(NonEmptyEnum1::Foo(true));
= note: the matched value is of type `NonEmptyEnum1`

error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered
--> $DIR/match-empty-exhaustive_patterns.rs:114:18
--> $DIR/empty-match.rs:115:18
|
LL | / enum NonEmptyEnum2 {
LL | | Foo(bool),
Expand All @@ -243,7 +243,7 @@ LL | match_false!(NonEmptyEnum2::Foo(true));
= note: the matched value is of type `NonEmptyEnum2`

error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered
--> $DIR/match-empty-exhaustive_patterns.rs:116:18
--> $DIR/empty-match.rs:117:18
|
LL | / enum NonEmptyEnum5 {
LL | | V1, V2, V3, V4, V5,
Expand Down
@@ -1,47 +1,47 @@
error: unreachable pattern
--> $DIR/match-empty.rs:51:9
--> $DIR/empty-match.rs:53:9
|
LL | _ => {},
| ^
|
note: the lint level is defined here
--> $DIR/match-empty.rs:4:9
--> $DIR/empty-match.rs:6:9
|
LL | #![deny(unreachable_patterns)]
| ^^^^^^^^^^^^^^^^^^^^

error: unreachable pattern
--> $DIR/match-empty.rs:54:9
--> $DIR/empty-match.rs:56:9
|
LL | _ if false => {},
| ^

error: unreachable pattern
--> $DIR/match-empty.rs:61:9
--> $DIR/empty-match.rs:63:9
|
LL | _ => {},
| ^

error: unreachable pattern
--> $DIR/match-empty.rs:64:9
--> $DIR/empty-match.rs:66:9
|
LL | _ if false => {},
| ^

error: unreachable pattern
--> $DIR/match-empty.rs:71:9
--> $DIR/empty-match.rs:73:9
|
LL | _ => {},
| ^

error: unreachable pattern
--> $DIR/match-empty.rs:74:9
--> $DIR/empty-match.rs:76:9
|
LL | _ if false => {},
| ^

error[E0004]: non-exhaustive patterns: type `u8` is non-empty
--> $DIR/match-empty.rs:89:18
--> $DIR/empty-match.rs:90:18
|
LL | match_empty!(0u8);
| ^^^
Expand All @@ -50,7 +50,7 @@ LL | match_empty!(0u8);
= note: the matched value is of type `u8`

error[E0004]: non-exhaustive patterns: type `NonEmptyStruct` is non-empty
--> $DIR/match-empty.rs:91:18
--> $DIR/empty-match.rs:92:18
|
LL | struct NonEmptyStruct(bool);
| ---------------------------- `NonEmptyStruct` defined here
Expand All @@ -62,7 +62,7 @@ LL | match_empty!(NonEmptyStruct(true));
= note: the matched value is of type `NonEmptyStruct`

error[E0004]: non-exhaustive patterns: type `NonEmptyUnion1` is non-empty
--> $DIR/match-empty.rs:93:18
--> $DIR/empty-match.rs:94:18
|
LL | / union NonEmptyUnion1 {
LL | | foo: (),
Expand All @@ -76,7 +76,7 @@ LL | match_empty!((NonEmptyUnion1 { foo: () }));
= note: the matched value is of type `NonEmptyUnion1`

error[E0004]: non-exhaustive patterns: type `NonEmptyUnion2` is non-empty
--> $DIR/match-empty.rs:95:18
--> $DIR/empty-match.rs:96:18
|
LL | / union NonEmptyUnion2 {
LL | | foo: (),
Expand All @@ -91,7 +91,7 @@ LL | match_empty!((NonEmptyUnion2 { foo: () }));
= note: the matched value is of type `NonEmptyUnion2`

error[E0004]: non-exhaustive patterns: `Foo(_)` not covered
--> $DIR/match-empty.rs:97:18
--> $DIR/empty-match.rs:98:18
|
LL | / enum NonEmptyEnum1 {
LL | | Foo(bool),
Expand All @@ -108,7 +108,7 @@ LL | match_empty!(NonEmptyEnum1::Foo(true));
= note: the matched value is of type `NonEmptyEnum1`

error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered
--> $DIR/match-empty.rs:99:18
--> $DIR/empty-match.rs:100:18
|
LL | / enum NonEmptyEnum2 {
LL | | Foo(bool),
Expand All @@ -129,7 +129,7 @@ LL | match_empty!(NonEmptyEnum2::Foo(true));
= note: the matched value is of type `NonEmptyEnum2`

error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered
--> $DIR/match-empty.rs:101:18
--> $DIR/empty-match.rs:102:18
|
LL | / enum NonEmptyEnum5 {
LL | | V1, V2, V3, V4, V5,
Expand All @@ -143,7 +143,7 @@ LL | match_empty!(NonEmptyEnum5::V1);
= note: the matched value is of type `NonEmptyEnum5`

error[E0004]: non-exhaustive patterns: `_` not covered
--> $DIR/match-empty.rs:104:18
--> $DIR/empty-match.rs:105:18
|
LL | match_false!(0u8);
| ^^^ pattern `_` not covered
Expand All @@ -152,7 +152,7 @@ LL | match_false!(0u8);
= note: the matched value is of type `u8`

error[E0004]: non-exhaustive patterns: `NonEmptyStruct(_)` not covered
--> $DIR/match-empty.rs:106:18
--> $DIR/empty-match.rs:107:18
|
LL | struct NonEmptyStruct(bool);
| ---------------------------- `NonEmptyStruct` defined here
Expand All @@ -164,7 +164,7 @@ LL | match_false!(NonEmptyStruct(true));
= note: the matched value is of type `NonEmptyStruct`

error[E0004]: non-exhaustive patterns: `NonEmptyUnion1 { .. }` not covered
--> $DIR/match-empty.rs:108:18
--> $DIR/empty-match.rs:109:18
|
LL | / union NonEmptyUnion1 {
LL | | foo: (),
Expand All @@ -178,7 +178,7 @@ LL | match_false!((NonEmptyUnion1 { foo: () }));
= note: the matched value is of type `NonEmptyUnion1`

error[E0004]: non-exhaustive patterns: `NonEmptyUnion2 { .. }` not covered
--> $DIR/match-empty.rs:110:18
--> $DIR/empty-match.rs:111:18
|
LL | / union NonEmptyUnion2 {
LL | | foo: (),
Expand All @@ -193,7 +193,7 @@ LL | match_false!((NonEmptyUnion2 { foo: () }));
= note: the matched value is of type `NonEmptyUnion2`

error[E0004]: non-exhaustive patterns: `Foo(_)` not covered
--> $DIR/match-empty.rs:112:18
--> $DIR/empty-match.rs:113:18
|
LL | / enum NonEmptyEnum1 {
LL | | Foo(bool),
Expand All @@ -210,7 +210,7 @@ LL | match_false!(NonEmptyEnum1::Foo(true));
= note: the matched value is of type `NonEmptyEnum1`

error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered
--> $DIR/match-empty.rs:114:18
--> $DIR/empty-match.rs:115:18
|
LL | / enum NonEmptyEnum2 {
LL | | Foo(bool),
Expand All @@ -231,7 +231,7 @@ LL | match_false!(NonEmptyEnum2::Foo(true));
= note: the matched value is of type `NonEmptyEnum2`

error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered
--> $DIR/match-empty.rs:116:18
--> $DIR/empty-match.rs:117:18
|
LL | / enum NonEmptyEnum5 {
LL | | V1, V2, V3, V4, V5,
Expand Down
@@ -1,7 +1,8 @@
// aux-build:empty.rs
// revisions: normal exhaustive_patterns
#![feature(never_type)]
#![feature(never_type_fallback)]
#![feature(exhaustive_patterns)]
#![cfg_attr(exhaustive_patterns, feature(exhaustive_patterns))]
#![deny(unreachable_patterns)]

extern crate empty;
Expand Down Expand Up @@ -79,11 +80,11 @@ fn never(x: !) {
fn main() {
match None::<!> {
None => {}
Some(_) => {} //~ ERROR unreachable pattern
Some(_) => {} //[exhaustive_patterns]~ ERROR unreachable pattern
}
match None::<EmptyEnum> {
None => {}
Some(_) => {} //~ ERROR unreachable pattern
Some(_) => {} //[exhaustive_patterns]~ ERROR unreachable pattern
}

match_empty!(0u8);
Expand Down

0 comments on commit 622bfdb

Please sign in to comment.