@@ -2022,7 +2022,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
20222022 } )
20232023 }
20242024
2025- fn lower_local ( & mut self , l : & Local ) -> ( hir:: Local , SmallVec < [ NodeId ; 1 ] > ) {
2025+ fn lower_local ( & mut self , l : & Local ) -> ( hir:: Local < ' hir > , SmallVec < [ NodeId ; 1 ] > ) {
20262026 let mut ids = SmallVec :: < [ NodeId ; 1 ] > :: new ( ) ;
20272027 if self . sess . features_untracked ( ) . impl_trait_in_bindings {
20282028 if let Some ( ref ty) = l. ty {
@@ -2586,7 +2586,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
25862586 bounds. iter ( ) . map ( |bound| self . lower_param_bound ( bound, itctx. reborrow ( ) ) ) . collect ( )
25872587 }
25882588
2589- fn lower_block ( & mut self , b : & Block , targeted_by_break : bool ) -> P < hir:: Block > {
2589+ fn lower_block ( & mut self , b : & Block , targeted_by_break : bool ) -> P < hir:: Block < ' hir > > {
25902590 let mut stmts = vec ! [ ] ;
25912591 let mut expr = None ;
25922592
@@ -2614,12 +2614,12 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
26142614
26152615 /// Lowers a block directly to an expression, presuming that it
26162616 /// has no attributes and is not targeted by a `break`.
2617- fn lower_block_expr ( & mut self , b : & Block ) -> hir:: Expr {
2617+ fn lower_block_expr ( & mut self , b : & Block ) -> hir:: Expr < ' hir > {
26182618 let block = self . lower_block ( b, false ) ;
26192619 self . expr_block ( block, AttrVec :: new ( ) )
26202620 }
26212621
2622- fn lower_pat ( & mut self , p : & Pat ) -> P < hir:: Pat > {
2622+ fn lower_pat ( & mut self , p : & Pat ) -> P < hir:: Pat < ' hir > > {
26232623 let node = match p. kind {
26242624 PatKind :: Wild => hir:: PatKind :: Wild ,
26252625 PatKind :: Ident ( ref binding_mode, ident, ref sub) => {
@@ -2700,7 +2700,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
27002700 & mut self ,
27012701 pats : & [ AstP < Pat > ] ,
27022702 ctx : & str ,
2703- ) -> ( HirVec < P < hir:: Pat > > , Option < usize > ) {
2703+ ) -> ( HirVec < P < hir:: Pat < ' hir > > > , Option < usize > ) {
27042704 let mut elems = Vec :: with_capacity ( pats. len ( ) ) ;
27052705 let mut rest = None ;
27062706
@@ -2737,7 +2737,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
27372737 /// When encountering `($binding_mode $ident @)? ..` (`slice`),
27382738 /// this is interpreted as a sub-slice pattern semantically.
27392739 /// Patterns that follow, which are not like `slice` -- or an error occurs, are in `after`.
2740- fn lower_pat_slice ( & mut self , pats : & [ AstP < Pat > ] ) -> hir:: PatKind {
2740+ fn lower_pat_slice ( & mut self , pats : & [ AstP < Pat > ] ) -> hir:: PatKind < ' hir > {
27412741 let mut before = Vec :: new ( ) ;
27422742 let mut after = Vec :: new ( ) ;
27432743 let mut slice = None ;
@@ -2796,8 +2796,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
27962796 p : & Pat ,
27972797 binding_mode : & BindingMode ,
27982798 ident : Ident ,
2799- lower_sub : impl FnOnce ( & mut Self ) -> Option < P < hir:: Pat > > ,
2800- ) -> hir:: PatKind {
2799+ lower_sub : impl FnOnce ( & mut Self ) -> Option < P < hir:: Pat < ' hir > > > ,
2800+ ) -> hir:: PatKind < ' hir > {
28012801 match self . resolver . get_partial_res ( p. id ) . map ( |d| d. base_res ( ) ) {
28022802 // `None` can occur in body-less function signatures
28032803 res @ None | res @ Some ( Res :: Local ( _) ) => {
@@ -2824,12 +2824,12 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
28242824 }
28252825 }
28262826
2827- fn pat_wild_with_node_id_of ( & mut self , p : & Pat ) -> P < hir:: Pat > {
2827+ fn pat_wild_with_node_id_of ( & mut self , p : & Pat ) -> P < hir:: Pat < ' hir > > {
28282828 self . pat_with_node_id_of ( p, hir:: PatKind :: Wild )
28292829 }
28302830
28312831 /// Construct a `Pat` with the `HirId` of `p.id` lowered.
2832- fn pat_with_node_id_of ( & mut self , p : & Pat , kind : hir:: PatKind ) -> P < hir:: Pat > {
2832+ fn pat_with_node_id_of ( & mut self , p : & Pat , kind : hir:: PatKind < ' hir > ) -> P < hir:: Pat < ' hir > > {
28332833 P ( hir:: Pat { hir_id : self . lower_node_id ( p. id ) , kind, span : p. span } )
28342834 }
28352835
@@ -2843,7 +2843,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
28432843 }
28442844
28452845 /// Used to ban the `..` pattern in places it shouldn't be semantically.
2846- fn ban_illegal_rest_pat ( & self , sp : Span ) -> hir:: PatKind {
2846+ fn ban_illegal_rest_pat ( & self , sp : Span ) -> hir:: PatKind < ' hir > {
28472847 self . diagnostic ( )
28482848 . struct_span_err ( sp, "`..` patterns are not allowed here" )
28492849 . note ( "only allowed in tuple, tuple struct, and slice patterns" )
@@ -2869,11 +2869,11 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
28692869 } )
28702870 }
28712871
2872- fn lower_stmt ( & mut self , s : & Stmt ) -> SmallVec < [ hir:: Stmt ; 1 ] > {
2872+ fn lower_stmt ( & mut self , s : & Stmt ) -> SmallVec < [ hir:: Stmt < ' hir > ; 1 ] > {
28732873 let kind = match s. kind {
28742874 StmtKind :: Local ( ref l) => {
28752875 let ( l, item_ids) = self . lower_local ( l) ;
2876- let mut ids: SmallVec < [ hir:: Stmt ; 1 ] > = item_ids
2876+ let mut ids: SmallVec < [ hir:: Stmt < ' hir > ; 1 ] > = item_ids
28772877 . into_iter ( )
28782878 . map ( |item_id| {
28792879 let item_id = hir:: ItemId { id : self . lower_node_id ( item_id) } ;
@@ -2944,36 +2944,36 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
29442944
29452945 // Helper methods for building HIR.
29462946
2947- fn stmt ( & mut self , span : Span , kind : hir:: StmtKind ) -> hir:: Stmt {
2947+ fn stmt ( & mut self , span : Span , kind : hir:: StmtKind < ' hir > ) -> hir:: Stmt < ' hir > {
29482948 hir:: Stmt { span, kind, hir_id : self . next_id ( ) }
29492949 }
29502950
2951- fn stmt_expr ( & mut self , span : Span , expr : hir:: Expr ) -> hir:: Stmt {
2951+ fn stmt_expr ( & mut self , span : Span , expr : hir:: Expr < ' hir > ) -> hir:: Stmt < ' hir > {
29522952 self . stmt ( span, hir:: StmtKind :: Expr ( P ( expr) ) )
29532953 }
29542954
29552955 fn stmt_let_pat (
29562956 & mut self ,
29572957 attrs : AttrVec ,
29582958 span : Span ,
2959- init : Option < P < hir:: Expr > > ,
2960- pat : P < hir:: Pat > ,
2959+ init : Option < P < hir:: Expr < ' hir > > > ,
2960+ pat : P < hir:: Pat < ' hir > > ,
29612961 source : hir:: LocalSource ,
2962- ) -> hir:: Stmt {
2962+ ) -> hir:: Stmt < ' hir > {
29632963 let local = hir:: Local { attrs, hir_id : self . next_id ( ) , init, pat, source, span, ty : None } ;
29642964 self . stmt ( span, hir:: StmtKind :: Local ( P ( local) ) )
29652965 }
29662966
2967- fn block_expr ( & mut self , expr : P < hir:: Expr > ) -> hir:: Block {
2967+ fn block_expr ( & mut self , expr : P < hir:: Expr < ' hir > > ) -> hir:: Block < ' hir > {
29682968 self . block_all ( expr. span , hir:: HirVec :: new ( ) , Some ( expr) )
29692969 }
29702970
29712971 fn block_all (
29722972 & mut self ,
29732973 span : Span ,
2974- stmts : hir:: HirVec < hir:: Stmt > ,
2975- expr : Option < P < hir:: Expr > > ,
2976- ) -> hir:: Block {
2974+ stmts : hir:: HirVec < hir:: Stmt < ' hir > > ,
2975+ expr : Option < P < hir:: Expr < ' hir > > > ,
2976+ ) -> hir:: Block < ' hir > {
29772977 hir:: Block {
29782978 stmts,
29792979 expr,
@@ -2985,33 +2985,33 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
29852985 }
29862986
29872987 /// Constructs a `true` or `false` literal pattern.
2988- fn pat_bool ( & mut self , span : Span , val : bool ) -> P < hir:: Pat > {
2988+ fn pat_bool ( & mut self , span : Span , val : bool ) -> P < hir:: Pat < ' hir > > {
29892989 let expr = self . expr_bool ( span, val) ;
29902990 self . pat ( span, hir:: PatKind :: Lit ( P ( expr) ) )
29912991 }
29922992
2993- fn pat_ok ( & mut self , span : Span , pat : P < hir:: Pat > ) -> P < hir:: Pat > {
2993+ fn pat_ok ( & mut self , span : Span , pat : P < hir:: Pat < ' hir > > ) -> P < hir:: Pat < ' hir > > {
29942994 self . pat_std_enum ( span, & [ sym:: result, sym:: Result , sym:: Ok ] , hir_vec ! [ pat] )
29952995 }
29962996
2997- fn pat_err ( & mut self , span : Span , pat : P < hir:: Pat > ) -> P < hir:: Pat > {
2997+ fn pat_err ( & mut self , span : Span , pat : P < hir:: Pat < ' hir > > ) -> P < hir:: Pat < ' hir > > {
29982998 self . pat_std_enum ( span, & [ sym:: result, sym:: Result , sym:: Err ] , hir_vec ! [ pat] )
29992999 }
30003000
3001- fn pat_some ( & mut self , span : Span , pat : P < hir:: Pat > ) -> P < hir:: Pat > {
3001+ fn pat_some ( & mut self , span : Span , pat : P < hir:: Pat < ' hir > > ) -> P < hir:: Pat < ' hir > > {
30023002 self . pat_std_enum ( span, & [ sym:: option, sym:: Option , sym:: Some ] , hir_vec ! [ pat] )
30033003 }
30043004
3005- fn pat_none ( & mut self , span : Span ) -> P < hir:: Pat > {
3005+ fn pat_none ( & mut self , span : Span ) -> P < hir:: Pat < ' hir > > {
30063006 self . pat_std_enum ( span, & [ sym:: option, sym:: Option , sym:: None ] , hir_vec ! [ ] )
30073007 }
30083008
30093009 fn pat_std_enum (
30103010 & mut self ,
30113011 span : Span ,
30123012 components : & [ Symbol ] ,
3013- subpats : hir:: HirVec < P < hir:: Pat > > ,
3014- ) -> P < hir:: Pat > {
3013+ subpats : hir:: HirVec < P < hir:: Pat < ' hir > > > ,
3014+ ) -> P < hir:: Pat < ' hir > > {
30153015 let path = self . std_path ( span, components, None , true ) ;
30163016 let qpath = hir:: QPath :: Resolved ( None , P ( path) ) ;
30173017 let pt = if subpats. is_empty ( ) {
@@ -3022,7 +3022,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
30223022 self . pat ( span, pt)
30233023 }
30243024
3025- fn pat_ident ( & mut self , span : Span , ident : Ident ) -> ( P < hir:: Pat > , hir:: HirId ) {
3025+ fn pat_ident ( & mut self , span : Span , ident : Ident ) -> ( P < hir:: Pat < ' hir > > , hir:: HirId ) {
30263026 self . pat_ident_binding_mode ( span, ident, hir:: BindingAnnotation :: Unannotated )
30273027 }
30283028
@@ -3031,7 +3031,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
30313031 span : Span ,
30323032 ident : Ident ,
30333033 bm : hir:: BindingAnnotation ,
3034- ) -> ( P < hir:: Pat > , hir:: HirId ) {
3034+ ) -> ( P < hir:: Pat < ' hir > > , hir:: HirId ) {
30353035 let hir_id = self . next_id ( ) ;
30363036
30373037 (
@@ -3044,11 +3044,11 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
30443044 )
30453045 }
30463046
3047- fn pat_wild ( & mut self , span : Span ) -> P < hir:: Pat > {
3047+ fn pat_wild ( & mut self , span : Span ) -> P < hir:: Pat < ' hir > > {
30483048 self . pat ( span, hir:: PatKind :: Wild )
30493049 }
30503050
3051- fn pat ( & mut self , span : Span , kind : hir:: PatKind ) -> P < hir:: Pat > {
3051+ fn pat ( & mut self , span : Span , kind : hir:: PatKind < ' hir > ) -> P < hir:: Pat < ' hir > > {
30523052 P ( hir:: Pat { hir_id : self . next_id ( ) , kind, span } )
30533053 }
30543054
0 commit comments