diff options
| author | Aris Merchant <22333129+inquisitivecrystal@users.noreply.github.com> | 2021-06-21 18:11:53 -0700 |
|---|---|---|
| committer | Aris Merchant <22333129+inquisitivecrystal@users.noreply.github.com> | 2021-06-22 22:56:38 -0700 |
| commit | 0bb6bc40ce8d544ca41006d3faf8bcda2152030f (patch) | |
| tree | f1a3e905e4892df66eecf80862048da7ee1dba91 /compiler/rustc_driver/src | |
| parent | 406d4a9cc3b9601cf98a07c6c83e0227d64f5d48 (diff) | |
| download | rust-0bb6bc40ce8d544ca41006d3faf8bcda2152030f.tar.gz rust-0bb6bc40ce8d544ca41006d3faf8bcda2152030f.zip | |
Teach rustc to accept lowercase error codes
Diffstat (limited to 'compiler/rustc_driver/src')
| -rw-r--r-- | compiler/rustc_driver/src/lib.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_driver/src/lib.rs b/compiler/rustc_driver/src/lib.rs index b943977e4c2..87bc829b488 100644 --- a/compiler/rustc_driver/src/lib.rs +++ b/compiler/rustc_driver/src/lib.rs @@ -528,8 +528,12 @@ fn stderr_isatty() -> bool { } fn handle_explain(registry: Registry, code: &str, output: ErrorOutputType) { - let normalised = - if code.starts_with('E') { code.to_string() } else { format!("E{0:0>4}", code) }; + let upper_cased_code = code.to_ascii_uppercase(); + let normalised = if upper_cased_code.starts_with('E') { + upper_cased_code + } else { + format!("E{0:0>4}", code) + }; match registry.try_find_description(&normalised) { Ok(Some(description)) => { let mut is_in_code_block = false; |
