@@ -35,9 +35,9 @@ pub use self::UserIdentifiedItem::*;
3535pub use self :: PpSourceMode :: * ;
3636pub use self :: PpMode :: * ;
3737use self :: NodesMatchingUII :: * ;
38- use abort_on_err;
38+ use crate :: abort_on_err;
3939
40- use source_name;
40+ use crate :: source_name;
4141
4242#[ derive( Copy , Clone , PartialEq , Debug ) ]
4343pub enum PpSourceMode {
@@ -191,7 +191,7 @@ impl PpSourceMode {
191191 tcx : TyCtxt < ' tcx , ' tcx , ' tcx > ,
192192 f : F
193193 ) -> A
194- where F : FnOnce ( & dyn HirPrinterSupport , & hir:: Crate ) -> A
194+ where F : FnOnce ( & dyn HirPrinterSupport < ' _ > , & hir:: Crate ) -> A
195195 {
196196 match * self {
197197 PpmNormal => {
@@ -296,7 +296,7 @@ impl<'hir> HirPrinterSupport<'hir> for NoAnn<'hir> {
296296
297297impl < ' hir > pprust:: PpAnn for NoAnn < ' hir > { }
298298impl < ' 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 )
300300 -> io:: Result < ( ) > {
301301 if let Some ( tcx) = self . tcx {
302302 pprust_hir:: PpAnn :: nested ( tcx. hir ( ) , state, nested)
@@ -322,13 +322,13 @@ impl<'hir> PrinterSupport for IdentifiedAnnotation<'hir> {
322322}
323323
324324impl < ' 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 < ( ) > {
326326 match node {
327327 pprust:: AnnNode :: Expr ( _) => s. popen ( ) ,
328328 _ => Ok ( ( ) ) ,
329329 }
330330 }
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 < ( ) > {
332332 match node {
333333 pprust:: AnnNode :: Ident ( _) |
334334 pprust:: AnnNode :: Name ( _) => Ok ( ( ) ) ,
@@ -373,21 +373,21 @@ impl<'hir> HirPrinterSupport<'hir> for IdentifiedAnnotation<'hir> {
373373}
374374
375375impl < ' 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 )
377377 -> io:: Result < ( ) > {
378378 if let Some ( ref tcx) = self . tcx {
379379 pprust_hir:: PpAnn :: nested ( tcx. hir ( ) , state, nested)
380380 } else {
381381 Ok ( ( ) )
382382 }
383383 }
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 < ( ) > {
385385 match node {
386386 pprust_hir:: AnnNode :: Expr ( _) => s. popen ( ) ,
387387 _ => Ok ( ( ) ) ,
388388 }
389389 }
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 < ( ) > {
391391 match node {
392392 pprust_hir:: AnnNode :: Name ( _) => Ok ( ( ) ) ,
393393 pprust_hir:: AnnNode :: Item ( item) => {
@@ -434,7 +434,7 @@ impl<'a> PrinterSupport for HygieneAnnotation<'a> {
434434}
435435
436436impl < ' 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 < ( ) > {
438438 match node {
439439 pprust:: AnnNode :: Ident ( & ast:: Ident { name, span } ) => {
440440 s. s . space ( ) ?;
@@ -476,7 +476,7 @@ impl<'b, 'tcx> HirPrinterSupport<'tcx> for TypedAnnotation<'b, 'tcx> {
476476}
477477
478478impl < ' 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 )
480480 -> io:: Result < ( ) > {
481481 let old_tables = self . tables . get ( ) ;
482482 if let pprust_hir:: Nested :: Body ( id) = nested {
@@ -486,13 +486,13 @@ impl<'a, 'tcx> pprust_hir::PpAnn for TypedAnnotation<'a, 'tcx> {
486486 self . tables . set ( old_tables) ;
487487 Ok ( ( ) )
488488 }
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 < ( ) > {
490490 match node {
491491 pprust_hir:: AnnNode :: Expr ( _) => s. popen ( ) ,
492492 _ => Ok ( ( ) ) ,
493493 }
494494 }
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 < ( ) > {
496496 match node {
497497 pprust_hir:: AnnNode :: Expr ( expr) => {
498498 s. s . space ( ) ?;
@@ -580,7 +580,11 @@ impl UserIdentifiedItem {
580580 }
581581 }
582582
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 {
584588 let fail_because = |is_wrong_because| -> ast:: NodeId {
585589 let message = format ! ( "{} needs NodeId (int) or unique path suffix (b::c::d); got \
586590 {}, which {}",
0 commit comments