Rust errors / Everything else
Rust compiler error · checked with rustc 1.99.0
Rust error E0001: #### Note: this error code is no longer emitted by the compiler
What it means#### Note: this error code is no longer emitted by the compiler.
Retired: rustc no longer emits this error code. You may still see it in old answers, books and CI logs from older toolchains; the explanation below is kept for reference.
The compiler team's explanation
Note: this error code is no longer emitted by the compiler.
This error suggests that the expression arm corresponding to the noted pattern will never be reached as for all possible values of the expression being matched, one of the preceding patterns will match.
This means that perhaps some of the preceding patterns are too general, this one is too specific or the ordering is incorrect.
For example, the following match block has too many arms:
match Some(0) {
Some(bar) => {/* ... */}
x => {/* ... */} // This handles the `None` case
_ => {/* ... */} // All possible cases have already been handled
}
match blocks have their patterns matched in order, so, for example, putting a wildcard arm above a more specific arm will make the latter arm irrelevant.
Ensure the ordering of the match arm is correct and remove any superfluous arms.
From rustc --explain E0001 (1.99.0), part of the Rust project, MIT or Apache-2.0. Official page.
Related errors
- E0061this function takes N arguments but M were supplied
- E0412cannot find type in this scope
- E0515cannot return reference to local variable
- E0728await is only allowed inside async functions and blocks
- E0040explicit use of destructor method
- E0045C-variadic functions with the "Rust" calling convention are not supported
Up next
Often hit nextE0061: this function takes N arguments but M were suppliedA related error from the same family.Read it next →Did this answer your question?