1
1
//! Borrow checker diagnostics.
2
2
3
3
use rustc_const_eval:: util:: call_kind;
4
- use rustc_errors:: DiagnosticBuilder ;
4
+ use rustc_errors:: Diagnostic ;
5
5
use rustc_hir as hir;
6
6
use rustc_hir:: def:: Namespace ;
7
7
use rustc_hir:: def_id:: DefId ;
@@ -57,7 +57,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
57
57
& self ,
58
58
location : Location ,
59
59
place : PlaceRef < ' tcx > ,
60
- diag : & mut DiagnosticBuilder < ' _ > ,
60
+ diag : & mut Diagnostic ,
61
61
) {
62
62
debug ! ( "add_moved_or_invoked_closure_note: location={:?} place={:?}" , location, place) ;
63
63
let mut target = place. local_or_deref_local ( ) ;
@@ -409,7 +409,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
409
409
/// Add a note that a type does not implement `Copy`
410
410
pub ( super ) fn note_type_does_not_implement_copy (
411
411
& self ,
412
- err : & mut DiagnosticBuilder < ' _ > ,
412
+ err : & mut Diagnostic ,
413
413
place_desc : & str ,
414
414
ty : Ty < ' tcx > ,
415
415
span : Option < Span > ,
@@ -613,23 +613,15 @@ impl UseSpans<'_> {
613
613
}
614
614
615
615
// 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 > ) {
621
617
if let UseSpans :: ClosureUse { args_span, .. } = self {
622
618
err. span_label ( args_span, message) ;
623
619
}
624
620
}
625
621
626
622
// Add a span label to the use of the captured variable, if it exists.
627
623
// 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 > ) {
633
625
if let UseSpans :: ClosureUse { path_span, .. } = self {
634
626
err. span_label ( path_span, message) ;
635
627
}
@@ -638,7 +630,7 @@ impl UseSpans<'_> {
638
630
// Add a span label to the use of the captured variable, if it exists.
639
631
pub ( super ) fn var_span_label (
640
632
self ,
641
- err : & mut DiagnosticBuilder < ' _ > ,
633
+ err : & mut Diagnostic ,
642
634
message : impl Into < String > ,
643
635
kind_desc : impl Into < String > ,
644
636
) {
0 commit comments