diff options
| author | Ezra Shaw <ezrasure@outlook.com> | 2023-02-25 20:14:10 +1300 |
|---|---|---|
| committer | Ezra Shaw <ezrasure@outlook.com> | 2023-02-26 20:12:36 +1300 |
| commit | 90677edcba063ee83316ef109e0fe54116015575 (patch) | |
| tree | 2ccfefb0af2241e8b52e20bfea7a09b44b07c20d /compiler/rustc_driver_impl/src | |
| parent | 70fd012439d75fd6ce561a6518b9b8fd399f455f (diff) | |
| download | rust-90677edcba063ee83316ef109e0fe54116015575.tar.gz rust-90677edcba063ee83316ef109e0fe54116015575.zip | |
refactor: statically guarantee that current error codes are documented
Diffstat (limited to 'compiler/rustc_driver_impl/src')
| -rw-r--r-- | compiler/rustc_driver_impl/src/lib.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs index 54bcb154da2..464ddae476a 100644 --- a/compiler/rustc_driver_impl/src/lib.rs +++ b/compiler/rustc_driver_impl/src/lib.rs @@ -485,7 +485,7 @@ fn handle_explain(registry: Registry, code: &str, output: ErrorOutputType) { let normalised = if upper_cased_code.starts_with('E') { upper_cased_code } else { format!("E{code:0>4}") }; match registry.try_find_description(&normalised) { - Ok(Some(description)) => { + Ok(description) => { let mut is_in_code_block = false; let mut text = String::new(); // Slice off the leading newline and print. @@ -509,9 +509,6 @@ fn handle_explain(registry: Registry, code: &str, output: ErrorOutputType) { print!("{text}"); } } - Ok(None) => { - early_error(output, &format!("no extended information for {code}")); - } Err(InvalidErrorCode) => { early_error(output, &format!("{code} is not a valid error code")); } |
