1- use borrow_check:: nll:: explain_borrow:: BorrowExplanation ;
2- use borrow_check:: nll:: region_infer:: { RegionName , RegionNameSource } ;
3- use borrow_check:: prefixes:: IsPrefixOf ;
4- use borrow_check:: WriteKind ;
1+ use crate :: borrow_check:: nll:: explain_borrow:: BorrowExplanation ;
2+ use crate :: borrow_check:: nll:: region_infer:: { RegionName , RegionNameSource } ;
3+ use crate :: borrow_check:: prefixes:: IsPrefixOf ;
4+ use crate :: borrow_check:: WriteKind ;
55use rustc:: hir;
66use rustc:: hir:: def_id:: DefId ;
77use rustc:: middle:: region:: ScopeTree ;
@@ -22,10 +22,10 @@ use syntax_pos::Span;
2222use super :: borrow_set:: BorrowData ;
2323use super :: { Context , MirBorrowckCtxt } ;
2424use super :: { InitializationRequiringAction , PrefixSet } ;
25- use dataflow:: drop_flag_effects;
26- use dataflow:: move_paths:: indexes:: MoveOutIndex ;
27- use dataflow:: move_paths:: MovePathIndex ;
28- use util:: borrowck_errors:: { BorrowckErrors , Origin } ;
25+ use crate :: dataflow:: drop_flag_effects;
26+ use crate :: dataflow:: move_paths:: indexes:: MoveOutIndex ;
27+ use crate :: dataflow:: move_paths:: MovePathIndex ;
28+ use crate :: util:: borrowck_errors:: { BorrowckErrors , Origin } ;
2929
3030#[ derive( Debug ) ]
3131struct MoveSite {
@@ -1726,7 +1726,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
17261726 }
17271727
17281728 /// End-user visible description of the `field`nth field of `base`
1729- fn describe_field ( & self , base : & Place , field : Field ) -> String {
1729+ fn describe_field ( & self , base : & Place < ' _ > , field : Field ) -> String {
17301730 match * base {
17311731 Place :: Local ( local) => {
17321732 let local = & self . mir . local_decls [ local] ;
@@ -1751,7 +1751,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
17511751 }
17521752
17531753 /// End-user visible description of the `field_index`nth field of `ty`
1754- fn describe_field_from_ty ( & self , ty : & ty:: Ty , field : Field ) -> String {
1754+ fn describe_field_from_ty ( & self , ty : & ty:: Ty < ' _ > , field : Field ) -> String {
17551755 if ty. is_box ( ) {
17561756 // If the type is a box, the field is described from the boxed type
17571757 self . describe_field_from_ty ( & ty. boxed_ty ( ) , field)
@@ -1860,7 +1860,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
18601860 fn annotate_argument_and_return_for_borrow (
18611861 & self ,
18621862 borrow : & BorrowData < ' tcx > ,
1863- ) -> Option < AnnotatedBorrowFnSignature > {
1863+ ) -> Option < AnnotatedBorrowFnSignature < ' _ > > {
18641864 // Define a fallback for when we can't match a closure.
18651865 let fallback = || {
18661866 let is_closure = self . infcx . tcx . is_closure ( self . mir_def_id ) ;
@@ -2081,7 +2081,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
20812081 & self ,
20822082 did : DefId ,
20832083 sig : ty:: PolyFnSig < ' tcx > ,
2084- ) -> Option < AnnotatedBorrowFnSignature > {
2084+ ) -> Option < AnnotatedBorrowFnSignature < ' _ > > {
20852085 debug ! ( "annotate_fn_sig: did={:?} sig={:?}" , did, sig) ;
20862086 let is_closure = self . infcx . tcx . is_closure ( did) ;
20872087 let fn_node_id = self . infcx . tcx . hir ( ) . as_local_node_id ( did) ?;
@@ -2368,14 +2368,22 @@ impl UseSpans {
23682368 }
23692369
23702370 // Add a span label to the arguments of the closure, if it exists.
2371- pub ( super ) fn args_span_label ( self , err : & mut DiagnosticBuilder , message : impl Into < String > ) {
2371+ pub ( super ) fn args_span_label (
2372+ self ,
2373+ err : & mut DiagnosticBuilder < ' _ > ,
2374+ message : impl Into < String > ,
2375+ ) {
23722376 if let UseSpans :: ClosureUse { args_span, .. } = self {
23732377 err. span_label ( args_span, message) ;
23742378 }
23752379 }
23762380
23772381 // Add a span label to the use of the captured variable, if it exists.
2378- pub ( super ) fn var_span_label ( self , err : & mut DiagnosticBuilder , message : impl Into < String > ) {
2382+ pub ( super ) fn var_span_label (
2383+ self ,
2384+ err : & mut DiagnosticBuilder < ' _ > ,
2385+ message : impl Into < String > ,
2386+ ) {
23792387 if let UseSpans :: ClosureUse { var_span, .. } = self {
23802388 err. span_label ( var_span, message) ;
23812389 }
@@ -2563,7 +2571,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
25632571
25642572 /// Helper to retrieve span(s) of given borrow from the current MIR
25652573 /// representation
2566- pub ( super ) fn retrieve_borrow_spans ( & self , borrow : & BorrowData ) -> UseSpans {
2574+ pub ( super ) fn retrieve_borrow_spans ( & self , borrow : & BorrowData < ' _ > ) -> UseSpans {
25672575 let span = self . mir . source_info ( borrow. reserve_location ) . span ;
25682576 self . borrow_spans ( span, borrow. reserve_location )
25692577 }
0 commit comments