diff options
Diffstat (limited to 'compiler/rustc_infer/src/errors/note_and_explain.rs')
-rw-r--r-- | compiler/rustc_infer/src/errors/note_and_explain.rs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/compiler/rustc_infer/src/errors/note_and_explain.rs b/compiler/rustc_infer/src/errors/note_and_explain.rs index 7e051835b..6a29d8562 100644 --- a/compiler/rustc_infer/src/errors/note_and_explain.rs +++ b/compiler/rustc_infer/src/errors/note_and_explain.rs @@ -1,5 +1,7 @@ use crate::infer::error_reporting::nice_region_error::find_anon_type; -use rustc_errors::{self, fluent, AddSubdiagnostic, IntoDiagnosticArg}; +use rustc_errors::{ + self, fluent, AddToDiagnostic, Diagnostic, IntoDiagnosticArg, SubdiagnosticMessage, +}; use rustc_middle::ty::{self, TyCtxt}; use rustc_span::{symbol::kw, Span}; @@ -158,12 +160,15 @@ impl RegionExplanation<'_> { } } -impl AddSubdiagnostic for RegionExplanation<'_> { - fn add_to_diagnostic(self, diag: &mut rustc_errors::Diagnostic) { +impl AddToDiagnostic for RegionExplanation<'_> { + fn add_to_diagnostic_with<F>(self, diag: &mut Diagnostic, _: F) + where + F: Fn(&mut Diagnostic, SubdiagnosticMessage) -> SubdiagnosticMessage, + { if let Some(span) = self.desc.span { - diag.span_note(span, fluent::infer::region_explanation); + diag.span_note(span, fluent::infer_region_explanation); } else { - diag.note(fluent::infer::region_explanation); + diag.note(fluent::infer_region_explanation); } self.desc.add_to(diag); diag.set_arg("pref_kind", self.prefix); |