]> git.lizzy.rs Git - rust.git/blob - src/test/ui/match/match_non_exhaustive.stderr
6206dc85ea05f81c72ab6854ef03416a232cbcb5
[rust.git] / src / test / ui / match / match_non_exhaustive.stderr
1 error[E0004]: non-exhaustive patterns: `B` not covered
2   --> $DIR/match_non_exhaustive.rs:23:11
3    |
4 LL |     match l { L::A => () };
5    |           ^ pattern `B` not covered
6    |
7 note: `L` defined here
8   --> $DIR/match_non_exhaustive.rs:10:13
9    |
10 LL | enum L { A, B }
11    |      -      ^ not covered
12    = note: the matched value is of type `L`
13 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
14    |
15 LL |     match l { L::A => (), B => todo!() };
16    |                         ++++++++++++++
17
18 error[E0004]: non-exhaustive patterns: type `E1` is non-empty
19   --> $DIR/match_non_exhaustive.rs:28:11
20    |
21 LL |     match e1 {};
22    |           ^^
23    |
24 note: `E1` defined here
25   --> $DIR/auxiliary/match_non_exhaustive_lib.rs:2:1
26    |
27 LL | pub enum E1 {}
28    | ^^^^^^^^^^^^^^
29    = note: the matched value is of type `E1`, which is marked as non-exhaustive
30 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
31    |
32 LL ~     match e1 {
33 LL +         _ => todo!(),
34 LL ~     };
35    |
36
37 error[E0004]: non-exhaustive patterns: `_` not covered
38   --> $DIR/match_non_exhaustive.rs:30:11
39    |
40 LL |     match e2 { E2::A => (), E2::B => () };
41    |           ^^ pattern `_` not covered
42    |
43 note: `E2` defined here
44   --> $DIR/auxiliary/match_non_exhaustive_lib.rs:5:1
45    |
46 LL | pub enum E2 { A, B }
47    | ^^^^^^^^^^^^^^^^^^^^
48    = note: the matched value is of type `E2`, which is marked as non-exhaustive
49 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
50    |
51 LL |     match e2 { E2::A => (), E2::B => (), _ => todo!() };
52    |                                        ++++++++++++++
53
54 error: aborting due to 3 previous errors
55
56 For more information about this error, try `rustc --explain E0004`.