]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr
parser will not give wrong help message for 'public'
[rust.git] / src / test / ui / rfc-2008-non-exhaustive / enum_same_crate_empty_match.stderr
1 error: unreachable pattern
2   --> $DIR/enum_same_crate_empty_match.rs:28:9
3    |
4 LL |         _ => {}
5    |         ^
6    |
7 note: the lint level is defined here
8   --> $DIR/enum_same_crate_empty_match.rs:1:9
9    |
10 LL | #![deny(unreachable_patterns)]
11    |         ^^^^^^^^^^^^^^^^^^^^
12
13 error[E0004]: non-exhaustive patterns: `Unit`, `Tuple(_)` and `Struct { .. }` not covered
14   --> $DIR/enum_same_crate_empty_match.rs:33:11
15    |
16 LL |     match NonExhaustiveEnum::Unit {}
17    |           ^^^^^^^^^^^^^^^^^^^^^^^ patterns `Unit`, `Tuple(_)` and `Struct { .. }` not covered
18    |
19 note: `NonExhaustiveEnum` defined here
20   --> $DIR/enum_same_crate_empty_match.rs:5:5
21    |
22 LL | pub enum NonExhaustiveEnum {
23    |          -----------------
24 LL |     Unit,
25    |     ^^^^ not covered
26 LL |
27 LL |     Tuple(u32),
28    |     ^^^^^ not covered
29 LL |
30 LL |     Struct { field: u32 }
31    |     ^^^^^^ not covered
32    = note: the matched value is of type `NonExhaustiveEnum`
33 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
34    |
35 LL ~     match NonExhaustiveEnum::Unit {
36 LL +         Unit | Tuple(_) | Struct { .. } => todo!(),
37 LL +     }
38    |
39
40 error[E0004]: non-exhaustive patterns: `Unit`, `Tuple(_)` and `Struct { .. }` not covered
41   --> $DIR/enum_same_crate_empty_match.rs:35:11
42    |
43 LL |     match NormalEnum::Unit {}
44    |           ^^^^^^^^^^^^^^^^ patterns `Unit`, `Tuple(_)` and `Struct { .. }` not covered
45    |
46 note: `NormalEnum` defined here
47   --> $DIR/enum_same_crate_empty_match.rs:14:5
48    |
49 LL | pub enum NormalEnum {
50    |          ----------
51 LL |     Unit,
52    |     ^^^^ not covered
53 LL |
54 LL |     Tuple(u32),
55    |     ^^^^^ not covered
56 LL |
57 LL |     Struct { field: u32 }
58    |     ^^^^^^ not covered
59    = note: the matched value is of type `NormalEnum`
60 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
61    |
62 LL ~     match NormalEnum::Unit {
63 LL +         Unit | Tuple(_) | Struct { .. } => todo!(),
64 LL +     }
65    |
66
67 error: aborting due to 3 previous errors
68
69 For more information about this error, try `rustc --explain E0004`.