diff options
Diffstat (limited to 'compiler/rustc_mir_build/src/errors.rs')
| -rw-r--r-- | compiler/rustc_mir_build/src/errors.rs | 17 | 
1 files changed, 7 insertions, 10 deletions
| diff --git a/compiler/rustc_mir_build/src/errors.rs b/compiler/rustc_mir_build/src/errors.rs index 101f1cb9f2f..95e69acbf23 100644 --- a/compiler/rustc_mir_build/src/errors.rs +++ b/compiler/rustc_mir_build/src/errors.rs @@ -1,8 +1,8 @@ use crate::fluent_generated as fluent; use rustc_errors::DiagnosticArgValue; use rustc_errors::{ - codes::*, AddToDiagnostic, Applicability, DiagCtxt, DiagnosticBuilder, EmissionGuarantee, - IntoDiagnostic, Level, MultiSpan, SubdiagnosticMessageOp, + codes::*, AddToDiagnostic, Applicability, Diag, DiagCtxt, EmissionGuarantee, IntoDiagnostic, + Level, MultiSpan, SubdiagnosticMessageOp, }; use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic}; use rustc_middle::ty::{self, Ty}; @@ -422,7 +422,7 @@ pub struct UnsafeNotInheritedLintNote { impl AddToDiagnostic for UnsafeNotInheritedLintNote { fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>( self, - diag: &mut DiagnosticBuilder<'_, G>, + diag: &mut Diag<'_, G>, _f: F, ) { diag.span_note(self.signature_span, fluent::mir_build_unsafe_fn_safe_body); @@ -464,12 +464,9 @@ pub(crate) struct NonExhaustivePatternsTypeNotEmpty<'p, 'tcx, 'm> { impl<'a, G: EmissionGuarantee> IntoDiagnostic<'a, G> for NonExhaustivePatternsTypeNotEmpty<'_, '_, '_> { - fn into_diagnostic(self, dcx: &'a DiagCtxt, level: Level) -> DiagnosticBuilder<'_, G> { - let mut diag = DiagnosticBuilder::new( - dcx, - level, - fluent::mir_build_non_exhaustive_patterns_type_not_empty, - ); + fn into_diagnostic(self, dcx: &'a DiagCtxt, level: Level) -> Diag<'_, G> { + let mut diag = + Diag::new(dcx, level, fluent::mir_build_non_exhaustive_patterns_type_not_empty); diag.span(self.span); diag.code(E0004); let peeled_ty = self.ty.peel_refs(); @@ -873,7 +870,7 @@ pub struct Variant { impl<'tcx> AddToDiagnostic for AdtDefinedHere<'tcx> { fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>( self, - diag: &mut DiagnosticBuilder<'_, G>, + diag: &mut Diag<'_, G>, _f: F, ) { diag.arg("ty", self.ty); | 
