1
Fork 0

Auto merge of #122132 - nnethercote:diag-renaming3, r=nnethercote

Diagnostic renaming 3

A sequel to https://github.com/rust-lang/rust/pull/121780.

r? `@davidtwco`
This commit is contained in:
bors 2024-03-11 00:34:44 +00:00
commit cd81f5b27e
78 changed files with 567 additions and 586 deletions

View file

@ -27,7 +27,7 @@ use crate::errors;
use rustc_ast as ast;
use rustc_data_structures::unord::UnordMap;
use rustc_data_structures::unord::UnordSet;
use rustc_errors::{DiagArgValue, IntoDiagnosticArg};
use rustc_errors::{DiagArgValue, IntoDiagArg};
use rustc_hir::def_id::LOCAL_CRATE;
use rustc_middle::mir::mono::CodegenUnitNameBuilder;
use rustc_middle::ty::TyCtxt;
@ -205,8 +205,8 @@ impl fmt::Display for CguReuse {
}
}
impl IntoDiagnosticArg for CguReuse {
fn into_diagnostic_arg(self) -> DiagArgValue {
impl IntoDiagArg for CguReuse {
fn into_diag_arg(self) -> DiagArgValue {
DiagArgValue::Str(Cow::Owned(self.to_string()))
}
}

View file

@ -4,8 +4,7 @@ use crate::assert_module_sources::CguReuse;
use crate::back::command::Command;
use crate::fluent_generated as fluent;
use rustc_errors::{
codes::*, Diag, DiagArgValue, DiagCtxt, EmissionGuarantee, IntoDiagnostic, IntoDiagnosticArg,
Level,
codes::*, Diag, DiagArgValue, DiagCtxt, Diagnostic, EmissionGuarantee, IntoDiagArg, Level,
};
use rustc_macros::Diagnostic;
use rustc_middle::ty::layout::LayoutError;
@ -152,8 +151,8 @@ impl<'a> CopyPath<'a> {
struct DebugArgPath<'a>(pub &'a Path);
impl IntoDiagnosticArg for DebugArgPath<'_> {
fn into_diagnostic_arg(self) -> rustc_errors::DiagArgValue {
impl IntoDiagArg for DebugArgPath<'_> {
fn into_diag_arg(self) -> rustc_errors::DiagArgValue {
DiagArgValue::Str(Cow::Owned(format!("{:?}", self.0)))
}
}
@ -215,8 +214,8 @@ pub enum LinkRlibError {
pub struct ThorinErrorWrapper(pub thorin::Error);
impl<G: EmissionGuarantee> IntoDiagnostic<'_, G> for ThorinErrorWrapper {
fn into_diagnostic(self, dcx: &DiagCtxt, level: Level) -> Diag<'_, G> {
impl<G: EmissionGuarantee> Diagnostic<'_, G> for ThorinErrorWrapper {
fn into_diag(self, dcx: &DiagCtxt, level: Level) -> Diag<'_, G> {
let build = |msg| Diag::new(dcx, level, msg);
match self.0 {
thorin::Error::ReadInput(_) => build(fluent::codegen_ssa_thorin_read_input_failure),
@ -348,8 +347,8 @@ pub struct LinkingFailed<'a> {
pub escaped_output: String,
}
impl<G: EmissionGuarantee> IntoDiagnostic<'_, G> for LinkingFailed<'_> {
fn into_diagnostic(self, dcx: &DiagCtxt, level: Level) -> Diag<'_, G> {
impl<G: EmissionGuarantee> Diagnostic<'_, G> for LinkingFailed<'_> {
fn into_diag(self, dcx: &DiagCtxt, level: Level) -> Diag<'_, G> {
let mut diag = Diag::new(dcx, level, fluent::codegen_ssa_linking_failed);
diag.arg("linker_path", format!("{}", self.linker_path.display()));
diag.arg("exit_status", format!("{}", self.exit_status));
@ -974,8 +973,8 @@ pub enum ExpectedPointerMutability {
Not,
}
impl IntoDiagnosticArg for ExpectedPointerMutability {
fn into_diagnostic_arg(self) -> DiagArgValue {
impl IntoDiagArg for ExpectedPointerMutability {
fn into_diag_arg(self) -> DiagArgValue {
match self {
ExpectedPointerMutability::Mut => DiagArgValue::Str(Cow::Borrowed("*mut")),
ExpectedPointerMutability::Not => DiagArgValue::Str(Cow::Borrowed("*_")),