Add a test for foreign empty enums
This commit is contained in:
parent
36e3409f67
commit
69821cf8df
5 changed files with 102 additions and 48 deletions
2
src/test/ui/pattern/usefulness/auxiliary/empty.rs
Normal file
2
src/test/ui/pattern/usefulness/auxiliary/empty.rs
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#![crate_type = "rlib"]
|
||||||
|
pub enum EmptyForeignEnum {}
|
|
@ -1,8 +1,12 @@
|
||||||
|
// aux-build:empty.rs
|
||||||
#![feature(never_type)]
|
#![feature(never_type)]
|
||||||
#![feature(never_type_fallback)]
|
#![feature(never_type_fallback)]
|
||||||
#![feature(exhaustive_patterns)]
|
#![feature(exhaustive_patterns)]
|
||||||
#![deny(unreachable_patterns)]
|
#![deny(unreachable_patterns)]
|
||||||
enum Foo {}
|
|
||||||
|
extern crate empty;
|
||||||
|
|
||||||
|
enum EmptyEnum {}
|
||||||
|
|
||||||
struct NonEmptyStruct(bool); //~ `NonEmptyStruct` defined here
|
struct NonEmptyStruct(bool); //~ `NonEmptyStruct` defined here
|
||||||
union NonEmptyUnion1 { //~ `NonEmptyUnion1` defined here
|
union NonEmptyUnion1 { //~ `NonEmptyUnion1` defined here
|
||||||
|
@ -42,7 +46,17 @@ macro_rules! match_false {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
fn foo(x: Foo) {
|
fn empty_enum(x: EmptyEnum) {
|
||||||
|
match x {} // ok
|
||||||
|
match x {
|
||||||
|
_ => {}, //~ ERROR unreachable pattern
|
||||||
|
}
|
||||||
|
match x {
|
||||||
|
_ if false => {}, //~ ERROR unreachable pattern
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn empty_foreign_enum(x: empty::EmptyForeignEnum) {
|
||||||
match x {} // ok
|
match x {} // ok
|
||||||
match x {
|
match x {
|
||||||
_ => {}, //~ ERROR unreachable pattern
|
_ => {}, //~ ERROR unreachable pattern
|
||||||
|
@ -67,7 +81,7 @@ fn main() {
|
||||||
None => {}
|
None => {}
|
||||||
Some(_) => {} //~ ERROR unreachable pattern
|
Some(_) => {} //~ ERROR unreachable pattern
|
||||||
}
|
}
|
||||||
match None::<Foo> {
|
match None::<EmptyEnum> {
|
||||||
None => {}
|
None => {}
|
||||||
Some(_) => {} //~ ERROR unreachable pattern
|
Some(_) => {} //~ ERROR unreachable pattern
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,47 +1,59 @@
|
||||||
error: unreachable pattern
|
error: unreachable pattern
|
||||||
--> $DIR/match-empty-exhaustive_patterns.rs:48:9
|
--> $DIR/match-empty-exhaustive_patterns.rs:52:9
|
||||||
|
|
|
|
||||||
LL | _ => {},
|
LL | _ => {},
|
||||||
| ^
|
| ^
|
||||||
|
|
|
|
||||||
note: the lint level is defined here
|
note: the lint level is defined here
|
||||||
--> $DIR/match-empty-exhaustive_patterns.rs:4:9
|
--> $DIR/match-empty-exhaustive_patterns.rs:5:9
|
||||||
|
|
|
|
||||||
LL | #![deny(unreachable_patterns)]
|
LL | #![deny(unreachable_patterns)]
|
||||||
| ^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: unreachable pattern
|
error: unreachable pattern
|
||||||
--> $DIR/match-empty-exhaustive_patterns.rs:51:9
|
--> $DIR/match-empty-exhaustive_patterns.rs:55:9
|
||||||
|
|
|
|
||||||
LL | _ if false => {},
|
LL | _ if false => {},
|
||||||
| ^
|
| ^
|
||||||
|
|
||||||
error: unreachable pattern
|
error: unreachable pattern
|
||||||
--> $DIR/match-empty-exhaustive_patterns.rs:58:9
|
--> $DIR/match-empty-exhaustive_patterns.rs:62:9
|
||||||
|
|
|
|
||||||
LL | _ => {},
|
LL | _ => {},
|
||||||
| ^
|
| ^
|
||||||
|
|
||||||
error: unreachable pattern
|
error: unreachable pattern
|
||||||
--> $DIR/match-empty-exhaustive_patterns.rs:61:9
|
--> $DIR/match-empty-exhaustive_patterns.rs:65:9
|
||||||
|
|
|
|
||||||
LL | _ if false => {},
|
LL | _ if false => {},
|
||||||
| ^
|
| ^
|
||||||
|
|
||||||
error: unreachable pattern
|
error: unreachable pattern
|
||||||
--> $DIR/match-empty-exhaustive_patterns.rs:68:9
|
--> $DIR/match-empty-exhaustive_patterns.rs:72:9
|
||||||
|
|
|
||||||
|
LL | _ => {},
|
||||||
|
| ^
|
||||||
|
|
||||||
|
error: unreachable pattern
|
||||||
|
--> $DIR/match-empty-exhaustive_patterns.rs:75:9
|
||||||
|
|
|
||||||
|
LL | _ if false => {},
|
||||||
|
| ^
|
||||||
|
|
||||||
|
error: unreachable pattern
|
||||||
|
--> $DIR/match-empty-exhaustive_patterns.rs:82:9
|
||||||
|
|
|
|
||||||
LL | Some(_) => {}
|
LL | Some(_) => {}
|
||||||
| ^^^^^^^
|
| ^^^^^^^
|
||||||
|
|
||||||
error: unreachable pattern
|
error: unreachable pattern
|
||||||
--> $DIR/match-empty-exhaustive_patterns.rs:72:9
|
--> $DIR/match-empty-exhaustive_patterns.rs:86:9
|
||||||
|
|
|
|
||||||
LL | Some(_) => {}
|
LL | Some(_) => {}
|
||||||
| ^^^^^^^
|
| ^^^^^^^
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: type `u8` is non-empty
|
error[E0004]: non-exhaustive patterns: type `u8` is non-empty
|
||||||
--> $DIR/match-empty-exhaustive_patterns.rs:75:18
|
--> $DIR/match-empty-exhaustive_patterns.rs:89:18
|
||||||
|
|
|
|
||||||
LL | match_empty!(0u8);
|
LL | match_empty!(0u8);
|
||||||
| ^^^
|
| ^^^
|
||||||
|
@ -50,7 +62,7 @@ LL | match_empty!(0u8);
|
||||||
= note: the matched value is of type `u8`
|
= note: the matched value is of type `u8`
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: type `NonEmptyStruct` is non-empty
|
error[E0004]: non-exhaustive patterns: type `NonEmptyStruct` is non-empty
|
||||||
--> $DIR/match-empty-exhaustive_patterns.rs:77:18
|
--> $DIR/match-empty-exhaustive_patterns.rs:91:18
|
||||||
|
|
|
|
||||||
LL | struct NonEmptyStruct(bool);
|
LL | struct NonEmptyStruct(bool);
|
||||||
| ---------------------------- `NonEmptyStruct` defined here
|
| ---------------------------- `NonEmptyStruct` defined here
|
||||||
|
@ -62,7 +74,7 @@ LL | match_empty!(NonEmptyStruct(true));
|
||||||
= note: the matched value is of type `NonEmptyStruct`
|
= note: the matched value is of type `NonEmptyStruct`
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: type `NonEmptyUnion1` is non-empty
|
error[E0004]: non-exhaustive patterns: type `NonEmptyUnion1` is non-empty
|
||||||
--> $DIR/match-empty-exhaustive_patterns.rs:79:18
|
--> $DIR/match-empty-exhaustive_patterns.rs:93:18
|
||||||
|
|
|
|
||||||
LL | / union NonEmptyUnion1 {
|
LL | / union NonEmptyUnion1 {
|
||||||
LL | | foo: (),
|
LL | | foo: (),
|
||||||
|
@ -76,7 +88,7 @@ LL | match_empty!((NonEmptyUnion1 { foo: () }));
|
||||||
= note: the matched value is of type `NonEmptyUnion1`
|
= note: the matched value is of type `NonEmptyUnion1`
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: type `NonEmptyUnion2` is non-empty
|
error[E0004]: non-exhaustive patterns: type `NonEmptyUnion2` is non-empty
|
||||||
--> $DIR/match-empty-exhaustive_patterns.rs:81:18
|
--> $DIR/match-empty-exhaustive_patterns.rs:95:18
|
||||||
|
|
|
|
||||||
LL | / union NonEmptyUnion2 {
|
LL | / union NonEmptyUnion2 {
|
||||||
LL | | foo: (),
|
LL | | foo: (),
|
||||||
|
@ -91,7 +103,7 @@ LL | match_empty!((NonEmptyUnion2 { foo: () }));
|
||||||
= note: the matched value is of type `NonEmptyUnion2`
|
= note: the matched value is of type `NonEmptyUnion2`
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: `Foo(_)` not covered
|
error[E0004]: non-exhaustive patterns: `Foo(_)` not covered
|
||||||
--> $DIR/match-empty-exhaustive_patterns.rs:83:18
|
--> $DIR/match-empty-exhaustive_patterns.rs:97:18
|
||||||
|
|
|
|
||||||
LL | / enum NonEmptyEnum1 {
|
LL | / enum NonEmptyEnum1 {
|
||||||
LL | | Foo(bool),
|
LL | | Foo(bool),
|
||||||
|
@ -108,7 +120,7 @@ LL | match_empty!(NonEmptyEnum1::Foo(true));
|
||||||
= note: the matched value is of type `NonEmptyEnum1`
|
= note: the matched value is of type `NonEmptyEnum1`
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered
|
error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered
|
||||||
--> $DIR/match-empty-exhaustive_patterns.rs:85:18
|
--> $DIR/match-empty-exhaustive_patterns.rs:99:18
|
||||||
|
|
|
|
||||||
LL | / enum NonEmptyEnum2 {
|
LL | / enum NonEmptyEnum2 {
|
||||||
LL | | Foo(bool),
|
LL | | Foo(bool),
|
||||||
|
@ -129,7 +141,7 @@ LL | match_empty!(NonEmptyEnum2::Foo(true));
|
||||||
= note: the matched value is of type `NonEmptyEnum2`
|
= note: the matched value is of type `NonEmptyEnum2`
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered
|
error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered
|
||||||
--> $DIR/match-empty-exhaustive_patterns.rs:87:18
|
--> $DIR/match-empty-exhaustive_patterns.rs:101:18
|
||||||
|
|
|
|
||||||
LL | / enum NonEmptyEnum5 {
|
LL | / enum NonEmptyEnum5 {
|
||||||
LL | | V1, V2, V3, V4, V5,
|
LL | | V1, V2, V3, V4, V5,
|
||||||
|
@ -143,7 +155,7 @@ LL | match_empty!(NonEmptyEnum5::V1);
|
||||||
= note: the matched value is of type `NonEmptyEnum5`
|
= note: the matched value is of type `NonEmptyEnum5`
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: `_` not covered
|
error[E0004]: non-exhaustive patterns: `_` not covered
|
||||||
--> $DIR/match-empty-exhaustive_patterns.rs:90:18
|
--> $DIR/match-empty-exhaustive_patterns.rs:104:18
|
||||||
|
|
|
|
||||||
LL | match_false!(0u8);
|
LL | match_false!(0u8);
|
||||||
| ^^^ pattern `_` not covered
|
| ^^^ pattern `_` not covered
|
||||||
|
@ -152,7 +164,7 @@ LL | match_false!(0u8);
|
||||||
= note: the matched value is of type `u8`
|
= note: the matched value is of type `u8`
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: `NonEmptyStruct(_)` not covered
|
error[E0004]: non-exhaustive patterns: `NonEmptyStruct(_)` not covered
|
||||||
--> $DIR/match-empty-exhaustive_patterns.rs:92:18
|
--> $DIR/match-empty-exhaustive_patterns.rs:106:18
|
||||||
|
|
|
|
||||||
LL | struct NonEmptyStruct(bool);
|
LL | struct NonEmptyStruct(bool);
|
||||||
| ---------------------------- `NonEmptyStruct` defined here
|
| ---------------------------- `NonEmptyStruct` defined here
|
||||||
|
@ -164,7 +176,7 @@ LL | match_false!(NonEmptyStruct(true));
|
||||||
= note: the matched value is of type `NonEmptyStruct`
|
= note: the matched value is of type `NonEmptyStruct`
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: `NonEmptyUnion1 { .. }` not covered
|
error[E0004]: non-exhaustive patterns: `NonEmptyUnion1 { .. }` not covered
|
||||||
--> $DIR/match-empty-exhaustive_patterns.rs:94:18
|
--> $DIR/match-empty-exhaustive_patterns.rs:108:18
|
||||||
|
|
|
|
||||||
LL | / union NonEmptyUnion1 {
|
LL | / union NonEmptyUnion1 {
|
||||||
LL | | foo: (),
|
LL | | foo: (),
|
||||||
|
@ -178,7 +190,7 @@ LL | match_false!((NonEmptyUnion1 { foo: () }));
|
||||||
= note: the matched value is of type `NonEmptyUnion1`
|
= note: the matched value is of type `NonEmptyUnion1`
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: `NonEmptyUnion2 { .. }` not covered
|
error[E0004]: non-exhaustive patterns: `NonEmptyUnion2 { .. }` not covered
|
||||||
--> $DIR/match-empty-exhaustive_patterns.rs:96:18
|
--> $DIR/match-empty-exhaustive_patterns.rs:110:18
|
||||||
|
|
|
|
||||||
LL | / union NonEmptyUnion2 {
|
LL | / union NonEmptyUnion2 {
|
||||||
LL | | foo: (),
|
LL | | foo: (),
|
||||||
|
@ -193,7 +205,7 @@ LL | match_false!((NonEmptyUnion2 { foo: () }));
|
||||||
= note: the matched value is of type `NonEmptyUnion2`
|
= note: the matched value is of type `NonEmptyUnion2`
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: `Foo(_)` not covered
|
error[E0004]: non-exhaustive patterns: `Foo(_)` not covered
|
||||||
--> $DIR/match-empty-exhaustive_patterns.rs:98:18
|
--> $DIR/match-empty-exhaustive_patterns.rs:112:18
|
||||||
|
|
|
|
||||||
LL | / enum NonEmptyEnum1 {
|
LL | / enum NonEmptyEnum1 {
|
||||||
LL | | Foo(bool),
|
LL | | Foo(bool),
|
||||||
|
@ -210,7 +222,7 @@ LL | match_false!(NonEmptyEnum1::Foo(true));
|
||||||
= note: the matched value is of type `NonEmptyEnum1`
|
= note: the matched value is of type `NonEmptyEnum1`
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered
|
error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered
|
||||||
--> $DIR/match-empty-exhaustive_patterns.rs:100:18
|
--> $DIR/match-empty-exhaustive_patterns.rs:114:18
|
||||||
|
|
|
|
||||||
LL | / enum NonEmptyEnum2 {
|
LL | / enum NonEmptyEnum2 {
|
||||||
LL | | Foo(bool),
|
LL | | Foo(bool),
|
||||||
|
@ -231,7 +243,7 @@ LL | match_false!(NonEmptyEnum2::Foo(true));
|
||||||
= note: the matched value is of type `NonEmptyEnum2`
|
= note: the matched value is of type `NonEmptyEnum2`
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered
|
error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered
|
||||||
--> $DIR/match-empty-exhaustive_patterns.rs:102:18
|
--> $DIR/match-empty-exhaustive_patterns.rs:116:18
|
||||||
|
|
|
|
||||||
LL | / enum NonEmptyEnum5 {
|
LL | / enum NonEmptyEnum5 {
|
||||||
LL | | V1, V2, V3, V4, V5,
|
LL | | V1, V2, V3, V4, V5,
|
||||||
|
@ -244,6 +256,6 @@ LL | match_false!(NonEmptyEnum5::V1);
|
||||||
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
|
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
|
||||||
= note: the matched value is of type `NonEmptyEnum5`
|
= note: the matched value is of type `NonEmptyEnum5`
|
||||||
|
|
||||||
error: aborting due to 20 previous errors
|
error: aborting due to 22 previous errors
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0004`.
|
For more information about this error, try `rustc --explain E0004`.
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
|
// aux-build:empty.rs
|
||||||
#![feature(never_type)]
|
#![feature(never_type)]
|
||||||
#![feature(never_type_fallback)]
|
#![feature(never_type_fallback)]
|
||||||
#![deny(unreachable_patterns)]
|
#![deny(unreachable_patterns)]
|
||||||
enum Foo {}
|
|
||||||
|
extern crate empty;
|
||||||
|
|
||||||
|
enum EmptyEnum {}
|
||||||
|
|
||||||
struct NonEmptyStruct(bool); //~ `NonEmptyStruct` defined here
|
struct NonEmptyStruct(bool); //~ `NonEmptyStruct` defined here
|
||||||
union NonEmptyUnion1 { //~ `NonEmptyUnion1` defined here
|
union NonEmptyUnion1 { //~ `NonEmptyUnion1` defined here
|
||||||
|
@ -41,7 +45,17 @@ macro_rules! match_false {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
fn foo(x: Foo) {
|
fn empty_enum(x: EmptyEnum) {
|
||||||
|
match x {} // ok
|
||||||
|
match x {
|
||||||
|
_ => {}, //~ ERROR unreachable pattern
|
||||||
|
}
|
||||||
|
match x {
|
||||||
|
_ if false => {}, //~ ERROR unreachable pattern
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn empty_foreign_enum(x: empty::EmptyForeignEnum) {
|
||||||
match x {} // ok
|
match x {} // ok
|
||||||
match x {
|
match x {
|
||||||
_ => {}, //~ ERROR unreachable pattern
|
_ => {}, //~ ERROR unreachable pattern
|
||||||
|
@ -67,7 +81,7 @@ fn main() {
|
||||||
None => {}
|
None => {}
|
||||||
Some(_) => {}
|
Some(_) => {}
|
||||||
}
|
}
|
||||||
match None::<Foo> {
|
match None::<EmptyEnum> {
|
||||||
None => {}
|
None => {}
|
||||||
Some(_) => {}
|
Some(_) => {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,35 +1,47 @@
|
||||||
error: unreachable pattern
|
error: unreachable pattern
|
||||||
--> $DIR/match-empty.rs:47:9
|
--> $DIR/match-empty.rs:51:9
|
||||||
|
|
|
|
||||||
LL | _ => {},
|
LL | _ => {},
|
||||||
| ^
|
| ^
|
||||||
|
|
|
|
||||||
note: the lint level is defined here
|
note: the lint level is defined here
|
||||||
--> $DIR/match-empty.rs:3:9
|
--> $DIR/match-empty.rs:4:9
|
||||||
|
|
|
|
||||||
LL | #![deny(unreachable_patterns)]
|
LL | #![deny(unreachable_patterns)]
|
||||||
| ^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: unreachable pattern
|
error: unreachable pattern
|
||||||
--> $DIR/match-empty.rs:50:9
|
--> $DIR/match-empty.rs:54:9
|
||||||
|
|
|
|
||||||
LL | _ if false => {},
|
LL | _ if false => {},
|
||||||
| ^
|
| ^
|
||||||
|
|
||||||
error: unreachable pattern
|
error: unreachable pattern
|
||||||
--> $DIR/match-empty.rs:57:9
|
--> $DIR/match-empty.rs:61:9
|
||||||
|
|
|
|
||||||
LL | _ => {},
|
LL | _ => {},
|
||||||
| ^
|
| ^
|
||||||
|
|
||||||
error: unreachable pattern
|
error: unreachable pattern
|
||||||
--> $DIR/match-empty.rs:60:9
|
--> $DIR/match-empty.rs:64:9
|
||||||
|
|
|
||||||
|
LL | _ if false => {},
|
||||||
|
| ^
|
||||||
|
|
||||||
|
error: unreachable pattern
|
||||||
|
--> $DIR/match-empty.rs:71:9
|
||||||
|
|
|
||||||
|
LL | _ => {},
|
||||||
|
| ^
|
||||||
|
|
||||||
|
error: unreachable pattern
|
||||||
|
--> $DIR/match-empty.rs:74:9
|
||||||
|
|
|
|
||||||
LL | _ if false => {},
|
LL | _ if false => {},
|
||||||
| ^
|
| ^
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: type `u8` is non-empty
|
error[E0004]: non-exhaustive patterns: type `u8` is non-empty
|
||||||
--> $DIR/match-empty.rs:75:18
|
--> $DIR/match-empty.rs:89:18
|
||||||
|
|
|
|
||||||
LL | match_empty!(0u8);
|
LL | match_empty!(0u8);
|
||||||
| ^^^
|
| ^^^
|
||||||
|
@ -38,7 +50,7 @@ LL | match_empty!(0u8);
|
||||||
= note: the matched value is of type `u8`
|
= note: the matched value is of type `u8`
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: type `NonEmptyStruct` is non-empty
|
error[E0004]: non-exhaustive patterns: type `NonEmptyStruct` is non-empty
|
||||||
--> $DIR/match-empty.rs:77:18
|
--> $DIR/match-empty.rs:91:18
|
||||||
|
|
|
|
||||||
LL | struct NonEmptyStruct(bool);
|
LL | struct NonEmptyStruct(bool);
|
||||||
| ---------------------------- `NonEmptyStruct` defined here
|
| ---------------------------- `NonEmptyStruct` defined here
|
||||||
|
@ -50,7 +62,7 @@ LL | match_empty!(NonEmptyStruct(true));
|
||||||
= note: the matched value is of type `NonEmptyStruct`
|
= note: the matched value is of type `NonEmptyStruct`
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: type `NonEmptyUnion1` is non-empty
|
error[E0004]: non-exhaustive patterns: type `NonEmptyUnion1` is non-empty
|
||||||
--> $DIR/match-empty.rs:79:18
|
--> $DIR/match-empty.rs:93:18
|
||||||
|
|
|
|
||||||
LL | / union NonEmptyUnion1 {
|
LL | / union NonEmptyUnion1 {
|
||||||
LL | | foo: (),
|
LL | | foo: (),
|
||||||
|
@ -64,7 +76,7 @@ LL | match_empty!((NonEmptyUnion1 { foo: () }));
|
||||||
= note: the matched value is of type `NonEmptyUnion1`
|
= note: the matched value is of type `NonEmptyUnion1`
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: type `NonEmptyUnion2` is non-empty
|
error[E0004]: non-exhaustive patterns: type `NonEmptyUnion2` is non-empty
|
||||||
--> $DIR/match-empty.rs:81:18
|
--> $DIR/match-empty.rs:95:18
|
||||||
|
|
|
|
||||||
LL | / union NonEmptyUnion2 {
|
LL | / union NonEmptyUnion2 {
|
||||||
LL | | foo: (),
|
LL | | foo: (),
|
||||||
|
@ -79,7 +91,7 @@ LL | match_empty!((NonEmptyUnion2 { foo: () }));
|
||||||
= note: the matched value is of type `NonEmptyUnion2`
|
= note: the matched value is of type `NonEmptyUnion2`
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: `Foo(_)` not covered
|
error[E0004]: non-exhaustive patterns: `Foo(_)` not covered
|
||||||
--> $DIR/match-empty.rs:83:18
|
--> $DIR/match-empty.rs:97:18
|
||||||
|
|
|
|
||||||
LL | / enum NonEmptyEnum1 {
|
LL | / enum NonEmptyEnum1 {
|
||||||
LL | | Foo(bool),
|
LL | | Foo(bool),
|
||||||
|
@ -96,7 +108,7 @@ LL | match_empty!(NonEmptyEnum1::Foo(true));
|
||||||
= note: the matched value is of type `NonEmptyEnum1`
|
= note: the matched value is of type `NonEmptyEnum1`
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered
|
error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered
|
||||||
--> $DIR/match-empty.rs:85:18
|
--> $DIR/match-empty.rs:99:18
|
||||||
|
|
|
|
||||||
LL | / enum NonEmptyEnum2 {
|
LL | / enum NonEmptyEnum2 {
|
||||||
LL | | Foo(bool),
|
LL | | Foo(bool),
|
||||||
|
@ -117,7 +129,7 @@ LL | match_empty!(NonEmptyEnum2::Foo(true));
|
||||||
= note: the matched value is of type `NonEmptyEnum2`
|
= note: the matched value is of type `NonEmptyEnum2`
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered
|
error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered
|
||||||
--> $DIR/match-empty.rs:87:18
|
--> $DIR/match-empty.rs:101:18
|
||||||
|
|
|
|
||||||
LL | / enum NonEmptyEnum5 {
|
LL | / enum NonEmptyEnum5 {
|
||||||
LL | | V1, V2, V3, V4, V5,
|
LL | | V1, V2, V3, V4, V5,
|
||||||
|
@ -131,7 +143,7 @@ LL | match_empty!(NonEmptyEnum5::V1);
|
||||||
= note: the matched value is of type `NonEmptyEnum5`
|
= note: the matched value is of type `NonEmptyEnum5`
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: `_` not covered
|
error[E0004]: non-exhaustive patterns: `_` not covered
|
||||||
--> $DIR/match-empty.rs:90:18
|
--> $DIR/match-empty.rs:104:18
|
||||||
|
|
|
|
||||||
LL | match_false!(0u8);
|
LL | match_false!(0u8);
|
||||||
| ^^^ pattern `_` not covered
|
| ^^^ pattern `_` not covered
|
||||||
|
@ -140,7 +152,7 @@ LL | match_false!(0u8);
|
||||||
= note: the matched value is of type `u8`
|
= note: the matched value is of type `u8`
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: `NonEmptyStruct(_)` not covered
|
error[E0004]: non-exhaustive patterns: `NonEmptyStruct(_)` not covered
|
||||||
--> $DIR/match-empty.rs:92:18
|
--> $DIR/match-empty.rs:106:18
|
||||||
|
|
|
|
||||||
LL | struct NonEmptyStruct(bool);
|
LL | struct NonEmptyStruct(bool);
|
||||||
| ---------------------------- `NonEmptyStruct` defined here
|
| ---------------------------- `NonEmptyStruct` defined here
|
||||||
|
@ -152,7 +164,7 @@ LL | match_false!(NonEmptyStruct(true));
|
||||||
= note: the matched value is of type `NonEmptyStruct`
|
= note: the matched value is of type `NonEmptyStruct`
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: `NonEmptyUnion1 { .. }` not covered
|
error[E0004]: non-exhaustive patterns: `NonEmptyUnion1 { .. }` not covered
|
||||||
--> $DIR/match-empty.rs:94:18
|
--> $DIR/match-empty.rs:108:18
|
||||||
|
|
|
|
||||||
LL | / union NonEmptyUnion1 {
|
LL | / union NonEmptyUnion1 {
|
||||||
LL | | foo: (),
|
LL | | foo: (),
|
||||||
|
@ -166,7 +178,7 @@ LL | match_false!((NonEmptyUnion1 { foo: () }));
|
||||||
= note: the matched value is of type `NonEmptyUnion1`
|
= note: the matched value is of type `NonEmptyUnion1`
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: `NonEmptyUnion2 { .. }` not covered
|
error[E0004]: non-exhaustive patterns: `NonEmptyUnion2 { .. }` not covered
|
||||||
--> $DIR/match-empty.rs:96:18
|
--> $DIR/match-empty.rs:110:18
|
||||||
|
|
|
|
||||||
LL | / union NonEmptyUnion2 {
|
LL | / union NonEmptyUnion2 {
|
||||||
LL | | foo: (),
|
LL | | foo: (),
|
||||||
|
@ -181,7 +193,7 @@ LL | match_false!((NonEmptyUnion2 { foo: () }));
|
||||||
= note: the matched value is of type `NonEmptyUnion2`
|
= note: the matched value is of type `NonEmptyUnion2`
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: `Foo(_)` not covered
|
error[E0004]: non-exhaustive patterns: `Foo(_)` not covered
|
||||||
--> $DIR/match-empty.rs:98:18
|
--> $DIR/match-empty.rs:112:18
|
||||||
|
|
|
|
||||||
LL | / enum NonEmptyEnum1 {
|
LL | / enum NonEmptyEnum1 {
|
||||||
LL | | Foo(bool),
|
LL | | Foo(bool),
|
||||||
|
@ -198,7 +210,7 @@ LL | match_false!(NonEmptyEnum1::Foo(true));
|
||||||
= note: the matched value is of type `NonEmptyEnum1`
|
= note: the matched value is of type `NonEmptyEnum1`
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered
|
error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered
|
||||||
--> $DIR/match-empty.rs:100:18
|
--> $DIR/match-empty.rs:114:18
|
||||||
|
|
|
|
||||||
LL | / enum NonEmptyEnum2 {
|
LL | / enum NonEmptyEnum2 {
|
||||||
LL | | Foo(bool),
|
LL | | Foo(bool),
|
||||||
|
@ -219,7 +231,7 @@ LL | match_false!(NonEmptyEnum2::Foo(true));
|
||||||
= note: the matched value is of type `NonEmptyEnum2`
|
= note: the matched value is of type `NonEmptyEnum2`
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered
|
error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered
|
||||||
--> $DIR/match-empty.rs:102:18
|
--> $DIR/match-empty.rs:116:18
|
||||||
|
|
|
|
||||||
LL | / enum NonEmptyEnum5 {
|
LL | / enum NonEmptyEnum5 {
|
||||||
LL | | V1, V2, V3, V4, V5,
|
LL | | V1, V2, V3, V4, V5,
|
||||||
|
@ -232,6 +244,6 @@ LL | match_false!(NonEmptyEnum5::V1);
|
||||||
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
|
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
|
||||||
= note: the matched value is of type `NonEmptyEnum5`
|
= note: the matched value is of type `NonEmptyEnum5`
|
||||||
|
|
||||||
error: aborting due to 18 previous errors
|
error: aborting due to 20 previous errors
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0004`.
|
For more information about this error, try `rustc --explain E0004`.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue