]> git.proxmox.com Git - rustc.git/blame - src/librustc_error_codes/error_codes/E0001.md
New upstream version 1.47.0+dfsg1
[rustc.git] / src / librustc_error_codes / error_codes / E0001.md
CommitLineData
60c5eb7d
XL
1#### Note: this error code is no longer emitted by the compiler.
2
3This error suggests that the expression arm corresponding to the noted pattern
4will never be reached as for all possible values of the expression being
5matched, one of the preceding patterns will match.
6
7This means that perhaps some of the preceding patterns are too general, this
8one is too specific or the ordering is incorrect.
9
10For example, the following `match` block has too many arms:
11
12```
13match Some(0) {
14 Some(bar) => {/* ... */}
15 x => {/* ... */} // This handles the `None` case
16 _ => {/* ... */} // All possible cases have already been handled
17}
18```
19
20`match` blocks have their patterns matched in order, so, for example, putting
21a wildcard arm above a more specific arm will make the latter arm irrelevant.
22
23Ensure the ordering of the match arm is correct and remove any superfluous
24arms.