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

@ -1,7 +1,7 @@
use crate::fluent_generated as fluent;
use rustc_errors::{
codes::*, AddToDiagnostic, Applicability, Diag, DiagCtxt, EmissionGuarantee, IntoDiagnostic,
Level, SubdiagMessageOp,
codes::*, Applicability, Diag, DiagCtxt, Diagnostic, EmissionGuarantee, Level,
SubdiagMessageOp, Subdiagnostic,
};
use rustc_macros::Diagnostic;
use rustc_middle::ty::{self, ClosureKind, PolyTraitRef, Ty};
@ -57,9 +57,9 @@ pub struct NegativePositiveConflict<'tcx> {
pub positive_impl_span: Result<Span, Symbol>,
}
impl<G: EmissionGuarantee> IntoDiagnostic<'_, G> for NegativePositiveConflict<'_> {
impl<G: EmissionGuarantee> Diagnostic<'_, G> for NegativePositiveConflict<'_> {
#[track_caller]
fn into_diagnostic(self, dcx: &DiagCtxt, level: Level) -> Diag<'_, G> {
fn into_diag(self, dcx: &DiagCtxt, level: Level) -> Diag<'_, G> {
let mut diag = Diag::new(dcx, level, fluent::trait_selection_negative_positive_conflict);
diag.arg("trait_desc", self.trait_desc.print_only_trait_path().to_string());
diag.arg("self_desc", self.self_ty.map_or_else(|| "none".to_string(), |ty| ty.to_string()));
@ -100,8 +100,8 @@ pub enum AdjustSignatureBorrow {
RemoveBorrow { remove_borrow: Vec<(Span, String)> },
}
impl AddToDiagnostic for AdjustSignatureBorrow {
fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagMessageOp<G>>(
impl Subdiagnostic for AdjustSignatureBorrow {
fn add_to_diag_with<G: EmissionGuarantee, F: SubdiagMessageOp<G>>(
self,
diag: &mut Diag<'_, G>,
_f: F,