@@ -1169,7 +1169,7 @@ impl<'a> LoweringContext<'a> {
1169
1169
lctx. lower_bounds ( bounds, itctx)
1170
1170
} ) ;
1171
1171
1172
- let ( lifetimes , lifetime_defs ) = self . lifetimes_from_impl_trait_bounds (
1172
+ let ( path_params , params ) = self . generics_from_impl_trait_bounds (
1173
1173
exist_ty_node_id,
1174
1174
exist_ty_def_index,
1175
1175
& hir_bounds,
@@ -1178,7 +1178,7 @@ impl<'a> LoweringContext<'a> {
1178
1178
self . with_hir_id_owner ( exist_ty_node_id, |lctx| {
1179
1179
let exist_ty_item_kind = hir:: ItemExistential ( hir:: ExistTy {
1180
1180
generics : hir:: Generics {
1181
- params : lifetime_defs ,
1181
+ params,
1182
1182
where_clause : hir:: WhereClause {
1183
1183
id : lctx. next_id ( ) . node_id ,
1184
1184
predicates : Vec :: new ( ) . into ( ) ,
@@ -1216,7 +1216,7 @@ impl<'a> LoweringContext<'a> {
1216
1216
id : exist_ty_id. node_id
1217
1217
} ,
1218
1218
DefId :: local ( exist_ty_def_index) ,
1219
- lifetimes,
1219
+ path_params . lifetimes ,
1220
1220
)
1221
1221
} )
1222
1222
}
@@ -1280,12 +1280,12 @@ impl<'a> LoweringContext<'a> {
1280
1280
} )
1281
1281
}
1282
1282
1283
- fn lifetimes_from_impl_trait_bounds (
1283
+ fn generics_from_impl_trait_bounds (
1284
1284
& mut self ,
1285
1285
exist_ty_id : NodeId ,
1286
1286
parent_index : DefIndex ,
1287
1287
bounds : & hir:: TyParamBounds ,
1288
- ) -> ( HirVec < hir:: Lifetime > , HirVec < hir:: GenericParam > ) {
1288
+ ) -> ( hir:: PathParameters , HirVec < hir:: GenericParam > ) {
1289
1289
// This visitor walks over impl trait bounds and creates defs for all lifetimes which
1290
1290
// appear in the bounds, excluding lifetimes that are created within the bounds.
1291
1291
// e.g. 'a, 'b, but not 'c in `impl for<'c> SomeTrait<'a, 'b, 'c>`
@@ -1297,7 +1297,7 @@ impl<'a> LoweringContext<'a> {
1297
1297
currently_bound_lifetimes : Vec < hir:: LifetimeName > ,
1298
1298
already_defined_lifetimes : HashSet < hir:: LifetimeName > ,
1299
1299
output_lifetimes : Vec < hir:: Lifetime > ,
1300
- output_lifetime_params : Vec < hir:: GenericParam > ,
1300
+ output_params : Vec < hir:: GenericParam > ,
1301
1301
}
1302
1302
1303
1303
impl < ' r , ' a : ' r , ' v > hir:: intravisit:: Visitor < ' v > for ImplTraitLifetimeCollector < ' r , ' a > {
@@ -1405,7 +1405,7 @@ impl<'a> LoweringContext<'a> {
1405
1405
span : lifetime. span ,
1406
1406
name,
1407
1407
} ;
1408
- self . output_lifetime_params
1408
+ self . output_params
1409
1409
. push ( hir:: GenericParam :: Lifetime ( hir:: LifetimeDef {
1410
1410
lifetime : def_lifetime,
1411
1411
bounds : Vec :: new ( ) . into ( ) ,
@@ -1424,16 +1424,21 @@ impl<'a> LoweringContext<'a> {
1424
1424
currently_bound_lifetimes : Vec :: new ( ) ,
1425
1425
already_defined_lifetimes : HashSet :: new ( ) ,
1426
1426
output_lifetimes : Vec :: new ( ) ,
1427
- output_lifetime_params : Vec :: new ( ) ,
1427
+ output_params : Vec :: new ( ) ,
1428
1428
} ;
1429
1429
1430
1430
for bound in bounds {
1431
1431
hir:: intravisit:: walk_ty_param_bound ( & mut lifetime_collector, & bound) ;
1432
1432
}
1433
1433
1434
1434
(
1435
- lifetime_collector. output_lifetimes . into ( ) ,
1436
- lifetime_collector. output_lifetime_params . into ( ) ,
1435
+ hir:: PathParameters {
1436
+ lifetimes : lifetime_collector. output_lifetimes . into ( ) ,
1437
+ types : HirVec :: new ( ) ,
1438
+ bindings : HirVec :: new ( ) ,
1439
+ parenthesized : false ,
1440
+ } ,
1441
+ lifetime_collector. output_params . into ( ) ,
1437
1442
)
1438
1443
}
1439
1444
0 commit comments