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