]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-2008-non-exhaustive/enum.stderr
Auto merge of #94773 - cjgillot:lifetime-fresh-did, r=oli-obk
[rust.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 LL | |     Unit,
31 LL | |     Tuple(u32),
32 LL | |     Struct { field: u32 },
33 LL | | }
34    | |_^
35    = note: the matched value is of type `NonExhaustiveEnum`, which is marked as non-exhaustive
36 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
37    |
38 LL ~         NonExhaustiveEnum::Struct { .. } => "third",
39 LL +         _ => todo!()
40    |
41
42 error[E0004]: non-exhaustive patterns: `_` not covered
43   --> $DIR/enum.rs:23:11
44    |
45 LL |     match enum_unit {};
46    |           ^^^^^^^^^ pattern `_` not covered
47    |
48 note: `NonExhaustiveEnum` defined here
49   --> $DIR/auxiliary/enums.rs:4:1
50    |
51 LL | / pub enum NonExhaustiveEnum {
52 LL | |     Unit,
53 LL | |     Tuple(u32),
54 LL | |     Struct { field: u32 },
55 LL | | }
56    | |_^
57    = note: the matched value is of type `NonExhaustiveEnum`, which is marked as non-exhaustive
58 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
59    |
60 LL ~     match enum_unit {
61 LL +         _ => todo!(),
62 LL ~     };
63    |
64
65 error: aborting due to 3 previous errors
66
67 For more information about this error, try `rustc --explain E0004`.