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

42 lines
1.3 KiB
Plaintext

error[E0004]: non-exhaustive patterns: type `uninhabited::UninhabitedEnum` is non-empty
--> $DIR/match.rs:14:11
|
LL | match x {}
| ^
|
note: `uninhabited::UninhabitedEnum` defined here
--> $DIR/auxiliary/uninhabited.rs:5:1
|
LL | pub enum UninhabitedEnum {
| ^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `uninhabited::UninhabitedEnum`, which is marked as non-exhaustive
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match x {
LL + _ => todo!(),
LL ~ }
|
error[E0004]: non-exhaustive patterns: type `uninhabited::PrivatelyUninhabitedStruct` is non-empty
--> $DIR/match.rs:22:11
|
LL | match x {}
| ^
|
note: `uninhabited::PrivatelyUninhabitedStruct` defined here
--> $DIR/auxiliary/uninhabited.rs:15:1
|
LL | pub struct PrivatelyUninhabitedStruct {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `uninhabited::PrivatelyUninhabitedStruct`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match x {
LL + _ => todo!(),
LL ~ }
|
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0004`.