22
33#![ allow( non_camel_case_types) ]
44
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 :: * ;
1010
11- use self :: InteriorKind :: * ;
11+ use InteriorKind :: * ;
1212
1313use rustc:: hir:: HirId ;
1414use rustc:: hir:: Node ;
@@ -37,10 +37,11 @@ use std::hash::{Hash, Hasher};
3737use syntax:: ast;
3838use syntax_pos:: { MultiSpan , Span } ;
3939use errors:: { Applicability , DiagnosticBuilder , DiagnosticId } ;
40+ use log:: debug;
4041
4142use rustc:: hir;
4243
43- use dataflow:: { DataFlowContext , BitwiseOperator , DataFlowOperator , KillFrom } ;
44+ use crate :: dataflow:: { DataFlowContext , BitwiseOperator , DataFlowOperator , KillFrom } ;
4445
4546pub mod check_loans;
4647
@@ -61,7 +62,7 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
6162 } ) ;
6263}
6364
64- pub fn provide ( providers : & mut Providers ) {
65+ pub fn provide ( providers : & mut Providers < ' _ > ) {
6566 * providers = Providers {
6667 borrowck,
6768 ..* providers
@@ -398,7 +399,7 @@ pub enum LoanPathElem<'tcx> {
398399}
399400
400401fn closure_to_block ( closure_id : LocalDefId ,
401- tcx : TyCtxt ) -> ast:: NodeId {
402+ tcx : TyCtxt < ' _ , ' _ , ' _ > ) -> ast:: NodeId {
402403 let closure_id = tcx. hir ( ) . local_def_id_to_node_id ( closure_id) ;
403404 match tcx. hir ( ) . get ( closure_id) {
404405 Node :: Expr ( expr) => match expr. node {
@@ -1214,8 +1215,8 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
12141215 }
12151216
12161217 fn note_immutability_blame ( & self ,
1217- db : & mut DiagnosticBuilder ,
1218- blame : Option < ImmutabilityBlame > ,
1218+ db : & mut DiagnosticBuilder < ' _ > ,
1219+ blame : Option < ImmutabilityBlame < ' _ > > ,
12191220 error_node_id : ast:: NodeId ) {
12201221 match blame {
12211222 None => { }
@@ -1271,7 +1272,7 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
12711272 // binding: either to make the binding mutable (if its type is
12721273 // not a mutable reference) or to avoid borrowing altogether
12731274 fn note_immutable_local ( & self ,
1274- db : & mut DiagnosticBuilder ,
1275+ db : & mut DiagnosticBuilder < ' _ > ,
12751276 borrowed_node_id : ast:: NodeId ,
12761277 binding_node_id : ast:: NodeId ) {
12771278 let let_span = self . tcx . hir ( ) . span ( binding_node_id) ;
@@ -1349,7 +1350,7 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
13491350 }
13501351 }
13511352
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 > ,
13531354 error_span : & Span ) {
13541355 match err. cmt . note {
13551356 mc:: NoteClosureEnv ( upvar_id) | mc:: NoteUpvarRef ( upvar_id) => {
@@ -1487,7 +1488,7 @@ impl DataFlowOperator for LoanDataFlowOperator {
14871488}
14881489
14891490impl < ' 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 {
14911492 match * self {
14921493 InteriorField ( mc:: FieldIndex ( _, info) ) => write ! ( f, "{}" , info) ,
14931494 InteriorElement => write ! ( f, "[]" ) ,
@@ -1496,7 +1497,7 @@ impl<'tcx> fmt::Debug for InteriorKind {
14961497}
14971498
14981499impl < ' 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 {
15001501 write ! ( f, "Loan_{}({:?}, {:?}, {:?}-{:?}, {:?})" ,
15011502 self . index,
15021503 self . loan_path,
@@ -1508,7 +1509,7 @@ impl<'tcx> fmt::Debug for Loan<'tcx> {
15081509}
15091510
15101511impl < ' 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 {
15121513 match self . kind {
15131514 LpVar ( id) => {
15141515 write ! ( f, "$({})" , ty:: tls:: with( |tcx| tcx. hir( ) . node_to_string( id) ) )
@@ -1543,7 +1544,7 @@ impl<'tcx> fmt::Debug for LoanPath<'tcx> {
15431544}
15441545
15451546impl < ' 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 {
15471548 match self . kind {
15481549 LpVar ( id) => {
15491550 write ! ( f, "$({})" , ty:: tls:: with( |tcx| tcx. hir( ) . node_to_user_string( id) ) )
0 commit comments