@@ -122,7 +122,7 @@ pub trait AstConv<'tcx> {
122122 & self ,
123123 span : Span ,
124124 item_def_id : DefId ,
125- item_segment : & hir:: PathSegment < ' _ > ,
125+ item_segment : & hir:: PathSegment < ' tcx > ,
126126 poly_trait_ref : ty:: PolyTraitRef < ' tcx > ,
127127 ) -> Ty < ' tcx > ;
128128
@@ -156,14 +156,14 @@ struct ConvertedBinding<'a, 'tcx> {
156156 hir_id : hir:: HirId ,
157157 item_name : Ident ,
158158 kind : ConvertedBindingKind < ' a , ' tcx > ,
159- gen_args : & ' a GenericArgs < ' a > ,
159+ gen_args : & ' tcx GenericArgs < ' tcx > ,
160160 span : Span ,
161161}
162162
163163#[ derive( Debug ) ]
164164enum ConvertedBindingKind < ' a , ' tcx > {
165165 Equality ( Spanned < ty:: Term < ' tcx > > ) ,
166- Constraint ( & ' a [ hir:: GenericBound < ' a > ] ) ,
166+ Constraint ( & ' a [ hir:: GenericBound < ' tcx > ] ) ,
167167}
168168
169169/// New-typed boolean indicating whether explicit late-bound lifetimes
@@ -215,12 +215,12 @@ pub struct GenericArgCountResult {
215215}
216216
217217pub trait CreateSubstsForGenericArgsCtxt < ' a , ' tcx > {
218- fn args_for_def_id ( & mut self , def_id : DefId ) -> ( Option < & ' a GenericArgs < ' a > > , bool ) ;
218+ fn args_for_def_id ( & mut self , def_id : DefId ) -> ( Option < & ' a GenericArgs < ' tcx > > , bool ) ;
219219
220220 fn provided_kind (
221221 & mut self ,
222222 param : & ty:: GenericParamDef ,
223- arg : & GenericArg < ' _ > ,
223+ arg : & GenericArg < ' tcx > ,
224224 ) -> ty:: GenericArg < ' tcx > ;
225225
226226 fn inferred_kind (
@@ -294,7 +294,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
294294 & self ,
295295 span : Span ,
296296 def_id : DefId ,
297- item_segment : & hir:: PathSegment < ' _ > ,
297+ item_segment : & hir:: PathSegment < ' tcx > ,
298298 ) -> GenericArgsRef < ' tcx > {
299299 let ( args, _) = self . create_args_for_ast_path (
300300 span,
@@ -351,7 +351,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
351351 def_id : DefId ,
352352 parent_args : & [ ty:: GenericArg < ' tcx > ] ,
353353 seg : & hir:: PathSegment < ' _ > ,
354- generic_args : & ' a hir:: GenericArgs < ' _ > ,
354+ generic_args : & ' a hir:: GenericArgs < ' tcx > ,
355355 infer_args : bool ,
356356 self_ty : Option < Ty < ' tcx > > ,
357357 constness : ty:: BoundConstness ,
@@ -406,14 +406,14 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
406406 struct SubstsForAstPathCtxt < ' a , ' tcx > {
407407 astconv : & ' a ( dyn AstConv < ' tcx > + ' a ) ,
408408 def_id : DefId ,
409- generic_args : & ' a GenericArgs < ' a > ,
409+ generic_args : & ' a GenericArgs < ' tcx > ,
410410 span : Span ,
411411 inferred_params : Vec < Span > ,
412412 infer_args : bool ,
413413 }
414414
415415 impl < ' a , ' tcx > CreateSubstsForGenericArgsCtxt < ' a , ' tcx > for SubstsForAstPathCtxt < ' a , ' tcx > {
416- fn args_for_def_id ( & mut self , did : DefId ) -> ( Option < & ' a GenericArgs < ' a > > , bool ) {
416+ fn args_for_def_id ( & mut self , did : DefId ) -> ( Option < & ' a GenericArgs < ' tcx > > , bool ) {
417417 if did == self . def_id {
418418 ( Some ( self . generic_args ) , self . infer_args )
419419 } else {
@@ -425,11 +425,11 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
425425 fn provided_kind (
426426 & mut self ,
427427 param : & ty:: GenericParamDef ,
428- arg : & GenericArg < ' _ > ,
428+ arg : & GenericArg < ' tcx > ,
429429 ) -> ty:: GenericArg < ' tcx > {
430430 let tcx = self . astconv . tcx ( ) ;
431431
432- let mut handle_ty_args = |has_default, ty : & hir:: Ty < ' _ > | {
432+ let mut handle_ty_args = |has_default, ty : & hir:: Ty < ' tcx > | {
433433 if has_default {
434434 tcx. check_optional_stability (
435435 param. def_id ,
@@ -592,7 +592,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
592592
593593 fn create_assoc_bindings_for_generic_args < ' a > (
594594 & self ,
595- generic_args : & ' a hir:: GenericArgs < ' _ > ,
595+ generic_args : & ' a hir:: GenericArgs < ' tcx > ,
596596 ) -> Vec < ConvertedBinding < ' a , ' tcx > > {
597597 // Convert associated-type bindings or constraints into a separate vector.
598598 // Example: Given this:
@@ -640,7 +640,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
640640 & self ,
641641 span : Span ,
642642 item_def_id : DefId ,
643- item_segment : & hir:: PathSegment < ' _ > ,
643+ item_segment : & hir:: PathSegment < ' tcx > ,
644644 parent_args : GenericArgsRef < ' tcx > ,
645645 ) -> GenericArgsRef < ' tcx > {
646646 debug ! (
@@ -673,7 +673,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
673673 /// are disallowed. Otherwise, they are pushed onto the vector given.
674674 pub fn instantiate_mono_trait_ref (
675675 & self ,
676- trait_ref : & hir:: TraitRef < ' _ > ,
676+ trait_ref : & hir:: TraitRef < ' tcx > ,
677677 self_ty : Ty < ' tcx > ,
678678 ) -> ty:: TraitRef < ' tcx > {
679679 self . prohibit_generics ( trait_ref. path . segments . split_last ( ) . unwrap ( ) . 1 . iter ( ) , |_| { } ) ;
@@ -710,7 +710,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
710710 #[ instrument( level = "debug" , skip( self , span, constness, bounds, speculative) ) ]
711711 pub ( crate ) fn instantiate_poly_trait_ref (
712712 & self ,
713- trait_ref : & hir:: TraitRef < ' _ > ,
713+ trait_ref : & hir:: TraitRef < ' tcx > ,
714714 span : Span ,
715715 constness : ty:: BoundConstness ,
716716 polarity : ty:: ImplPolarity ,
@@ -788,7 +788,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
788788 span : Span ,
789789 trait_def_id : DefId ,
790790 self_ty : Ty < ' tcx > ,
791- trait_segment : & hir:: PathSegment < ' _ > ,
791+ trait_segment : & hir:: PathSegment < ' tcx > ,
792792 is_impl : bool ,
793793 // FIXME(effects) move all host param things in astconv to hir lowering
794794 constness : ty:: BoundConstness ,
@@ -813,7 +813,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
813813 span : Span ,
814814 trait_def_id : DefId ,
815815 self_ty : Ty < ' tcx > ,
816- trait_segment : & ' a hir:: PathSegment < ' a > ,
816+ trait_segment : & ' a hir:: PathSegment < ' tcx > ,
817817 is_impl : bool ,
818818 constness : ty:: BoundConstness ,
819819 ) -> ( GenericArgsRef < ' tcx > , GenericArgCountResult ) {
@@ -847,7 +847,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
847847 & self ,
848848 span : Span ,
849849 did : DefId ,
850- item_segment : & hir:: PathSegment < ' _ > ,
850+ item_segment : & hir:: PathSegment < ' tcx > ,
851851 ) -> Ty < ' tcx > {
852852 let tcx = self . tcx ( ) ;
853853 let args = self . ast_path_args_for_ty ( span, did, item_segment) ;
@@ -1153,7 +1153,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
11531153 span : Span ,
11541154 qself_ty : Ty < ' tcx > ,
11551155 qself : & hir:: Ty < ' _ > ,
1156- assoc_segment : & hir:: PathSegment < ' _ > ,
1156+ assoc_segment : & hir:: PathSegment < ' tcx > ,
11571157 permit_variants : bool ,
11581158 ) -> Result < ( Ty < ' tcx > , DefKind , DefId ) , ErrorGuaranteed > {
11591159 let tcx = self . tcx ( ) ;
@@ -1428,7 +1428,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
14281428 fn lookup_inherent_assoc_ty (
14291429 & self ,
14301430 name : Ident ,
1431- segment : & hir:: PathSegment < ' _ > ,
1431+ segment : & hir:: PathSegment < ' tcx > ,
14321432 adt_did : DefId ,
14331433 self_ty : Ty < ' tcx > ,
14341434 block : hir:: HirId ,
@@ -1702,8 +1702,8 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
17021702 span : Span ,
17031703 opt_self_ty : Option < Ty < ' tcx > > ,
17041704 item_def_id : DefId ,
1705- trait_segment : & hir:: PathSegment < ' _ > ,
1706- item_segment : & hir:: PathSegment < ' _ > ,
1705+ trait_segment : & hir:: PathSegment < ' tcx > ,
1706+ item_segment : & hir:: PathSegment < ' tcx > ,
17071707 constness : ty:: BoundConstness ,
17081708 ) -> Ty < ' tcx > {
17091709 let tcx = self . tcx ( ) ;
@@ -2021,7 +2021,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
20212021 pub fn res_to_ty (
20222022 & self ,
20232023 opt_self_ty : Option < Ty < ' tcx > > ,
2024- path : & hir:: Path < ' _ > ,
2024+ path : & hir:: Path < ' tcx > ,
20252025 hir_id : hir:: HirId ,
20262026 permit_variants : bool ,
20272027 ) -> Ty < ' tcx > {
@@ -2311,13 +2311,13 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
23112311
23122312 /// Parses the programmer's textual representation of a type into our
23132313 /// internal notion of a type.
2314- pub fn ast_ty_to_ty ( & self , ast_ty : & hir:: Ty < ' _ > ) -> Ty < ' tcx > {
2314+ pub fn ast_ty_to_ty ( & self , ast_ty : & hir:: Ty < ' tcx > ) -> Ty < ' tcx > {
23152315 self . ast_ty_to_ty_inner ( ast_ty, false , false )
23162316 }
23172317
23182318 /// Parses the programmer's textual representation of a type into our
23192319 /// internal notion of a type. This is meant to be used within a path.
2320- pub fn ast_ty_to_ty_in_path ( & self , ast_ty : & hir:: Ty < ' _ > ) -> Ty < ' tcx > {
2320+ pub fn ast_ty_to_ty_in_path ( & self , ast_ty : & hir:: Ty < ' tcx > ) -> Ty < ' tcx > {
23212321 self . ast_ty_to_ty_inner ( ast_ty, false , true )
23222322 }
23232323
@@ -2432,7 +2432,12 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
24322432 /// Turns a `hir::Ty` into a `Ty`. For diagnostics' purposes we keep track of whether trait
24332433 /// objects are borrowed like `&dyn Trait` to avoid emitting redundant errors.
24342434 #[ instrument( level = "debug" , skip( self ) , ret) ]
2435- fn ast_ty_to_ty_inner ( & self , ast_ty : & hir:: Ty < ' _ > , borrowed : bool , in_path : bool ) -> Ty < ' tcx > {
2435+ fn ast_ty_to_ty_inner (
2436+ & self ,
2437+ ast_ty : & hir:: Ty < ' tcx > ,
2438+ borrowed : bool ,
2439+ in_path : bool ,
2440+ ) -> Ty < ' tcx > {
24362441 let tcx = self . tcx ( ) ;
24372442
24382443 let result_ty = match & ast_ty. kind {
@@ -2609,7 +2614,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
26092614 }
26102615 }
26112616
2612- pub fn ty_of_arg ( & self , ty : & hir:: Ty < ' _ > , expected_ty : Option < Ty < ' tcx > > ) -> Ty < ' tcx > {
2617+ pub fn ty_of_arg ( & self , ty : & hir:: Ty < ' tcx > , expected_ty : Option < Ty < ' tcx > > ) -> Ty < ' tcx > {
26132618 match ty. kind {
26142619 hir:: TyKind :: Infer if expected_ty. is_some ( ) => {
26152620 self . record_ty ( ty. hir_id , expected_ty. unwrap ( ) , ty. span ) ;
@@ -2625,7 +2630,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
26252630 hir_id : hir:: HirId ,
26262631 unsafety : hir:: Unsafety ,
26272632 abi : abi:: Abi ,
2628- decl : & hir:: FnDecl < ' _ > ,
2633+ decl : & hir:: FnDecl < ' tcx > ,
26292634 generics : Option < & hir:: Generics < ' _ > > ,
26302635 hir_ty : Option < & hir:: Ty < ' _ > > ,
26312636 ) -> ty:: PolyFnSig < ' tcx > {
0 commit comments