@@ -136,8 +136,6 @@ struct LoweringContext<'a, 'hir> {
136
136
/// to rebind the introduced lifetimes.
137
137
#[ derive( Debug ) ]
138
138
struct LifetimeCaptureContext {
139
- /// parent def_id for new definitions
140
- parent_def_id : LocalDefId ,
141
139
/// Set of lifetimes to rebind.
142
140
captures : FxHashMap <
143
141
LocalDefId , // original parameter id
@@ -1347,7 +1345,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
1347
1345
let lifetime_stash = std:: mem:: replace (
1348
1346
& mut lctx. captured_lifetimes ,
1349
1347
Some ( LifetimeCaptureContext {
1350
- parent_def_id : opaque_ty_def_id,
1351
1348
captures : std:: mem:: take ( & mut collected_lifetimes) ,
1352
1349
binders_to_ignore : Default :: default ( ) ,
1353
1350
} ) ,
@@ -1357,7 +1354,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
1357
1354
lifetime_collector:: lifetimes_in_bounds ( & lctx. resolver , bounds) ;
1358
1355
debug ! ( ?lifetimes_in_bounds) ;
1359
1356
1360
- lctx. create_and_capture_lifetime_defs ( & lifetimes_in_bounds) ;
1357
+ lctx. create_and_capture_lifetime_defs ( opaque_ty_def_id , & lifetimes_in_bounds) ;
1361
1358
1362
1359
let ret = lctx. lower_param_bounds ( bounds, itctx) ;
1363
1360
@@ -1446,7 +1443,11 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
1446
1443
hir:: OwnerNode :: Item ( self . arena . alloc ( opaque_ty_item) )
1447
1444
}
1448
1445
1449
- fn create_and_capture_lifetime_defs ( & mut self , lifetimes_in_bounds : & [ Lifetime ] ) {
1446
+ fn create_and_capture_lifetime_defs (
1447
+ & mut self ,
1448
+ parent_def_id : LocalDefId ,
1449
+ lifetimes_in_bounds : & [ Lifetime ] ,
1450
+ ) {
1450
1451
for lifetime in lifetimes_in_bounds {
1451
1452
let ident = lifetime. ident ;
1452
1453
let span = ident. span ;
@@ -1464,7 +1465,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
1464
1465
let name = ParamName :: Plain ( ident) ;
1465
1466
1466
1467
self . create_def (
1467
- captured_lifetimes . parent_def_id ,
1468
+ parent_def_id,
1468
1469
node_id,
1469
1470
DefPathData :: LifetimeNs ( name. ident ( ) . name ) ,
1470
1471
) ;
@@ -1485,7 +1486,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
1485
1486
let name = ParamName :: Fresh ;
1486
1487
1487
1488
self . create_def (
1488
- captured_lifetimes . parent_def_id ,
1489
+ parent_def_id,
1489
1490
node_id,
1490
1491
DefPathData :: LifetimeNs ( kw:: UnderscoreLifetime ) ,
1491
1492
) ;
@@ -1735,7 +1736,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
1735
1736
let lifetime_stash = std:: mem:: replace (
1736
1737
& mut this. captured_lifetimes ,
1737
1738
Some ( LifetimeCaptureContext {
1738
- parent_def_id : opaque_ty_def_id,
1739
1739
captures : std:: mem:: take ( & mut captures) ,
1740
1740
binders_to_ignore : Default :: default ( ) ,
1741
1741
} ) ,
@@ -1745,7 +1745,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
1745
1745
lifetime_collector:: lifetimes_in_ret_ty ( & this. resolver , output) ;
1746
1746
debug ! ( ?lifetimes_in_bounds) ;
1747
1747
1748
- this. create_and_capture_lifetime_defs ( & lifetimes_in_bounds) ;
1748
+ this. create_and_capture_lifetime_defs ( opaque_ty_def_id , & lifetimes_in_bounds) ;
1749
1749
1750
1750
// We have to be careful to get elision right here. The
1751
1751
// idea is that we create a lifetime parameter for each
0 commit comments