From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- .../rustc_error_codes/src/error_codes/E0001.md | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 compiler/rustc_error_codes/src/error_codes/E0001.md (limited to 'compiler/rustc_error_codes/src/error_codes/E0001.md') diff --git a/compiler/rustc_error_codes/src/error_codes/E0001.md b/compiler/rustc_error_codes/src/error_codes/E0001.md new file mode 100644 index 000000000..90756780d --- /dev/null +++ b/compiler/rustc_error_codes/src/error_codes/E0001.md @@ -0,0 +1,24 @@ +#### 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. -- cgit v1.2.3