UPDATE - rename AddSubdiagnostic trait to AddToDiagnostic

This commit is contained in:
Jhonny Bill Mena 2022-09-18 11:46:16 -04:00
parent 19b348fed4
commit 191fac6826
11 changed files with 23 additions and 23 deletions

View file

@ -178,7 +178,7 @@ impl IntoDiagnosticArg for hir::ConstContext {
/// Trait implemented by error types. This should not be implemented manually. Instead, use
/// `#[derive(SessionSubdiagnostic)]` -- see [rustc_macros::SessionSubdiagnostic].
#[rustc_diagnostic_item = "AddSubdiagnostic"]
pub trait AddSubdiagnostic {
pub trait AddToDiagnostic {
/// Add a subdiagnostic to an existing diagnostic.
fn add_to_diagnostic(self, diag: &mut Diagnostic);
}
@ -893,7 +893,7 @@ impl Diagnostic {
/// Add a subdiagnostic from a type that implements `SessionSubdiagnostic` - see
/// [rustc_macros::SessionSubdiagnostic].
pub fn subdiagnostic(&mut self, subdiagnostic: impl AddSubdiagnostic) -> &mut Self {
pub fn subdiagnostic(&mut self, subdiagnostic: impl AddToDiagnostic) -> &mut Self {
subdiagnostic.add_to_diagnostic(self);
self
}

View file

@ -580,7 +580,7 @@ impl<'a, G: EmissionGuarantee> DiagnosticBuilder<'a, G> {
forward!(pub fn subdiagnostic(
&mut self,
subdiagnostic: impl crate::AddSubdiagnostic
subdiagnostic: impl crate::AddToDiagnostic
) -> &mut Self);
}

View file

@ -371,7 +371,7 @@ impl fmt::Display for ExplicitBug {
impl error::Error for ExplicitBug {}
pub use diagnostic::{
AddSubdiagnostic, DecorateLint, Diagnostic, DiagnosticArg, DiagnosticArgFromDisplay,
AddToDiagnostic, DecorateLint, Diagnostic, DiagnosticArg, DiagnosticArgFromDisplay,
DiagnosticArgValue, DiagnosticId, DiagnosticStyledString, IntoDiagnosticArg, SubDiagnostic,
};
pub use diagnostic_builder::{DiagnosticBuilder, EmissionGuarantee, LintDiagnosticBuilder};