@@ -35,9 +35,9 @@ pub use self::UserIdentifiedItem::*;
35
35
pub use self :: PpSourceMode :: * ;
36
36
pub use self :: PpMode :: * ;
37
37
use self :: NodesMatchingUII :: * ;
38
- use abort_on_err;
38
+ use crate :: abort_on_err;
39
39
40
- use source_name;
40
+ use crate :: source_name;
41
41
42
42
#[ derive( Copy , Clone , PartialEq , Debug ) ]
43
43
pub enum PpSourceMode {
@@ -191,7 +191,7 @@ impl PpSourceMode {
191
191
tcx : TyCtxt < ' tcx , ' tcx , ' tcx > ,
192
192
f : F
193
193
) -> A
194
- where F : FnOnce ( & dyn HirPrinterSupport , & hir:: Crate ) -> A
194
+ where F : FnOnce ( & dyn HirPrinterSupport < ' _ > , & hir:: Crate ) -> A
195
195
{
196
196
match * self {
197
197
PpmNormal => {
@@ -296,7 +296,7 @@ impl<'hir> HirPrinterSupport<'hir> for NoAnn<'hir> {
296
296
297
297
impl < ' hir > pprust:: PpAnn for NoAnn < ' hir > { }
298
298
impl < ' hir > pprust_hir:: PpAnn for NoAnn < ' hir > {
299
- fn nested ( & self , state : & mut pprust_hir:: State , nested : pprust_hir:: Nested )
299
+ fn nested ( & self , state : & mut pprust_hir:: State < ' _ > , nested : pprust_hir:: Nested )
300
300
-> io:: Result < ( ) > {
301
301
if let Some ( tcx) = self . tcx {
302
302
pprust_hir:: PpAnn :: nested ( tcx. hir ( ) , state, nested)
@@ -322,13 +322,13 @@ impl<'hir> PrinterSupport for IdentifiedAnnotation<'hir> {
322
322
}
323
323
324
324
impl < ' hir > pprust:: PpAnn for IdentifiedAnnotation < ' hir > {
325
- fn pre ( & self , s : & mut pprust:: State , node : pprust:: AnnNode ) -> io:: Result < ( ) > {
325
+ fn pre ( & self , s : & mut pprust:: State < ' _ > , node : pprust:: AnnNode < ' _ > ) -> io:: Result < ( ) > {
326
326
match node {
327
327
pprust:: AnnNode :: Expr ( _) => s. popen ( ) ,
328
328
_ => Ok ( ( ) ) ,
329
329
}
330
330
}
331
- fn post ( & self , s : & mut pprust:: State , node : pprust:: AnnNode ) -> io:: Result < ( ) > {
331
+ fn post ( & self , s : & mut pprust:: State < ' _ > , node : pprust:: AnnNode < ' _ > ) -> io:: Result < ( ) > {
332
332
match node {
333
333
pprust:: AnnNode :: Ident ( _) |
334
334
pprust:: AnnNode :: Name ( _) => Ok ( ( ) ) ,
@@ -373,21 +373,21 @@ impl<'hir> HirPrinterSupport<'hir> for IdentifiedAnnotation<'hir> {
373
373
}
374
374
375
375
impl < ' hir > pprust_hir:: PpAnn for IdentifiedAnnotation < ' hir > {
376
- fn nested ( & self , state : & mut pprust_hir:: State , nested : pprust_hir:: Nested )
376
+ fn nested ( & self , state : & mut pprust_hir:: State < ' _ > , nested : pprust_hir:: Nested )
377
377
-> io:: Result < ( ) > {
378
378
if let Some ( ref tcx) = self . tcx {
379
379
pprust_hir:: PpAnn :: nested ( tcx. hir ( ) , state, nested)
380
380
} else {
381
381
Ok ( ( ) )
382
382
}
383
383
}
384
- fn pre ( & self , s : & mut pprust_hir:: State , node : pprust_hir:: AnnNode ) -> io:: Result < ( ) > {
384
+ fn pre ( & self , s : & mut pprust_hir:: State < ' _ > , node : pprust_hir:: AnnNode < ' _ > ) -> io:: Result < ( ) > {
385
385
match node {
386
386
pprust_hir:: AnnNode :: Expr ( _) => s. popen ( ) ,
387
387
_ => Ok ( ( ) ) ,
388
388
}
389
389
}
390
- fn post ( & self , s : & mut pprust_hir:: State , node : pprust_hir:: AnnNode ) -> io:: Result < ( ) > {
390
+ fn post ( & self , s : & mut pprust_hir:: State < ' _ > , node : pprust_hir:: AnnNode < ' _ > ) -> io:: Result < ( ) > {
391
391
match node {
392
392
pprust_hir:: AnnNode :: Name ( _) => Ok ( ( ) ) ,
393
393
pprust_hir:: AnnNode :: Item ( item) => {
@@ -434,7 +434,7 @@ impl<'a> PrinterSupport for HygieneAnnotation<'a> {
434
434
}
435
435
436
436
impl < ' a > pprust:: PpAnn for HygieneAnnotation < ' a > {
437
- fn post ( & self , s : & mut pprust:: State , node : pprust:: AnnNode ) -> io:: Result < ( ) > {
437
+ fn post ( & self , s : & mut pprust:: State < ' _ > , node : pprust:: AnnNode < ' _ > ) -> io:: Result < ( ) > {
438
438
match node {
439
439
pprust:: AnnNode :: Ident ( & ast:: Ident { name, span } ) => {
440
440
s. s . space ( ) ?;
@@ -476,7 +476,7 @@ impl<'b, 'tcx> HirPrinterSupport<'tcx> for TypedAnnotation<'b, 'tcx> {
476
476
}
477
477
478
478
impl < ' a , ' tcx > pprust_hir:: PpAnn for TypedAnnotation < ' a , ' tcx > {
479
- fn nested ( & self , state : & mut pprust_hir:: State , nested : pprust_hir:: Nested )
479
+ fn nested ( & self , state : & mut pprust_hir:: State < ' _ > , nested : pprust_hir:: Nested )
480
480
-> io:: Result < ( ) > {
481
481
let old_tables = self . tables . get ( ) ;
482
482
if let pprust_hir:: Nested :: Body ( id) = nested {
@@ -486,13 +486,13 @@ impl<'a, 'tcx> pprust_hir::PpAnn for TypedAnnotation<'a, 'tcx> {
486
486
self . tables . set ( old_tables) ;
487
487
Ok ( ( ) )
488
488
}
489
- fn pre ( & self , s : & mut pprust_hir:: State , node : pprust_hir:: AnnNode ) -> io:: Result < ( ) > {
489
+ fn pre ( & self , s : & mut pprust_hir:: State < ' _ > , node : pprust_hir:: AnnNode < ' _ > ) -> io:: Result < ( ) > {
490
490
match node {
491
491
pprust_hir:: AnnNode :: Expr ( _) => s. popen ( ) ,
492
492
_ => Ok ( ( ) ) ,
493
493
}
494
494
}
495
- fn post ( & self , s : & mut pprust_hir:: State , node : pprust_hir:: AnnNode ) -> io:: Result < ( ) > {
495
+ fn post ( & self , s : & mut pprust_hir:: State < ' _ > , node : pprust_hir:: AnnNode < ' _ > ) -> io:: Result < ( ) > {
496
496
match node {
497
497
pprust_hir:: AnnNode :: Expr ( expr) => {
498
498
s. s . space ( ) ?;
@@ -580,7 +580,11 @@ impl UserIdentifiedItem {
580
580
}
581
581
}
582
582
583
- fn to_one_node_id ( self , user_option : & str , sess : & Session , map : & hir_map:: Map ) -> ast:: NodeId {
583
+ fn to_one_node_id ( self ,
584
+ user_option : & str ,
585
+ sess : & Session ,
586
+ map : & hir_map:: Map < ' _ > )
587
+ -> ast:: NodeId {
584
588
let fail_because = |is_wrong_because| -> ast:: NodeId {
585
589
let message = format ! ( "{} needs NodeId (int) or unique path suffix (b::c::d); got \
586
590
{}, which {}",
0 commit comments