2020-11-12 17:28:55 +00:00
error: unreachable pattern
--> $DIR/enum_same_crate_empty_match.rs:28:9
|
2020-11-13 23:18:55 +00:00
LL | _ => {}
2024-08-19 21:33:48 +02:00
| ^------
| |
| matches no values because `EmptyNonExhaustiveEnum` is uninhabited
| help: remove the match arm
2020-11-12 17:28:55 +00:00
|
2024-08-19 21:08:18 +02:00
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
2020-11-12 17:28:55 +00:00
note: the lint level is defined here
--> $DIR/enum_same_crate_empty_match.rs:1:9
|
LL | #![deny(unreachable_patterns)]
| ^^^^^^^^^^^^^^^^^^^^
2022-09-03 03:01:35 +00:00
error[E0004]: non-exhaustive patterns: `NonExhaustiveEnum::Unit`, `NonExhaustiveEnum::Tuple(_)` and `NonExhaustiveEnum::Struct { .. }` not covered
2019-11-30 15:51:26 +00:00
--> $DIR/enum_same_crate_empty_match.rs:33:11
|
2021-12-16 05:06:44 +00:00
LL | match NonExhaustiveEnum::Unit {}
2022-09-03 03:01:35 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonExhaustiveEnum::Unit`, `NonExhaustiveEnum::Tuple(_)` and `NonExhaustiveEnum::Struct { .. }` not covered
2019-11-30 15:51:26 +00:00
|
2021-12-16 05:06:44 +00:00
note: `NonExhaustiveEnum` defined here
2023-10-29 06:50:59 +01:00
--> $DIR/enum_same_crate_empty_match.rs:4:10
2021-12-16 05:06:44 +00:00
|
LL | pub enum NonExhaustiveEnum {
2023-10-29 06:50:59 +01:00
| ^^^^^^^^^^^^^^^^^
2021-12-16 05:06:44 +00:00
LL | Unit,
2023-10-29 06:50:59 +01:00
| ---- not covered
2021-12-16 05:06:44 +00:00
LL |
LL | Tuple(u32),
2023-10-29 06:50:59 +01:00
| ----- not covered
2021-12-16 05:06:44 +00:00
LL |
LL | Struct { field: u32 }
2023-10-29 06:50:59 +01:00
| ------ not covered
2020-03-27 06:44:30 +01:00
= note: the matched value is of type `NonExhaustiveEnum`
2021-12-16 22:46:13 +00:00
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
2021-12-16 02:05:58 +00:00
|
LL ~ match NonExhaustiveEnum::Unit {
2022-09-03 03:01:35 +00:00
LL + NonExhaustiveEnum::Unit | NonExhaustiveEnum::Tuple(_) | NonExhaustiveEnum::Struct { .. } => todo!(),
2025-02-21 00:29:56 +00:00
LL ~ }
2021-12-16 02:05:58 +00:00
|
2019-11-30 15:51:26 +00:00
2022-09-03 03:01:35 +00:00
error[E0004]: non-exhaustive patterns: `NormalEnum::Unit`, `NormalEnum::Tuple(_)` and `NormalEnum::Struct { .. }` not covered
2019-11-30 15:51:26 +00:00
--> $DIR/enum_same_crate_empty_match.rs:35:11
|
2021-12-16 05:06:44 +00:00
LL | match NormalEnum::Unit {}
2022-09-03 03:01:35 +00:00
| ^^^^^^^^^^^^^^^^ patterns `NormalEnum::Unit`, `NormalEnum::Tuple(_)` and `NormalEnum::Struct { .. }` not covered
2021-12-16 05:06:44 +00:00
|
note: `NormalEnum` defined here
2023-10-29 06:50:59 +01:00
--> $DIR/enum_same_crate_empty_match.rs:13:10
2019-11-30 15:51:26 +00:00
|
2021-12-16 05:06:44 +00:00
LL | pub enum NormalEnum {
2023-10-29 06:50:59 +01:00
| ^^^^^^^^^^
2021-12-16 05:06:44 +00:00
LL | Unit,
2023-10-29 06:50:59 +01:00
| ---- not covered
2021-12-16 05:06:44 +00:00
LL |
LL | Tuple(u32),
2023-10-29 06:50:59 +01:00
| ----- not covered
2021-12-16 05:06:44 +00:00
LL |
LL | Struct { field: u32 }
2023-10-29 06:50:59 +01:00
| ------ not covered
2020-03-27 06:44:30 +01:00
= note: the matched value is of type `NormalEnum`
2021-12-16 22:46:13 +00:00
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
2021-12-16 02:05:58 +00:00
|
LL ~ match NormalEnum::Unit {
2022-09-03 03:01:35 +00:00
LL + NormalEnum::Unit | NormalEnum::Tuple(_) | NormalEnum::Struct { .. } => todo!(),
2025-02-21 00:29:56 +00:00
LL ~ }
2021-12-16 02:05:58 +00:00
|
2019-11-30 15:51:26 +00:00
2020-11-12 17:28:55 +00:00
error: aborting due to 3 previous errors
2019-11-30 15:51:26 +00:00
For more information about this error, try `rustc --explain E0004`.