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 ;
5
5
use rustc:: hir;
6
6
use rustc:: hir:: def_id:: DefId ;
7
7
use rustc:: middle:: region:: ScopeTree ;
@@ -22,10 +22,10 @@ use syntax_pos::Span;
22
22
use super :: borrow_set:: BorrowData ;
23
23
use super :: { Context , MirBorrowckCtxt } ;
24
24
use 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 } ;
29
29
30
30
#[ derive( Debug ) ]
31
31
struct MoveSite {
@@ -1726,7 +1726,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
1726
1726
}
1727
1727
1728
1728
/// 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 {
1730
1730
match * base {
1731
1731
Place :: Local ( local) => {
1732
1732
let local = & self . mir . local_decls [ local] ;
@@ -1751,7 +1751,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
1751
1751
}
1752
1752
1753
1753
/// 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 {
1755
1755
if ty. is_box ( ) {
1756
1756
// If the type is a box, the field is described from the boxed type
1757
1757
self . describe_field_from_ty ( & ty. boxed_ty ( ) , field)
@@ -1860,7 +1860,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
1860
1860
fn annotate_argument_and_return_for_borrow (
1861
1861
& self ,
1862
1862
borrow : & BorrowData < ' tcx > ,
1863
- ) -> Option < AnnotatedBorrowFnSignature > {
1863
+ ) -> Option < AnnotatedBorrowFnSignature < ' _ > > {
1864
1864
// Define a fallback for when we can't match a closure.
1865
1865
let fallback = || {
1866
1866
let is_closure = self . infcx . tcx . is_closure ( self . mir_def_id ) ;
@@ -2081,7 +2081,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
2081
2081
& self ,
2082
2082
did : DefId ,
2083
2083
sig : ty:: PolyFnSig < ' tcx > ,
2084
- ) -> Option < AnnotatedBorrowFnSignature > {
2084
+ ) -> Option < AnnotatedBorrowFnSignature < ' _ > > {
2085
2085
debug ! ( "annotate_fn_sig: did={:?} sig={:?}" , did, sig) ;
2086
2086
let is_closure = self . infcx . tcx . is_closure ( did) ;
2087
2087
let fn_node_id = self . infcx . tcx . hir ( ) . as_local_node_id ( did) ?;
@@ -2368,14 +2368,22 @@ impl UseSpans {
2368
2368
}
2369
2369
2370
2370
// 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
+ ) {
2372
2376
if let UseSpans :: ClosureUse { args_span, .. } = self {
2373
2377
err. span_label ( args_span, message) ;
2374
2378
}
2375
2379
}
2376
2380
2377
2381
// 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
+ ) {
2379
2387
if let UseSpans :: ClosureUse { var_span, .. } = self {
2380
2388
err. span_label ( var_span, message) ;
2381
2389
}
@@ -2563,7 +2571,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
2563
2571
2564
2572
/// Helper to retrieve span(s) of given borrow from the current MIR
2565
2573
/// representation
2566
- pub ( super ) fn retrieve_borrow_spans ( & self , borrow : & BorrowData ) -> UseSpans {
2574
+ pub ( super ) fn retrieve_borrow_spans ( & self , borrow : & BorrowData < ' _ > ) -> UseSpans {
2567
2575
let span = self . mir . source_info ( borrow. reserve_location ) . span ;
2568
2576
self . borrow_spans ( span, borrow. reserve_location )
2569
2577
}
0 commit comments