diff options
Diffstat (limited to 'compiler/rustc_errors/src/diagnostic_impls.rs')
| -rw-r--r-- | compiler/rustc_errors/src/diagnostic_impls.rs | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/compiler/rustc_errors/src/diagnostic_impls.rs b/compiler/rustc_errors/src/diagnostic_impls.rs index 794b6efcc2b..dad5e98aac0 100644 --- a/compiler/rustc_errors/src/diagnostic_impls.rs +++ b/compiler/rustc_errors/src/diagnostic_impls.rs @@ -179,16 +179,7 @@ impl IntoDiagnosticArg for type_ir::FloatTy { impl IntoDiagnosticArg for Level { fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> { - DiagnosticArgValue::Str(Cow::Borrowed(match self { - Level::Allow => "-A", - Level::Warn => "-W", - Level::ForceWarn(_) => "--force-warn", - Level::Deny => "-D", - Level::Forbid => "-F", - Level::Expect(_) => { - unreachable!("lints with the level of `expect` should not run this code"); - } - })) + DiagnosticArgValue::Str(Cow::Borrowed(self.to_cmd_flag())) } } |
