@@ -228,7 +228,7 @@ enum ImplTraitContext<'b, 'a> {
228
228
ReturnPositionOpaqueTy {
229
229
/// `DefId` for the parent function, used to look up necessary
230
230
/// information later.
231
- fn_def_id : DefId ,
231
+ fn_def_id : LocalDefId ,
232
232
/// Origin: Either OpaqueTyOrigin::FnReturn or OpaqueTyOrigin::AsyncFn,
233
233
origin : hir:: OpaqueTyOrigin ,
234
234
} ,
@@ -1376,7 +1376,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
1376
1376
fn lower_opaque_impl_trait (
1377
1377
& mut self ,
1378
1378
span : Span ,
1379
- fn_def_id : Option < DefId > ,
1379
+ fn_def_id : Option < LocalDefId > ,
1380
1380
origin : hir:: OpaqueTyOrigin ,
1381
1381
opaque_ty_node_id : NodeId ,
1382
1382
capturable_lifetimes : Option < & FxHashSet < hir:: LifetimeName > > ,
@@ -1448,7 +1448,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
1448
1448
span : lctx. lower_span ( span) ,
1449
1449
} ,
1450
1450
bounds : hir_bounds,
1451
- impl_trait_fn : fn_def_id,
1452
1451
origin,
1453
1452
} ;
1454
1453
@@ -1518,7 +1517,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
1518
1517
fn lower_fn_decl (
1519
1518
& mut self ,
1520
1519
decl : & FnDecl ,
1521
- mut in_band_ty_params : Option < ( DefId , & mut Vec < hir:: GenericParam < ' hir > > ) > ,
1520
+ mut in_band_ty_params : Option < ( LocalDefId , & mut Vec < hir:: GenericParam < ' hir > > ) > ,
1522
1521
impl_trait_return_allow : bool ,
1523
1522
make_ret_async : Option < NodeId > ,
1524
1523
) -> & ' hir hir:: FnDecl < ' hir > {
@@ -1576,7 +1575,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
1576
1575
Some ( ( def_id, _) ) if impl_trait_return_allow => {
1577
1576
ImplTraitContext :: ReturnPositionOpaqueTy {
1578
1577
fn_def_id : def_id,
1579
- origin : hir:: OpaqueTyOrigin :: FnReturn ,
1578
+ origin : hir:: OpaqueTyOrigin :: FnReturn ( def_id ) ,
1580
1579
}
1581
1580
}
1582
1581
_ => ImplTraitContext :: disallowed ( ) ,
@@ -1631,7 +1630,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
1631
1630
fn lower_async_fn_ret_ty (
1632
1631
& mut self ,
1633
1632
output : & FnRetTy ,
1634
- fn_def_id : DefId ,
1633
+ fn_def_id : LocalDefId ,
1635
1634
opaque_ty_node_id : NodeId ,
1636
1635
) -> hir:: FnRetTy < ' hir > {
1637
1636
debug ! (
@@ -1746,8 +1745,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
1746
1745
span : this. lower_span ( span) ,
1747
1746
} ,
1748
1747
bounds : arena_vec ! [ this; future_bound] ,
1749
- impl_trait_fn : Some ( fn_def_id) ,
1750
- origin : hir:: OpaqueTyOrigin :: AsyncFn ,
1748
+ origin : hir:: OpaqueTyOrigin :: AsyncFn ( fn_def_id) ,
1751
1749
} ;
1752
1750
1753
1751
trace ! ( "exist ty from async fn def id: {:#?}" , opaque_ty_def_id) ;
@@ -1793,7 +1791,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
1793
1791
fn lower_async_fn_output_type_to_future_bound (
1794
1792
& mut self ,
1795
1793
output : & FnRetTy ,
1796
- fn_def_id : DefId ,
1794
+ fn_def_id : LocalDefId ,
1797
1795
span : Span ,
1798
1796
) -> hir:: GenericBound < ' hir > {
1799
1797
// Compute the `T` in `Future<Output = T>` from the return type.
@@ -1804,7 +1802,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
1804
1802
// generates.
1805
1803
let context = ImplTraitContext :: ReturnPositionOpaqueTy {
1806
1804
fn_def_id,
1807
- origin : hir:: OpaqueTyOrigin :: FnReturn ,
1805
+ origin : hir:: OpaqueTyOrigin :: FnReturn ( fn_def_id ) ,
1808
1806
} ;
1809
1807
self . lower_ty ( ty, context)
1810
1808
}
@@ -2440,17 +2438,12 @@ impl<'hir> GenericArgsCtor<'hir> {
2440
2438
}
2441
2439
}
2442
2440
2441
+ #[ tracing:: instrument( level = "debug" ) ]
2443
2442
fn lifetimes_from_impl_trait_bounds (
2444
2443
opaque_ty_id : NodeId ,
2445
2444
bounds : hir:: GenericBounds < ' _ > ,
2446
2445
lifetimes_to_include : Option < & FxHashSet < hir:: LifetimeName > > ,
2447
2446
) -> Vec < ( hir:: LifetimeName , Span ) > {
2448
- debug ! (
2449
- "lifetimes_from_impl_trait_bounds(opaque_ty_id={:?}, \
2450
- bounds={:#?})",
2451
- opaque_ty_id, bounds,
2452
- ) ;
2453
-
2454
2447
// This visitor walks over `impl Trait` bounds and creates defs for all lifetimes that
2455
2448
// appear in the bounds, excluding lifetimes that are created within the bounds.
2456
2449
// E.g., `'a`, `'b`, but not `'c` in `impl for<'c> SomeTrait<'a, 'b, 'c>`.
0 commit comments