diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-02-12 10:46:40 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-12 10:46:40 +0100 |
| commit | 30bd1b53b3d5354fffc25d50fa2ab131f4875c4e (patch) | |
| tree | 4dd2da6a1d640466cd6cb9101bd56b1da7b0deed /compiler/rustc_lint | |
| parent | 9fa2557d8eb8a78c5399f66bd4827468661fc235 (diff) | |
| parent | 32fd1a7b7205d1f8ccf168c22dada83ea38e3adb (diff) | |
| download | rust-30bd1b53b3d5354fffc25d50fa2ab131f4875c4e.tar.gz rust-30bd1b53b3d5354fffc25d50fa2ab131f4875c4e.zip | |
Rollup merge of #136900 - workingjubilee:format-externabi-directly, r=oli-obk
compiler: replace `ExternAbi::name` calls with formatters Most of these just format the ABI string, so... just format ExternAbi? This makes it more consistent and less jank when we can do it.
Diffstat (limited to 'compiler/rustc_lint')
| -rw-r--r-- | compiler/rustc_lint/src/early/diagnostics.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_lint/src/lints.rs | 5 |
2 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_lint/src/early/diagnostics.rs b/compiler/rustc_lint/src/early/diagnostics.rs index 92dbc76a7b5..aeb5a03a4f7 100644 --- a/compiler/rustc_lint/src/early/diagnostics.rs +++ b/compiler/rustc_lint/src/early/diagnostics.rs @@ -160,8 +160,7 @@ pub(super) fn decorate_lint( .decorate_lint(diag); } BuiltinLintDiag::MissingAbi(label_span, default_abi) => { - lints::MissingAbi { span: label_span, default_abi: default_abi.name() } - .decorate_lint(diag); + lints::MissingAbi { span: label_span, default_abi }.decorate_lint(diag); } BuiltinLintDiag::LegacyDeriveHelpers(label_span) => { lints::LegacyDeriveHelpers { span: label_span }.decorate_lint(diag); diff --git a/compiler/rustc_lint/src/lints.rs b/compiler/rustc_lint/src/lints.rs index 09b0e1ed8bd..368d36bfdd0 100644 --- a/compiler/rustc_lint/src/lints.rs +++ b/compiler/rustc_lint/src/lints.rs @@ -2,6 +2,7 @@ #![allow(rustc::untranslatable_diagnostic)] use std::num::NonZero; +use rustc_abi::ExternAbi; use rustc_errors::codes::*; use rustc_errors::{ Applicability, Diag, DiagArgValue, DiagMessage, DiagStyledString, ElidedLifetimeInPathSubdiag, @@ -2833,9 +2834,9 @@ pub(crate) struct PatternsInFnsWithoutBodySub { #[derive(LintDiagnostic)] #[diag(lint_extern_without_abi)] pub(crate) struct MissingAbi { - #[suggestion(code = "extern \"{default_abi}\"", applicability = "machine-applicable")] + #[suggestion(code = "extern {default_abi}", applicability = "machine-applicable")] pub span: Span, - pub default_abi: &'static str, + pub default_abi: ExternAbi, } #[derive(LintDiagnostic)] |
