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.
This commit is contained in:
parent
34a5ea911c
commit
32fd1a7b72
16 changed files with 27 additions and 34 deletions
|
@ -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);
|
||||
|
|
|
@ -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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue