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