11error: unreachable pattern
2- --> $DIR/match-empty-exhaustive_patterns.rs:21 :9
2+ --> $DIR/match-empty-exhaustive_patterns.rs:28 :9
33 |
44LL | _ => {},
55 | ^
@@ -11,27 +11,27 @@ LL | #![deny(unreachable_patterns)]
1111 | ^^^^^^^^^^^^^^^^^^^^
1212
1313error: unreachable pattern
14- --> $DIR/match-empty-exhaustive_patterns.rs:28 :9
14+ --> $DIR/match-empty-exhaustive_patterns.rs:35 :9
1515 |
1616LL | Some(_) => {}
1717 | ^^^^^^^
1818
1919error: unreachable pattern
20- --> $DIR/match-empty-exhaustive_patterns.rs:32 :9
20+ --> $DIR/match-empty-exhaustive_patterns.rs:39 :9
2121 |
2222LL | Some(_) => {}
2323 | ^^^^^^^
2424
2525error[E0004]: non-exhaustive patterns: type `u8` is non-empty
26- --> $DIR/match-empty-exhaustive_patterns.rs:35 :11
26+ --> $DIR/match-empty-exhaustive_patterns.rs:42 :11
2727 |
2828LL | match 0u8 {}
2929 | ^^^
3030 |
3131 = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
3232
3333error[E0004]: non-exhaustive patterns: pattern `NonEmptyStruct` of type `NonEmptyStruct` is not handled
34- --> $DIR/match-empty-exhaustive_patterns.rs:37 :11
34+ --> $DIR/match-empty-exhaustive_patterns.rs:44 :11
3535 |
3636LL | struct NonEmptyStruct(bool);
3737 | ----------------------------
@@ -44,8 +44,41 @@ LL | match NonEmptyStruct(true) {}
4444 |
4545 = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
4646
47+ error[E0004]: non-exhaustive patterns: pattern `NonEmptyUnion1` of type `NonEmptyUnion1` is not handled
48+ --> $DIR/match-empty-exhaustive_patterns.rs:46:11
49+ |
50+ LL | union NonEmptyUnion1 {
51+ | - -------------- variant not covered
52+ | _|
53+ | |
54+ LL | | foo: (),
55+ LL | | }
56+ | |_- `NonEmptyUnion1` defined here
57+ ...
58+ LL | match (NonEmptyUnion1 { foo: () }) {}
59+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
60+ |
61+ = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
62+
63+ error[E0004]: non-exhaustive patterns: pattern `NonEmptyUnion2` of type `NonEmptyUnion2` is not handled
64+ --> $DIR/match-empty-exhaustive_patterns.rs:48:11
65+ |
66+ LL | union NonEmptyUnion2 {
67+ | - -------------- variant not covered
68+ | _|
69+ | |
70+ LL | | foo: (),
71+ LL | | bar: (),
72+ LL | | }
73+ | |_- `NonEmptyUnion2` defined here
74+ ...
75+ LL | match (NonEmptyUnion2 { foo: () }) {}
76+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
77+ |
78+ = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
79+
4780error[E0004]: non-exhaustive patterns: pattern `Foo` of type `NonEmptyEnum1` is not handled
48- --> $DIR/match-empty-exhaustive_patterns.rs:39 :11
81+ --> $DIR/match-empty-exhaustive_patterns.rs:50 :11
4982 |
5083LL | / enum NonEmptyEnum1 {
5184LL | | Foo(bool),
@@ -59,7 +92,7 @@ LL | match NonEmptyEnum1::Foo(true) {}
5992 = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
6093
6194error[E0004]: non-exhaustive patterns: multiple patterns of type `NonEmptyEnum2` are not handled
62- --> $DIR/match-empty-exhaustive_patterns.rs:41 :11
95+ --> $DIR/match-empty-exhaustive_patterns.rs:52 :11
6396 |
6497LL | / enum NonEmptyEnum2 {
6598LL | | Foo(bool),
@@ -75,7 +108,7 @@ LL | match NonEmptyEnum2::Foo(true) {}
75108 = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
76109
77110error[E0004]: non-exhaustive patterns: multiple patterns of type `NonEmptyEnum5` are not handled
78- --> $DIR/match-empty-exhaustive_patterns.rs:43 :11
111+ --> $DIR/match-empty-exhaustive_patterns.rs:54 :11
79112 |
80113LL | / enum NonEmptyEnum5 {
81114LL | | V1, V2, V3, V4, V5,
@@ -87,6 +120,6 @@ LL | match NonEmptyEnum5::V1 {}
87120 |
88121 = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
89122
90- error: aborting due to 8 previous errors
123+ error: aborting due to 10 previous errors
91124
92125For more information about this error, try `rustc --explain E0004`.
0 commit comments