rust/tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

70 lines
2.5 KiB
Plaintext
Raw Normal View History

2020-11-12 11:28:55 -06:00
error: unreachable pattern
--> $DIR/enum_same_crate_empty_match.rs:28:9
|
LL | _ => {}
2020-11-12 11:28:55 -06:00
| ^
|
note: the lint level is defined here
--> $DIR/enum_same_crate_empty_match.rs:1:9
|
LL | #![deny(unreachable_patterns)]
| ^^^^^^^^^^^^^^^^^^^^
error[E0004]: non-exhaustive patterns: `NonExhaustiveEnum::Unit`, `NonExhaustiveEnum::Tuple(_)` and `NonExhaustiveEnum::Struct { .. }` not covered
2019-11-30 09:51:26 -06:00
--> $DIR/enum_same_crate_empty_match.rs:33:11
|
LL | match NonExhaustiveEnum::Unit {}
| ^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonExhaustiveEnum::Unit`, `NonExhaustiveEnum::Tuple(_)` and `NonExhaustiveEnum::Struct { .. }` not covered
2019-11-30 09:51:26 -06:00
|
note: `NonExhaustiveEnum` defined here
--> $DIR/enum_same_crate_empty_match.rs:5:5
|
LL | pub enum NonExhaustiveEnum {
| -----------------
LL | Unit,
| ^^^^ not covered
LL |
LL | Tuple(u32),
| ^^^^^ not covered
LL |
LL | Struct { field: u32 }
| ^^^^^^ not covered
= note: the matched value is of type `NonExhaustiveEnum`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ match NonExhaustiveEnum::Unit {
LL + NonExhaustiveEnum::Unit | NonExhaustiveEnum::Tuple(_) | NonExhaustiveEnum::Struct { .. } => todo!(),
LL + }
|
2019-11-30 09:51:26 -06:00
error[E0004]: non-exhaustive patterns: `NormalEnum::Unit`, `NormalEnum::Tuple(_)` and `NormalEnum::Struct { .. }` not covered
2019-11-30 09:51:26 -06:00
--> $DIR/enum_same_crate_empty_match.rs:35:11
|
LL | match NormalEnum::Unit {}
| ^^^^^^^^^^^^^^^^ patterns `NormalEnum::Unit`, `NormalEnum::Tuple(_)` and `NormalEnum::Struct { .. }` not covered
|
note: `NormalEnum` defined here
--> $DIR/enum_same_crate_empty_match.rs:14:5
2019-11-30 09:51:26 -06:00
|
LL | pub enum NormalEnum {
| ----------
LL | Unit,
| ^^^^ not covered
LL |
LL | Tuple(u32),
| ^^^^^ not covered
LL |
LL | Struct { field: u32 }
| ^^^^^^ not covered
= note: the matched value is of type `NormalEnum`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ match NormalEnum::Unit {
LL + NormalEnum::Unit | NormalEnum::Tuple(_) | NormalEnum::Struct { .. } => todo!(),
LL + }
|
2019-11-30 09:51:26 -06:00
2020-11-12 11:28:55 -06:00
error: aborting due to 3 previous errors
2019-11-30 09:51:26 -06:00
For more information about this error, try `rustc --explain E0004`.