diff options
| author | Yuki Okushi <huyuumi.dev+love@gmail.com> | 2023-01-11 14:18:57 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-11 14:18:57 +0900 |
| commit | 0e92e1dd999a2d7945182c8f4f99f76e0414d0ee (patch) | |
| tree | 6524601e670eb0de268b026ba5d13d317526bd19 /compiler/rustc_errors/src | |
| parent | feca61e5eb807d53f478da5dc64a9f10200a7182 (diff) | |
| parent | 5fb9ca3c5e34a0ad4e4770ea475d75b26e201b61 (diff) | |
| download | rust-0e92e1dd999a2d7945182c8f4f99f76e0414d0ee.tar.gz rust-0e92e1dd999a2d7945182c8f4f99f76e0414d0ee.zip | |
Rollup merge of #106669 - ozkanonur:helper-function-for-lint-level, r=Nilstrieb
create helper function for `rustc_lint_defs::Level` and remove it's duplicated code Signed-off-by: ozkanonur <work@onurozkan.dev>
Diffstat (limited to 'compiler/rustc_errors/src')
| -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())) } } |
