2
2
3
3
#![ allow( non_camel_case_types) ]
4
4
5
- pub use self :: LoanPathKind :: * ;
6
- pub use self :: LoanPathElem :: * ;
7
- pub use self :: bckerr_code:: * ;
8
- pub use self :: AliasableViolationKind :: * ;
9
- pub use self :: MovedValueUseKind :: * ;
5
+ pub use LoanPathKind :: * ;
6
+ pub use LoanPathElem :: * ;
7
+ pub use bckerr_code:: * ;
8
+ pub use AliasableViolationKind :: * ;
9
+ pub use MovedValueUseKind :: * ;
10
10
11
- use self :: InteriorKind :: * ;
11
+ use InteriorKind :: * ;
12
12
13
13
use rustc:: hir:: HirId ;
14
14
use rustc:: hir:: Node ;
@@ -37,10 +37,11 @@ use std::hash::{Hash, Hasher};
37
37
use syntax:: ast;
38
38
use syntax_pos:: { MultiSpan , Span } ;
39
39
use errors:: { Applicability , DiagnosticBuilder , DiagnosticId } ;
40
+ use log:: debug;
40
41
41
42
use rustc:: hir;
42
43
43
- use dataflow:: { DataFlowContext , BitwiseOperator , DataFlowOperator , KillFrom } ;
44
+ use crate :: dataflow:: { DataFlowContext , BitwiseOperator , DataFlowOperator , KillFrom } ;
44
45
45
46
pub mod check_loans;
46
47
@@ -61,7 +62,7 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
61
62
} ) ;
62
63
}
63
64
64
- pub fn provide ( providers : & mut Providers ) {
65
+ pub fn provide ( providers : & mut Providers < ' _ > ) {
65
66
* providers = Providers {
66
67
borrowck,
67
68
..* providers
@@ -398,7 +399,7 @@ pub enum LoanPathElem<'tcx> {
398
399
}
399
400
400
401
fn closure_to_block ( closure_id : LocalDefId ,
401
- tcx : TyCtxt ) -> ast:: NodeId {
402
+ tcx : TyCtxt < ' _ , ' _ , ' _ > ) -> ast:: NodeId {
402
403
let closure_id = tcx. hir ( ) . local_def_id_to_node_id ( closure_id) ;
403
404
match tcx. hir ( ) . get ( closure_id) {
404
405
Node :: Expr ( expr) => match expr. node {
@@ -1214,8 +1215,8 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
1214
1215
}
1215
1216
1216
1217
fn note_immutability_blame ( & self ,
1217
- db : & mut DiagnosticBuilder ,
1218
- blame : Option < ImmutabilityBlame > ,
1218
+ db : & mut DiagnosticBuilder < ' _ > ,
1219
+ blame : Option < ImmutabilityBlame < ' _ > > ,
1219
1220
error_node_id : ast:: NodeId ) {
1220
1221
match blame {
1221
1222
None => { }
@@ -1271,7 +1272,7 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
1271
1272
// binding: either to make the binding mutable (if its type is
1272
1273
// not a mutable reference) or to avoid borrowing altogether
1273
1274
fn note_immutable_local ( & self ,
1274
- db : & mut DiagnosticBuilder ,
1275
+ db : & mut DiagnosticBuilder < ' _ > ,
1275
1276
borrowed_node_id : ast:: NodeId ,
1276
1277
binding_node_id : ast:: NodeId ) {
1277
1278
let let_span = self . tcx . hir ( ) . span ( binding_node_id) ;
@@ -1349,7 +1350,7 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
1349
1350
}
1350
1351
}
1351
1352
1352
- fn note_and_explain_mutbl_error ( & self , db : & mut DiagnosticBuilder , err : & BckError < ' a , ' tcx > ,
1353
+ fn note_and_explain_mutbl_error ( & self , db : & mut DiagnosticBuilder < ' _ > , err : & BckError < ' a , ' tcx > ,
1353
1354
error_span : & Span ) {
1354
1355
match err. cmt . note {
1355
1356
mc:: NoteClosureEnv ( upvar_id) | mc:: NoteUpvarRef ( upvar_id) => {
@@ -1487,7 +1488,7 @@ impl DataFlowOperator for LoanDataFlowOperator {
1487
1488
}
1488
1489
1489
1490
impl < ' tcx > fmt:: Debug for InteriorKind {
1490
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1491
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1491
1492
match * self {
1492
1493
InteriorField ( mc:: FieldIndex ( _, info) ) => write ! ( f, "{}" , info) ,
1493
1494
InteriorElement => write ! ( f, "[]" ) ,
@@ -1496,7 +1497,7 @@ impl<'tcx> fmt::Debug for InteriorKind {
1496
1497
}
1497
1498
1498
1499
impl < ' tcx > fmt:: Debug for Loan < ' tcx > {
1499
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1500
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1500
1501
write ! ( f, "Loan_{}({:?}, {:?}, {:?}-{:?}, {:?})" ,
1501
1502
self . index,
1502
1503
self . loan_path,
@@ -1508,7 +1509,7 @@ impl<'tcx> fmt::Debug for Loan<'tcx> {
1508
1509
}
1509
1510
1510
1511
impl < ' tcx > fmt:: Debug for LoanPath < ' tcx > {
1511
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1512
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1512
1513
match self . kind {
1513
1514
LpVar ( id) => {
1514
1515
write ! ( f, "$({})" , ty:: tls:: with( |tcx| tcx. hir( ) . node_to_string( id) ) )
@@ -1543,7 +1544,7 @@ impl<'tcx> fmt::Debug for LoanPath<'tcx> {
1543
1544
}
1544
1545
1545
1546
impl < ' tcx > fmt:: Display for LoanPath < ' tcx > {
1546
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1547
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1547
1548
match self . kind {
1548
1549
LpVar ( id) => {
1549
1550
write ! ( f, "$({})" , ty:: tls:: with( |tcx| tcx. hir( ) . node_to_user_string( id) ) )
0 commit comments