You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of rust-lang#123301 - Nadrieril:unions, r=compiler-errors
pattern analysis: fix union handling
Little known fact: rust supports union patterns. Exhaustiveness handles them soundly but reports nonsensical missing patterns. This PR fixes the reported patterns and documents what we're doing.
r? `@compiler-errors`
error[E0004]: non-exhaustive patterns: `U8AsBool { n: 0_u8 }` and `U8AsBool { b: false }` not covered
2
+
--> $DIR/unions.rs:22:15
3
+
|
4
+
LL | match x {
5
+
| ^ patterns `U8AsBool { n: 0_u8 }` and `U8AsBool { b: false }` not covered
6
+
|
7
+
note: `U8AsBool` defined here
8
+
--> $DIR/unions.rs:3:11
9
+
|
10
+
LL | union U8AsBool {
11
+
| ^^^^^^^^
12
+
= note: the matched value is of type `U8AsBool`
13
+
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
0 commit comments