Skip to content

Commit c4abe9d

Browse files
committed
Remove long diagnostic for E0002
E0002 was merged into E0004 in rust-lang#36909, and the long diagnostic for E0004 is sufficient to cover empty match expressions.
1 parent 9d4d0da commit c4abe9d

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

src/librustc_const_eval/diagnostics.rs

-31
Original file line numberDiff line numberDiff line change
@@ -40,37 +40,6 @@ Ensure the ordering of the match arm is correct and remove any superfluous
4040
arms.
4141
"##,
4242

43-
E0002: r##"
44-
This error indicates that an empty match expression is invalid because the type
45-
it is matching on is non-empty (there exist values of this type). In safe code
46-
it is impossible to create an instance of an empty type, so empty match
47-
expressions are almost never desired. This error is typically fixed by adding
48-
one or more cases to the match expression.
49-
50-
An example of an empty type is `enum Empty { }`. So, the following will work:
51-
52-
```
53-
enum Empty {}
54-
55-
fn foo(x: Empty) {
56-
match x {
57-
// empty
58-
}
59-
}
60-
```
61-
62-
However, this won't:
63-
64-
```compile_fail
65-
fn foo(x: Option<String>) {
66-
match x {
67-
// empty
68-
}
69-
}
70-
```
71-
"##,
72-
73-
7443
E0003: r##"
7544
Not-a-Number (NaN) values cannot be compared for equality and hence can never
7645
match the input to a match expression. So, the following will not compile:

0 commit comments

Comments
 (0)