@@ -122,7 +122,7 @@ pub trait AstConv<'tcx> {
122
122
& self ,
123
123
span : Span ,
124
124
item_def_id : DefId ,
125
- item_segment : & hir:: PathSegment < ' _ > ,
125
+ item_segment : & hir:: PathSegment < ' tcx > ,
126
126
poly_trait_ref : ty:: PolyTraitRef < ' tcx > ,
127
127
) -> Ty < ' tcx > ;
128
128
@@ -156,14 +156,14 @@ struct ConvertedBinding<'a, 'tcx> {
156
156
hir_id : hir:: HirId ,
157
157
item_name : Ident ,
158
158
kind : ConvertedBindingKind < ' a , ' tcx > ,
159
- gen_args : & ' a GenericArgs < ' a > ,
159
+ gen_args : & ' tcx GenericArgs < ' tcx > ,
160
160
span : Span ,
161
161
}
162
162
163
163
#[ derive( Debug ) ]
164
164
enum ConvertedBindingKind < ' a , ' tcx > {
165
165
Equality ( Spanned < ty:: Term < ' tcx > > ) ,
166
- Constraint ( & ' a [ hir:: GenericBound < ' a > ] ) ,
166
+ Constraint ( & ' a [ hir:: GenericBound < ' tcx > ] ) ,
167
167
}
168
168
169
169
/// New-typed boolean indicating whether explicit late-bound lifetimes
@@ -215,12 +215,12 @@ pub struct GenericArgCountResult {
215
215
}
216
216
217
217
pub 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 ) ;
219
219
220
220
fn provided_kind (
221
221
& mut self ,
222
222
param : & ty:: GenericParamDef ,
223
- arg : & GenericArg < ' _ > ,
223
+ arg : & GenericArg < ' tcx > ,
224
224
) -> ty:: GenericArg < ' tcx > ;
225
225
226
226
fn inferred_kind (
@@ -294,7 +294,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
294
294
& self ,
295
295
span : Span ,
296
296
def_id : DefId ,
297
- item_segment : & hir:: PathSegment < ' _ > ,
297
+ item_segment : & hir:: PathSegment < ' tcx > ,
298
298
) -> GenericArgsRef < ' tcx > {
299
299
let ( args, _) = self . create_args_for_ast_path (
300
300
span,
@@ -351,7 +351,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
351
351
def_id : DefId ,
352
352
parent_args : & [ ty:: GenericArg < ' tcx > ] ,
353
353
seg : & hir:: PathSegment < ' _ > ,
354
- generic_args : & ' a hir:: GenericArgs < ' _ > ,
354
+ generic_args : & ' a hir:: GenericArgs < ' tcx > ,
355
355
infer_args : bool ,
356
356
self_ty : Option < Ty < ' tcx > > ,
357
357
constness : ty:: BoundConstness ,
@@ -406,14 +406,14 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
406
406
struct SubstsForAstPathCtxt < ' a , ' tcx > {
407
407
astconv : & ' a ( dyn AstConv < ' tcx > + ' a ) ,
408
408
def_id : DefId ,
409
- generic_args : & ' a GenericArgs < ' a > ,
409
+ generic_args : & ' a GenericArgs < ' tcx > ,
410
410
span : Span ,
411
411
inferred_params : Vec < Span > ,
412
412
infer_args : bool ,
413
413
}
414
414
415
415
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 ) {
417
417
if did == self . def_id {
418
418
( Some ( self . generic_args ) , self . infer_args )
419
419
} else {
@@ -425,11 +425,11 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
425
425
fn provided_kind (
426
426
& mut self ,
427
427
param : & ty:: GenericParamDef ,
428
- arg : & GenericArg < ' _ > ,
428
+ arg : & GenericArg < ' tcx > ,
429
429
) -> ty:: GenericArg < ' tcx > {
430
430
let tcx = self . astconv . tcx ( ) ;
431
431
432
- let mut handle_ty_args = |has_default, ty : & hir:: Ty < ' _ > | {
432
+ let mut handle_ty_args = |has_default, ty : & hir:: Ty < ' tcx > | {
433
433
if has_default {
434
434
tcx. check_optional_stability (
435
435
param. def_id ,
@@ -592,7 +592,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
592
592
593
593
fn create_assoc_bindings_for_generic_args < ' a > (
594
594
& self ,
595
- generic_args : & ' a hir:: GenericArgs < ' _ > ,
595
+ generic_args : & ' a hir:: GenericArgs < ' tcx > ,
596
596
) -> Vec < ConvertedBinding < ' a , ' tcx > > {
597
597
// Convert associated-type bindings or constraints into a separate vector.
598
598
// Example: Given this:
@@ -640,7 +640,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
640
640
& self ,
641
641
span : Span ,
642
642
item_def_id : DefId ,
643
- item_segment : & hir:: PathSegment < ' _ > ,
643
+ item_segment : & hir:: PathSegment < ' tcx > ,
644
644
parent_args : GenericArgsRef < ' tcx > ,
645
645
) -> GenericArgsRef < ' tcx > {
646
646
debug ! (
@@ -673,7 +673,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
673
673
/// are disallowed. Otherwise, they are pushed onto the vector given.
674
674
pub fn instantiate_mono_trait_ref (
675
675
& self ,
676
- trait_ref : & hir:: TraitRef < ' _ > ,
676
+ trait_ref : & hir:: TraitRef < ' tcx > ,
677
677
self_ty : Ty < ' tcx > ,
678
678
) -> ty:: TraitRef < ' tcx > {
679
679
self . prohibit_generics ( trait_ref. path . segments . split_last ( ) . unwrap ( ) . 1 . iter ( ) , |_| { } ) ;
@@ -710,7 +710,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
710
710
#[ instrument( level = "debug" , skip( self , span, constness, bounds, speculative) ) ]
711
711
pub ( crate ) fn instantiate_poly_trait_ref (
712
712
& self ,
713
- trait_ref : & hir:: TraitRef < ' _ > ,
713
+ trait_ref : & hir:: TraitRef < ' tcx > ,
714
714
span : Span ,
715
715
constness : ty:: BoundConstness ,
716
716
polarity : ty:: ImplPolarity ,
@@ -788,7 +788,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
788
788
span : Span ,
789
789
trait_def_id : DefId ,
790
790
self_ty : Ty < ' tcx > ,
791
- trait_segment : & hir:: PathSegment < ' _ > ,
791
+ trait_segment : & hir:: PathSegment < ' tcx > ,
792
792
is_impl : bool ,
793
793
// FIXME(effects) move all host param things in astconv to hir lowering
794
794
constness : ty:: BoundConstness ,
@@ -813,7 +813,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
813
813
span : Span ,
814
814
trait_def_id : DefId ,
815
815
self_ty : Ty < ' tcx > ,
816
- trait_segment : & ' a hir:: PathSegment < ' a > ,
816
+ trait_segment : & ' a hir:: PathSegment < ' tcx > ,
817
817
is_impl : bool ,
818
818
constness : ty:: BoundConstness ,
819
819
) -> ( GenericArgsRef < ' tcx > , GenericArgCountResult ) {
@@ -847,7 +847,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
847
847
& self ,
848
848
span : Span ,
849
849
did : DefId ,
850
- item_segment : & hir:: PathSegment < ' _ > ,
850
+ item_segment : & hir:: PathSegment < ' tcx > ,
851
851
) -> Ty < ' tcx > {
852
852
let tcx = self . tcx ( ) ;
853
853
let args = self . ast_path_args_for_ty ( span, did, item_segment) ;
@@ -1153,7 +1153,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
1153
1153
span : Span ,
1154
1154
qself_ty : Ty < ' tcx > ,
1155
1155
qself : & hir:: Ty < ' _ > ,
1156
- assoc_segment : & hir:: PathSegment < ' _ > ,
1156
+ assoc_segment : & hir:: PathSegment < ' tcx > ,
1157
1157
permit_variants : bool ,
1158
1158
) -> Result < ( Ty < ' tcx > , DefKind , DefId ) , ErrorGuaranteed > {
1159
1159
let tcx = self . tcx ( ) ;
@@ -1428,7 +1428,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
1428
1428
fn lookup_inherent_assoc_ty (
1429
1429
& self ,
1430
1430
name : Ident ,
1431
- segment : & hir:: PathSegment < ' _ > ,
1431
+ segment : & hir:: PathSegment < ' tcx > ,
1432
1432
adt_did : DefId ,
1433
1433
self_ty : Ty < ' tcx > ,
1434
1434
block : hir:: HirId ,
@@ -1702,8 +1702,8 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
1702
1702
span : Span ,
1703
1703
opt_self_ty : Option < Ty < ' tcx > > ,
1704
1704
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 > ,
1707
1707
constness : ty:: BoundConstness ,
1708
1708
) -> Ty < ' tcx > {
1709
1709
let tcx = self . tcx ( ) ;
@@ -2021,7 +2021,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
2021
2021
pub fn res_to_ty (
2022
2022
& self ,
2023
2023
opt_self_ty : Option < Ty < ' tcx > > ,
2024
- path : & hir:: Path < ' _ > ,
2024
+ path : & hir:: Path < ' tcx > ,
2025
2025
hir_id : hir:: HirId ,
2026
2026
permit_variants : bool ,
2027
2027
) -> Ty < ' tcx > {
@@ -2311,13 +2311,13 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
2311
2311
2312
2312
/// Parses the programmer's textual representation of a type into our
2313
2313
/// 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 > {
2315
2315
self . ast_ty_to_ty_inner ( ast_ty, false , false )
2316
2316
}
2317
2317
2318
2318
/// Parses the programmer's textual representation of a type into our
2319
2319
/// 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 > {
2321
2321
self . ast_ty_to_ty_inner ( ast_ty, false , true )
2322
2322
}
2323
2323
@@ -2432,7 +2432,12 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
2432
2432
/// Turns a `hir::Ty` into a `Ty`. For diagnostics' purposes we keep track of whether trait
2433
2433
/// objects are borrowed like `&dyn Trait` to avoid emitting redundant errors.
2434
2434
#[ 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 > {
2436
2441
let tcx = self . tcx ( ) ;
2437
2442
2438
2443
let result_ty = match & ast_ty. kind {
@@ -2609,7 +2614,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
2609
2614
}
2610
2615
}
2611
2616
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 > {
2613
2618
match ty. kind {
2614
2619
hir:: TyKind :: Infer if expected_ty. is_some ( ) => {
2615
2620
self . record_ty ( ty. hir_id , expected_ty. unwrap ( ) , ty. span ) ;
@@ -2625,7 +2630,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
2625
2630
hir_id : hir:: HirId ,
2626
2631
unsafety : hir:: Unsafety ,
2627
2632
abi : abi:: Abi ,
2628
- decl : & hir:: FnDecl < ' _ > ,
2633
+ decl : & hir:: FnDecl < ' tcx > ,
2629
2634
generics : Option < & hir:: Generics < ' _ > > ,
2630
2635
hir_ty : Option < & hir:: Ty < ' _ > > ,
2631
2636
) -> ty:: PolyFnSig < ' tcx > {
0 commit comments