2022-09-02 22:01:35 -05:00
|
|
|
error[E0004]: non-exhaustive patterns: `L::B` not covered
|
2021-05-12 12:25:12 -05:00
|
|
|
--> $DIR/match_non_exhaustive.rs:23:11
|
|
|
|
|
|
|
|
|
LL | match l { L::A => () };
|
2022-09-02 22:01:35 -05:00
|
|
|
| ^ pattern `L::B` not covered
|
2021-05-12 12:25:12 -05:00
|
|
|
|
|
2021-12-15 23:06:44 -06:00
|
|
|
note: `L` defined here
|
2023-10-29 00:50:59 -05:00
|
|
|
--> $DIR/match_non_exhaustive.rs:10:6
|
2021-12-15 23:06:44 -06:00
|
|
|
|
|
|
|
|
LL | enum L { A, B }
|
2023-10-29 00:50:59 -05:00
|
|
|
| ^ - not covered
|
2021-05-12 12:25:12 -05:00
|
|
|
= note: the matched value is of type `L`
|
2021-12-16 16:46:13 -06:00
|
|
|
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
2021-12-15 20:14:17 -06:00
|
|
|
|
|
2022-09-02 22:01:35 -05:00
|
|
|
LL | match l { L::A => (), L::B => todo!() };
|
|
|
|
| +++++++++++++++++
|
2021-05-12 12:25:12 -05:00
|
|
|
|
|
|
|
error[E0004]: non-exhaustive patterns: type `E1` is non-empty
|
|
|
|
--> $DIR/match_non_exhaustive.rs:28:11
|
|
|
|
|
|
|
|
|
LL | match e1 {};
|
|
|
|
| ^^
|
|
|
|
|
|
2021-12-15 23:06:44 -06:00
|
|
|
note: `E1` defined here
|
|
|
|
--> $DIR/auxiliary/match_non_exhaustive_lib.rs:2:1
|
|
|
|
|
|
|
|
|
LL | pub enum E1 {}
|
2022-02-13 09:27:59 -06:00
|
|
|
| ^^^^^^^^^^^
|
2021-05-12 12:25:12 -05:00
|
|
|
= note: the matched value is of type `E1`, which is marked as non-exhaustive
|
2021-12-16 16:46:13 -06:00
|
|
|
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
2021-12-15 20:05:58 -06:00
|
|
|
|
|
|
|
|
LL ~ match e1 {
|
|
|
|
LL + _ => todo!(),
|
|
|
|
LL ~ };
|
|
|
|
|
|
2021-05-12 12:25:12 -05:00
|
|
|
|
|
|
|
error[E0004]: non-exhaustive patterns: `_` not covered
|
|
|
|
--> $DIR/match_non_exhaustive.rs:30:11
|
|
|
|
|
|
|
|
|
LL | match e2 { E2::A => (), E2::B => () };
|
|
|
|
| ^^ pattern `_` not covered
|
|
|
|
|
|
2021-12-15 23:06:44 -06:00
|
|
|
note: `E2` defined here
|
|
|
|
--> $DIR/auxiliary/match_non_exhaustive_lib.rs:5:1
|
|
|
|
|
|
|
|
|
LL | pub enum E2 { A, B }
|
2022-02-13 09:27:59 -06:00
|
|
|
| ^^^^^^^^^^^
|
2023-08-28 01:25:52 -05:00
|
|
|
= note: the matched value is of type `E2`
|
2023-09-03 06:55:11 -05:00
|
|
|
= note: `E2` is marked as non-exhaustive, so a wildcard `_` is necessary to match exhaustively
|
2021-12-16 16:46:13 -06:00
|
|
|
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
2021-12-15 20:28:09 -06:00
|
|
|
|
|
|
|
|
LL | match e2 { E2::A => (), E2::B => (), _ => todo!() };
|
|
|
|
| ++++++++++++++
|
2021-05-12 12:25:12 -05:00
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0004`.
|