1
1
error: unreachable pattern
2
- --> $DIR/match-empty-exhaustive_patterns.rs:28 :9
2
+ --> $DIR/match-empty-exhaustive_patterns.rs:41 :9
3
3
|
4
4
LL | _ => {},
5
5
| ^
@@ -11,65 +11,71 @@ LL | #![deny(unreachable_patterns)]
11
11
| ^^^^^^^^^^^^^^^^^^^^
12
12
13
13
error: unreachable pattern
14
- --> $DIR/match-empty-exhaustive_patterns.rs:35:9
14
+ --> $DIR/match-empty-exhaustive_patterns.rs:44:9
15
+ |
16
+ LL | _ if false => {},
17
+ | ^
18
+
19
+ error: unreachable pattern
20
+ --> $DIR/match-empty-exhaustive_patterns.rs:51:9
15
21
|
16
22
LL | Some(_) => {}
17
23
| ^^^^^^^
18
24
19
25
error: unreachable pattern
20
- --> $DIR/match-empty-exhaustive_patterns.rs:39 :9
26
+ --> $DIR/match-empty-exhaustive_patterns.rs:55 :9
21
27
|
22
28
LL | Some(_) => {}
23
29
| ^^^^^^^
24
30
25
31
error[E0004]: non-exhaustive patterns: type `u8` is non-empty
26
- --> $DIR/match-empty-exhaustive_patterns.rs:42:11
32
+ --> $DIR/match-empty-exhaustive_patterns.rs:58:18
27
33
|
28
- LL | match 0u8 {}
29
- | ^^^
34
+ LL | match_empty!( 0u8);
35
+ | ^^^
30
36
|
31
37
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
32
38
33
39
error[E0004]: non-exhaustive patterns: type `NonEmptyStruct` is non-empty
34
- --> $DIR/match-empty-exhaustive_patterns.rs:44:11
40
+ --> $DIR/match-empty-exhaustive_patterns.rs:60:18
35
41
|
36
- LL | match NonEmptyStruct(true) {}
37
- | ^^^^^^^^^^^^^^^^^^^^
42
+ LL | match_empty!( NonEmptyStruct(true));
43
+ | ^^^^^^^^^^^^^^^^^^^^
38
44
|
39
45
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
40
46
41
47
error[E0004]: non-exhaustive patterns: type `NonEmptyUnion1` is non-empty
42
- --> $DIR/match-empty-exhaustive_patterns.rs:46:11
48
+ --> $DIR/match-empty-exhaustive_patterns.rs:62:18
43
49
|
44
- LL | match ( NonEmptyUnion1 { foo: () }) {}
45
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
50
+ LL | match_empty!(( NonEmptyUnion1 { foo: () }));
51
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
46
52
|
47
53
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
48
54
49
55
error[E0004]: non-exhaustive patterns: type `NonEmptyUnion2` is non-empty
50
- --> $DIR/match-empty-exhaustive_patterns.rs:48:11
56
+ --> $DIR/match-empty-exhaustive_patterns.rs:64:18
51
57
|
52
- LL | match ( NonEmptyUnion2 { foo: () }) {}
53
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
58
+ LL | match_empty!(( NonEmptyUnion2 { foo: () }));
59
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
54
60
|
55
61
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
56
62
57
63
error[E0004]: non-exhaustive patterns: pattern `Foo` of type `NonEmptyEnum1` is not handled
58
- --> $DIR/match-empty-exhaustive_patterns.rs:50:11
64
+ --> $DIR/match-empty-exhaustive_patterns.rs:66:18
59
65
|
60
66
LL | / enum NonEmptyEnum1 {
61
67
LL | | Foo(bool),
62
68
| | --- variant not covered
63
69
LL | | }
64
70
| |_- `NonEmptyEnum1` defined here
65
71
...
66
- LL | match NonEmptyEnum1::Foo(true) {}
67
- | ^^^^^^^^^^^^^^^^^^^^^^^^
72
+ LL | match_empty!( NonEmptyEnum1::Foo(true));
73
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
68
74
|
69
75
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
70
76
71
77
error[E0004]: non-exhaustive patterns: multiple patterns of type `NonEmptyEnum2` are not handled
72
- --> $DIR/match-empty-exhaustive_patterns.rs:52:11
78
+ --> $DIR/match-empty-exhaustive_patterns.rs:68:18
73
79
|
74
80
LL | / enum NonEmptyEnum2 {
75
81
LL | | Foo(bool),
@@ -79,24 +85,110 @@ LL | | Bar,
79
85
LL | | }
80
86
| |_- `NonEmptyEnum2` defined here
81
87
...
82
- LL | match NonEmptyEnum2::Foo(true) {}
83
- | ^^^^^^^^^^^^^^^^^^^^^^^^
88
+ LL | match_empty!( NonEmptyEnum2::Foo(true));
89
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
84
90
|
85
91
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
86
92
87
93
error[E0004]: non-exhaustive patterns: multiple patterns of type `NonEmptyEnum5` are not handled
88
- --> $DIR/match-empty-exhaustive_patterns.rs:54:11
94
+ --> $DIR/match-empty-exhaustive_patterns.rs:70:18
95
+ |
96
+ LL | / enum NonEmptyEnum5 {
97
+ LL | | V1, V2, V3, V4, V5,
98
+ LL | | }
99
+ | |_- `NonEmptyEnum5` defined here
100
+ ...
101
+ LL | match_empty!(NonEmptyEnum5::V1);
102
+ | ^^^^^^^^^^^^^^^^^
103
+ |
104
+ = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
105
+
106
+ error[E0004]: non-exhaustive patterns: `_` not covered
107
+ --> $DIR/match-empty-exhaustive_patterns.rs:73:18
108
+ |
109
+ LL | match_false!(0u8);
110
+ | ^^^ pattern `_` not covered
111
+ |
112
+ = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
113
+
114
+ error[E0004]: non-exhaustive patterns: `_` not covered
115
+ --> $DIR/match-empty-exhaustive_patterns.rs:75:18
116
+ |
117
+ LL | struct NonEmptyStruct(bool);
118
+ | ---------------------------- `NonEmptyStruct` defined here
119
+ ...
120
+ LL | match_false!(NonEmptyStruct(true));
121
+ | ^^^^^^^^^^^^^^^^^^^^ pattern `_` not covered
122
+ |
123
+ = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
124
+
125
+ error[E0004]: non-exhaustive patterns: `_` not covered
126
+ --> $DIR/match-empty-exhaustive_patterns.rs:77:18
127
+ |
128
+ LL | / union NonEmptyUnion1 {
129
+ LL | | foo: (),
130
+ LL | | }
131
+ | |_- `NonEmptyUnion1` defined here
132
+ ...
133
+ LL | match_false!((NonEmptyUnion1 { foo: () }));
134
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `_` not covered
135
+ |
136
+ = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
137
+
138
+ error[E0004]: non-exhaustive patterns: `_` not covered
139
+ --> $DIR/match-empty-exhaustive_patterns.rs:79:18
140
+ |
141
+ LL | / union NonEmptyUnion2 {
142
+ LL | | foo: (),
143
+ LL | | bar: (),
144
+ LL | | }
145
+ | |_- `NonEmptyUnion2` defined here
146
+ ...
147
+ LL | match_false!((NonEmptyUnion2 { foo: () }));
148
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `_` not covered
149
+ |
150
+ = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
151
+
152
+ error[E0004]: non-exhaustive patterns: `_` not covered
153
+ --> $DIR/match-empty-exhaustive_patterns.rs:81:18
154
+ |
155
+ LL | / enum NonEmptyEnum1 {
156
+ LL | | Foo(bool),
157
+ LL | | }
158
+ | |_- `NonEmptyEnum1` defined here
159
+ ...
160
+ LL | match_false!(NonEmptyEnum1::Foo(true));
161
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `_` not covered
162
+ |
163
+ = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
164
+
165
+ error[E0004]: non-exhaustive patterns: `_` not covered
166
+ --> $DIR/match-empty-exhaustive_patterns.rs:83:18
167
+ |
168
+ LL | / enum NonEmptyEnum2 {
169
+ LL | | Foo(bool),
170
+ LL | | Bar,
171
+ LL | | }
172
+ | |_- `NonEmptyEnum2` defined here
173
+ ...
174
+ LL | match_false!(NonEmptyEnum2::Foo(true));
175
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `_` not covered
176
+ |
177
+ = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
178
+
179
+ error[E0004]: non-exhaustive patterns: `_` not covered
180
+ --> $DIR/match-empty-exhaustive_patterns.rs:85:18
89
181
|
90
182
LL | / enum NonEmptyEnum5 {
91
183
LL | | V1, V2, V3, V4, V5,
92
184
LL | | }
93
185
| |_- `NonEmptyEnum5` defined here
94
186
...
95
- LL | match NonEmptyEnum5::V1 {}
96
- | ^^^^^^^^^^^^^^^^^
187
+ LL | match_false!( NonEmptyEnum5::V1);
188
+ | ^^^^^^^^^^^^^^^^^ pattern `_` not covered
97
189
|
98
190
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
99
191
100
- error: aborting due to 10 previous errors
192
+ error: aborting due to 18 previous errors
101
193
102
194
For more information about this error, try `rustc --explain E0004`.
0 commit comments