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