@@ -106,7 +106,7 @@ pub trait AstConv<'tcx> {
106106 & self ,
107107 span : Span ,
108108 item_def_id : DefId ,
109- item_segment : & hir:: PathSegment < ' _ > ,
109+ item_segment : & hir:: PathSegment < ' tcx > ,
110110 poly_trait_ref : ty:: PolyTraitRef < ' tcx > ,
111111 ) -> Ty < ' tcx > ;
112112
@@ -140,14 +140,14 @@ struct ConvertedBinding<'a, 'tcx> {
140140 hir_id : hir:: HirId ,
141141 item_name : Ident ,
142142 kind : ConvertedBindingKind < ' a , ' tcx > ,
143- gen_args : & ' a GenericArgs < ' a > ,
143+ gen_args : & ' tcx GenericArgs < ' tcx > ,
144144 span : Span ,
145145}
146146
147147#[ derive( Debug ) ]
148148enum ConvertedBindingKind < ' a , ' tcx > {
149149 Equality ( ty:: Term < ' tcx > ) ,
150- Constraint ( & ' a [ hir:: GenericBound < ' a > ] ) ,
150+ Constraint ( & ' a [ hir:: GenericBound < ' tcx > ] ) ,
151151}
152152
153153/// New-typed boolean indicating whether explicit late-bound lifetimes
@@ -199,12 +199,12 @@ pub struct GenericArgCountResult {
199199}
200200
201201pub trait CreateSubstsForGenericArgsCtxt < ' a , ' tcx > {
202- fn args_for_def_id ( & mut self , def_id : DefId ) -> ( Option < & ' a GenericArgs < ' a > > , bool ) ;
202+ fn args_for_def_id ( & mut self , def_id : DefId ) -> ( Option < & ' a GenericArgs < ' tcx > > , bool ) ;
203203
204204 fn provided_kind (
205205 & mut self ,
206206 param : & ty:: GenericParamDef ,
207- arg : & GenericArg < ' _ > ,
207+ arg : & GenericArg < ' tcx > ,
208208 ) -> subst:: GenericArg < ' tcx > ;
209209
210210 fn inferred_kind (
@@ -279,7 +279,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
279279 & self ,
280280 span : Span ,
281281 def_id : DefId ,
282- item_segment : & hir:: PathSegment < ' _ > ,
282+ item_segment : & hir:: PathSegment < ' tcx > ,
283283 ) -> SubstsRef < ' tcx > {
284284 let ( substs, _) = self . create_substs_for_ast_path (
285285 span,
@@ -336,7 +336,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
336336 def_id : DefId ,
337337 parent_substs : & [ subst:: GenericArg < ' tcx > ] ,
338338 seg : & hir:: PathSegment < ' _ > ,
339- generic_args : & ' a hir:: GenericArgs < ' _ > ,
339+ generic_args : & ' a hir:: GenericArgs < ' tcx > ,
340340 infer_args : bool ,
341341 self_ty : Option < Ty < ' tcx > > ,
342342 constness : ty:: BoundConstness ,
@@ -385,14 +385,14 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
385385 struct SubstsForAstPathCtxt < ' a , ' tcx > {
386386 astconv : & ' a ( dyn AstConv < ' tcx > + ' a ) ,
387387 def_id : DefId ,
388- generic_args : & ' a GenericArgs < ' a > ,
388+ generic_args : & ' a GenericArgs < ' tcx > ,
389389 span : Span ,
390390 inferred_params : Vec < Span > ,
391391 infer_args : bool ,
392392 }
393393
394394 impl < ' a , ' tcx > CreateSubstsForGenericArgsCtxt < ' a , ' tcx > for SubstsForAstPathCtxt < ' a , ' tcx > {
395- fn args_for_def_id ( & mut self , did : DefId ) -> ( Option < & ' a GenericArgs < ' a > > , bool ) {
395+ fn args_for_def_id ( & mut self , did : DefId ) -> ( Option < & ' a GenericArgs < ' tcx > > , bool ) {
396396 if did == self . def_id {
397397 ( Some ( self . generic_args ) , self . infer_args )
398398 } else {
@@ -404,11 +404,11 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
404404 fn provided_kind (
405405 & mut self ,
406406 param : & ty:: GenericParamDef ,
407- arg : & GenericArg < ' _ > ,
407+ arg : & GenericArg < ' tcx > ,
408408 ) -> subst:: GenericArg < ' tcx > {
409409 let tcx = self . astconv . tcx ( ) ;
410410
411- let mut handle_ty_args = |has_default, ty : & hir:: Ty < ' _ > | {
411+ let mut handle_ty_args = |has_default, ty : & hir:: Ty < ' tcx > | {
412412 if has_default {
413413 tcx. check_optional_stability (
414414 param. def_id ,
@@ -556,7 +556,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
556556
557557 fn create_assoc_bindings_for_generic_args < ' a > (
558558 & self ,
559- generic_args : & ' a hir:: GenericArgs < ' _ > ,
559+ generic_args : & ' a hir:: GenericArgs < ' tcx > ,
560560 ) -> Vec < ConvertedBinding < ' a , ' tcx > > {
561561 // Convert associated-type bindings or constraints into a separate vector.
562562 // Example: Given this:
@@ -602,7 +602,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
602602 & self ,
603603 span : Span ,
604604 item_def_id : DefId ,
605- item_segment : & hir:: PathSegment < ' _ > ,
605+ item_segment : & hir:: PathSegment < ' tcx > ,
606606 parent_substs : SubstsRef < ' tcx > ,
607607 ) -> SubstsRef < ' tcx > {
608608 debug ! (
@@ -635,7 +635,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
635635 /// are disallowed. Otherwise, they are pushed onto the vector given.
636636 pub fn instantiate_mono_trait_ref (
637637 & self ,
638- trait_ref : & hir:: TraitRef < ' _ > ,
638+ trait_ref : & hir:: TraitRef < ' tcx > ,
639639 self_ty : Ty < ' tcx > ,
640640 constness : ty:: BoundConstness ,
641641 ) -> ty:: TraitRef < ' tcx > {
@@ -662,7 +662,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
662662 trait_ref_span : Span ,
663663 trait_def_id : DefId ,
664664 trait_segment : & hir:: PathSegment < ' _ > ,
665- args : & GenericArgs < ' _ > ,
665+ args : & GenericArgs < ' tcx > ,
666666 infer_args : bool ,
667667 self_ty : Ty < ' tcx > ,
668668 ) -> GenericArgCountResult {
@@ -730,7 +730,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
730730 #[ instrument( level = "debug" , skip( self , span, constness, bounds, speculative) ) ]
731731 pub ( crate ) fn instantiate_poly_trait_ref (
732732 & self ,
733- trait_ref : & hir:: TraitRef < ' _ > ,
733+ trait_ref : & hir:: TraitRef < ' tcx > ,
734734 span : Span ,
735735 constness : ty:: BoundConstness ,
736736 self_ty : Ty < ' tcx > ,
@@ -769,7 +769,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
769769 lang_item : hir:: LangItem ,
770770 span : Span ,
771771 hir_id : hir:: HirId ,
772- args : & GenericArgs < ' _ > ,
772+ args : & GenericArgs < ' tcx > ,
773773 self_ty : Ty < ' tcx > ,
774774 bounds : & mut Bounds < ' tcx > ,
775775 ) {
@@ -802,7 +802,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
802802 span : Span ,
803803 trait_def_id : DefId ,
804804 self_ty : Ty < ' tcx > ,
805- trait_segment : & hir:: PathSegment < ' _ > ,
805+ trait_segment : & hir:: PathSegment < ' tcx > ,
806806 is_impl : bool ,
807807 constness : ty:: BoundConstness ,
808808 ) -> ty:: TraitRef < ' tcx > {
@@ -826,7 +826,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
826826 span : Span ,
827827 trait_def_id : DefId ,
828828 self_ty : Ty < ' tcx > ,
829- trait_segment : & ' a hir:: PathSegment < ' a > ,
829+ trait_segment : & ' a hir:: PathSegment < ' tcx > ,
830830 is_impl : bool ,
831831 constness : ty:: BoundConstness ,
832832 ) -> ( SubstsRef < ' tcx > , GenericArgCountResult ) {
@@ -937,13 +937,15 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
937937 /// `param_ty` and `ast_bounds`. See `instantiate_poly_trait_ref`
938938 /// for more details.
939939 #[ instrument( level = "debug" , skip( self , ast_bounds, bounds) ) ]
940- pub ( crate ) fn add_bounds < ' hir , I : Iterator < Item = & ' hir hir:: GenericBound < ' hir > > > (
940+ pub ( crate ) fn add_bounds < ' hir , I : Iterator < Item = & ' hir hir:: GenericBound < ' tcx > > > (
941941 & self ,
942942 param_ty : Ty < ' tcx > ,
943943 ast_bounds : I ,
944944 bounds : & mut Bounds < ' tcx > ,
945945 bound_vars : & ' tcx ty:: List < ty:: BoundVariableKind > ,
946- ) {
946+ ) where
947+ ' tcx : ' hir ,
948+ {
947949 for ast_bound in ast_bounds {
948950 match ast_bound {
949951 hir:: GenericBound :: Trait ( poly_trait_ref, modifier) => {
@@ -1001,7 +1003,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
10011003 pub ( crate ) fn compute_bounds (
10021004 & self ,
10031005 param_ty : Ty < ' tcx > ,
1004- ast_bounds : & [ hir:: GenericBound < ' _ > ] ,
1006+ ast_bounds : & [ hir:: GenericBound < ' tcx > ] ,
10051007 ) -> Bounds < ' tcx > {
10061008 self . compute_bounds_inner ( param_ty, ast_bounds)
10071009 }
@@ -1011,7 +1013,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
10111013 pub ( crate ) fn compute_bounds_that_match_assoc_type (
10121014 & self ,
10131015 param_ty : Ty < ' tcx > ,
1014- ast_bounds : & [ hir:: GenericBound < ' _ > ] ,
1016+ ast_bounds : & [ hir:: GenericBound < ' tcx > ] ,
10151017 assoc_name : Ident ,
10161018 ) -> Bounds < ' tcx > {
10171019 let mut result = Vec :: new ( ) ;
@@ -1031,7 +1033,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
10311033 fn compute_bounds_inner (
10321034 & self ,
10331035 param_ty : Ty < ' tcx > ,
1034- ast_bounds : & [ hir:: GenericBound < ' _ > ] ,
1036+ ast_bounds : & [ hir:: GenericBound < ' tcx > ] ,
10351037 ) -> Bounds < ' tcx > {
10361038 let mut bounds = Bounds :: default ( ) ;
10371039
@@ -1269,7 +1271,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
12691271 & self ,
12701272 span : Span ,
12711273 did : DefId ,
1272- item_segment : & hir:: PathSegment < ' _ > ,
1274+ item_segment : & hir:: PathSegment < ' tcx > ,
12731275 ) -> Ty < ' tcx > {
12741276 let substs = self . ast_path_substs_for_ty ( span, did, item_segment) ;
12751277 self . tcx ( ) . at ( span) . bound_type_of ( did) . subst ( self . tcx ( ) , substs)
@@ -1278,7 +1280,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
12781280 fn conv_object_ty_poly_trait_ref (
12791281 & self ,
12801282 span : Span ,
1281- hir_trait_bounds : & [ hir:: PolyTraitRef < ' _ > ] ,
1283+ hir_trait_bounds : & [ hir:: PolyTraitRef < ' tcx > ] ,
12821284 lifetime : & hir:: Lifetime ,
12831285 borrowed : bool ,
12841286 representation : DynKind ,
@@ -1925,7 +1927,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
19251927 span : Span ,
19261928 qself_ty : Ty < ' tcx > ,
19271929 qself : & hir:: Ty < ' _ > ,
1928- assoc_segment : & hir:: PathSegment < ' _ > ,
1930+ assoc_segment : & hir:: PathSegment < ' tcx > ,
19291931 permit_variants : bool ,
19301932 ) -> Result < ( Ty < ' tcx > , DefKind , DefId ) , ErrorGuaranteed > {
19311933 let tcx = self . tcx ( ) ;
@@ -2286,8 +2288,8 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
22862288 span : Span ,
22872289 opt_self_ty : Option < Ty < ' tcx > > ,
22882290 item_def_id : DefId ,
2289- trait_segment : & hir:: PathSegment < ' _ > ,
2290- item_segment : & hir:: PathSegment < ' _ > ,
2291+ trait_segment : & hir:: PathSegment < ' tcx > ,
2292+ item_segment : & hir:: PathSegment < ' tcx > ,
22912293 constness : ty:: BoundConstness ,
22922294 ) -> Ty < ' tcx > {
22932295 let tcx = self . tcx ( ) ;
@@ -2604,7 +2606,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
26042606 pub fn res_to_ty (
26052607 & self ,
26062608 opt_self_ty : Option < Ty < ' tcx > > ,
2607- path : & hir:: Path < ' _ > ,
2609+ path : & hir:: Path < ' tcx > ,
26082610 permit_variants : bool ,
26092611 ) -> Ty < ' tcx > {
26102612 let tcx = self . tcx ( ) ;
@@ -2843,20 +2845,25 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
28432845
28442846 /// Parses the programmer's textual representation of a type into our
28452847 /// internal notion of a type.
2846- pub fn ast_ty_to_ty ( & self , ast_ty : & hir:: Ty < ' _ > ) -> Ty < ' tcx > {
2848+ pub fn ast_ty_to_ty ( & self , ast_ty : & hir:: Ty < ' tcx > ) -> Ty < ' tcx > {
28472849 self . ast_ty_to_ty_inner ( ast_ty, false , false )
28482850 }
28492851
28502852 /// Parses the programmer's textual representation of a type into our
28512853 /// internal notion of a type. This is meant to be used within a path.
2852- pub fn ast_ty_to_ty_in_path ( & self , ast_ty : & hir:: Ty < ' _ > ) -> Ty < ' tcx > {
2854+ pub fn ast_ty_to_ty_in_path ( & self , ast_ty : & hir:: Ty < ' tcx > ) -> Ty < ' tcx > {
28532855 self . ast_ty_to_ty_inner ( ast_ty, false , true )
28542856 }
28552857
28562858 /// Turns a `hir::Ty` into a `Ty`. For diagnostics' purposes we keep track of whether trait
28572859 /// objects are borrowed like `&dyn Trait` to avoid emitting redundant errors.
28582860 #[ instrument( level = "debug" , skip( self ) , ret) ]
2859- fn ast_ty_to_ty_inner ( & self , ast_ty : & hir:: Ty < ' _ > , borrowed : bool , in_path : bool ) -> Ty < ' tcx > {
2861+ fn ast_ty_to_ty_inner (
2862+ & self ,
2863+ ast_ty : & hir:: Ty < ' tcx > ,
2864+ borrowed : bool ,
2865+ in_path : bool ,
2866+ ) -> Ty < ' tcx > {
28602867 let tcx = self . tcx ( ) ;
28612868
28622869 let result_ty = match & ast_ty. kind {
@@ -3014,7 +3021,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
30143021 if in_trait { tcx. mk_projection ( def_id, substs) } else { tcx. mk_opaque ( def_id, substs) }
30153022 }
30163023
3017- pub fn ty_of_arg ( & self , ty : & hir:: Ty < ' _ > , expected_ty : Option < Ty < ' tcx > > ) -> Ty < ' tcx > {
3024+ pub fn ty_of_arg ( & self , ty : & hir:: Ty < ' tcx > , expected_ty : Option < Ty < ' tcx > > ) -> Ty < ' tcx > {
30183025 match ty. kind {
30193026 hir:: TyKind :: Infer if expected_ty. is_some ( ) => {
30203027 self . record_ty ( ty. hir_id , expected_ty. unwrap ( ) , ty. span ) ;
@@ -3030,7 +3037,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
30303037 hir_id : hir:: HirId ,
30313038 unsafety : hir:: Unsafety ,
30323039 abi : abi:: Abi ,
3033- decl : & hir:: FnDecl < ' _ > ,
3040+ decl : & hir:: FnDecl < ' tcx > ,
30343041 generics : Option < & hir:: Generics < ' _ > > ,
30353042 hir_ty : Option < & hir:: Ty < ' _ > > ,
30363043 ) -> ty:: PolyFnSig < ' tcx > {
0 commit comments