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
{{ message }}
This repository was archived by the owner on May 28, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: tests/ui/pattern/usefulness/empty-match.normal.stderr
+60-17Lines changed: 60 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -54,8 +54,51 @@ error: unreachable pattern
54
54
LL | _ if false => {},
55
55
| ^
56
56
57
+
error[E0004]: non-exhaustive patterns: `Ok(_)` and `Err(_)` not covered
58
+
--> $DIR/empty-match.rs:96:11
59
+
|
60
+
LL | match x {} // ok
61
+
| ^ patterns `Ok(_)` and `Err(_)` not covered
62
+
|
63
+
note: `Result<!, !>` defined here
64
+
--> $SRC_DIR/core/src/result.rs:LL:COL
65
+
::: $SRC_DIR/core/src/result.rs:LL:COL
66
+
|
67
+
= note: not covered
68
+
::: $SRC_DIR/core/src/result.rs:LL:COL
69
+
|
70
+
= note: not covered
71
+
= note: the matched value is of type `Result<!, !>`
72
+
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
73
+
|
74
+
LL ~ match x {
75
+
LL + Ok(_) | Err(_) => todo!(),
76
+
LL ~ } // ok
77
+
|
78
+
79
+
error[E0004]: non-exhaustive patterns: `Ok(_)` and `Err(_)` not covered
80
+
--> $DIR/empty-match.rs:104:11
81
+
|
82
+
LL | match x {
83
+
| ^ patterns `Ok(_)` and `Err(_)` not covered
84
+
|
85
+
note: `Result<!, !>` defined here
86
+
--> $SRC_DIR/core/src/result.rs:LL:COL
87
+
::: $SRC_DIR/core/src/result.rs:LL:COL
88
+
|
89
+
= note: not covered
90
+
::: $SRC_DIR/core/src/result.rs:LL:COL
91
+
|
92
+
= note: not covered
93
+
= note: the matched value is of type `Result<!, !>`
94
+
= note: match arms with guards don't count towards exhaustivity
95
+
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
96
+
|
97
+
LL | _ if false => {}, Ok(_) | Err(_) => todo!(),
98
+
| +++++++++++++++++++++++++++
99
+
57
100
error[E0004]: non-exhaustive patterns: type `u8` is non-empty
58
-
--> $DIR/empty-match.rs:109:20
101
+
--> $DIR/empty-match.rs:128:20
59
102
|
60
103
LL | match_no_arms!(0u8);
61
104
| ^^^
@@ -64,7 +107,7 @@ LL | match_no_arms!(0u8);
64
107
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
65
108
66
109
error[E0004]: non-exhaustive patterns: type `NonEmptyStruct1` is non-empty
67
-
--> $DIR/empty-match.rs:111:20
110
+
--> $DIR/empty-match.rs:130:20
68
111
|
69
112
LL | match_no_arms!(NonEmptyStruct1);
70
113
| ^^^^^^^^^^^^^^^
@@ -78,7 +121,7 @@ LL | struct NonEmptyStruct1;
78
121
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
79
122
80
123
error[E0004]: non-exhaustive patterns: type `NonEmptyStruct2` is non-empty
0 commit comments