11//! Borrow checker diagnostics.
22
33use rustc_const_eval:: util:: call_kind;
4- use rustc_errors:: DiagnosticBuilder ;
4+ use rustc_errors:: Diagnostic ;
55use rustc_hir as hir;
66use rustc_hir:: def:: Namespace ;
77use rustc_hir:: def_id:: DefId ;
@@ -57,7 +57,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
5757 & self ,
5858 location : Location ,
5959 place : PlaceRef < ' tcx > ,
60- diag : & mut DiagnosticBuilder < ' _ > ,
60+ diag : & mut Diagnostic ,
6161 ) {
6262 debug ! ( "add_moved_or_invoked_closure_note: location={:?} place={:?}" , location, place) ;
6363 let mut target = place. local_or_deref_local ( ) ;
@@ -409,7 +409,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
409409 /// Add a note that a type does not implement `Copy`
410410 pub ( super ) fn note_type_does_not_implement_copy (
411411 & self ,
412- err : & mut DiagnosticBuilder < ' _ > ,
412+ err : & mut Diagnostic ,
413413 place_desc : & str ,
414414 ty : Ty < ' tcx > ,
415415 span : Option < Span > ,
@@ -613,23 +613,15 @@ impl UseSpans<'_> {
613613 }
614614
615615 // Add a span label to the arguments of the closure, if it exists.
616- pub ( super ) fn args_span_label (
617- self ,
618- err : & mut DiagnosticBuilder < ' _ > ,
619- message : impl Into < String > ,
620- ) {
616+ pub ( super ) fn args_span_label ( self , err : & mut Diagnostic , message : impl Into < String > ) {
621617 if let UseSpans :: ClosureUse { args_span, .. } = self {
622618 err. span_label ( args_span, message) ;
623619 }
624620 }
625621
626622 // Add a span label to the use of the captured variable, if it exists.
627623 // only adds label to the `path_span`
628- pub ( super ) fn var_span_label_path_only (
629- self ,
630- err : & mut DiagnosticBuilder < ' _ > ,
631- message : impl Into < String > ,
632- ) {
624+ pub ( super ) fn var_span_label_path_only ( self , err : & mut Diagnostic , message : impl Into < String > ) {
633625 if let UseSpans :: ClosureUse { path_span, .. } = self {
634626 err. span_label ( path_span, message) ;
635627 }
@@ -638,7 +630,7 @@ impl UseSpans<'_> {
638630 // Add a span label to the use of the captured variable, if it exists.
639631 pub ( super ) fn var_span_label (
640632 self ,
641- err : & mut DiagnosticBuilder < ' _ > ,
633+ err : & mut Diagnostic ,
642634 message : impl Into < String > ,
643635 kind_desc : impl Into < String > ,
644636 ) {
0 commit comments