]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.stderr
parser will not give wrong help message for 'public'
[rust.git] / src / test / ui / rfc-2008-non-exhaustive / uninhabited / match.stderr
1 error[E0004]: non-exhaustive patterns: type `UninhabitedEnum` is non-empty
2   --> $DIR/match.rs:19:11
3    |
4 LL |     match x {}
5    |           ^
6    |
7 note: `UninhabitedEnum` defined here
8   --> $DIR/auxiliary/uninhabited.rs:5:1
9    |
10 LL | pub enum UninhabitedEnum {
11    | ^^^^^^^^^^^^^^^^^^^^^^^^
12    = note: the matched value is of type `UninhabitedEnum`, 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: type `UninhabitedStruct` is non-empty
21   --> $DIR/match.rs:23:11
22    |
23 LL |     match x {}
24    |           ^
25    |
26 note: `UninhabitedStruct` defined here
27   --> $DIR/auxiliary/uninhabited.rs:9:1
28    |
29 LL | pub struct UninhabitedStruct {
30    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
31    = note: the matched value is of type `UninhabitedStruct`
32 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
33    |
34 LL ~     match x {
35 LL +         _ => todo!(),
36 LL ~     }
37    |
38
39 error[E0004]: non-exhaustive patterns: type `UninhabitedTupleStruct` is non-empty
40   --> $DIR/match.rs:27:11
41    |
42 LL |     match x {}
43    |           ^
44    |
45 note: `UninhabitedTupleStruct` defined here
46   --> $DIR/auxiliary/uninhabited.rs:14:1
47    |
48 LL | pub struct UninhabitedTupleStruct(!);
49    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
50    = note: the matched value is of type `UninhabitedTupleStruct`
51 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
52    |
53 LL ~     match x {
54 LL +         _ => todo!(),
55 LL ~     }
56    |
57
58 error[E0004]: non-exhaustive patterns: `Tuple(_)` and `Struct { .. }` not covered
59   --> $DIR/match.rs:31:11
60    |
61 LL |     match x {}
62    |           ^ patterns `Tuple(_)` and `Struct { .. }` not covered
63    |
64 note: `UninhabitedVariants` defined here
65   --> $DIR/auxiliary/uninhabited.rs:17:23
66    |
67 LL | pub enum UninhabitedVariants {
68    | ----------------------------
69 LL |     #[non_exhaustive] Tuple(!),
70    |                       ^^^^^ not covered
71 LL |     #[non_exhaustive] Struct { x: ! }
72    |                       ^^^^^^ not covered
73    = note: the matched value is of type `UninhabitedVariants`
74 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
75    |
76 LL ~     match x {
77 LL +         Tuple(_) | Struct { .. } => todo!(),
78 LL ~     }
79    |
80
81 error: aborting due to 4 previous errors
82
83 For more information about this error, try `rustc --explain E0004`.