@@ -229,7 +229,7 @@ enum ImplTraitContext<'b, 'a> {
229229 ReturnPositionOpaqueTy {
230230 /// `DefId` for the parent function, used to look up necessary
231231 /// information later.
232- fn_def_id : DefId ,
232+ fn_def_id : LocalDefId ,
233233 /// Origin: Either OpaqueTyOrigin::FnReturn or OpaqueTyOrigin::AsyncFn,
234234 origin : hir:: OpaqueTyOrigin ,
235235 } ,
@@ -1378,7 +1378,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
13781378 fn lower_opaque_impl_trait (
13791379 & mut self ,
13801380 span : Span ,
1381- fn_def_id : Option < DefId > ,
1381+ fn_def_id : Option < LocalDefId > ,
13821382 origin : hir:: OpaqueTyOrigin ,
13831383 opaque_ty_node_id : NodeId ,
13841384 capturable_lifetimes : Option < & FxHashSet < hir:: LifetimeName > > ,
@@ -1450,7 +1450,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
14501450 span : lctx. lower_span ( span) ,
14511451 } ,
14521452 bounds : hir_bounds,
1453- impl_trait_fn : fn_def_id,
14541453 origin,
14551454 } ;
14561455
@@ -1520,7 +1519,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
15201519 fn lower_fn_decl (
15211520 & mut self ,
15221521 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 > > ) > ,
15241523 impl_trait_return_allow : bool ,
15251524 make_ret_async : Option < NodeId > ,
15261525 ) -> & ' hir hir:: FnDecl < ' hir > {
@@ -1578,7 +1577,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
15781577 Some ( ( def_id, _) ) if impl_trait_return_allow => {
15791578 ImplTraitContext :: ReturnPositionOpaqueTy {
15801579 fn_def_id : def_id,
1581- origin : hir:: OpaqueTyOrigin :: FnReturn ,
1580+ origin : hir:: OpaqueTyOrigin :: FnReturn ( def_id ) ,
15821581 }
15831582 }
15841583 _ => ImplTraitContext :: disallowed ( ) ,
@@ -1633,7 +1632,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
16331632 fn lower_async_fn_ret_ty (
16341633 & mut self ,
16351634 output : & FnRetTy ,
1636- fn_def_id : DefId ,
1635+ fn_def_id : LocalDefId ,
16371636 opaque_ty_node_id : NodeId ,
16381637 ) -> hir:: FnRetTy < ' hir > {
16391638 debug ! (
@@ -1748,8 +1747,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
17481747 span : this. lower_span ( span) ,
17491748 } ,
17501749 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) ,
17531751 } ;
17541752
17551753 trace ! ( "exist ty from async fn def id: {:#?}" , opaque_ty_def_id) ;
@@ -1795,7 +1793,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
17951793 fn lower_async_fn_output_type_to_future_bound (
17961794 & mut self ,
17971795 output : & FnRetTy ,
1798- fn_def_id : DefId ,
1796+ fn_def_id : LocalDefId ,
17991797 span : Span ,
18001798 ) -> hir:: GenericBound < ' hir > {
18011799 // Compute the `T` in `Future<Output = T>` from the return type.
@@ -1806,7 +1804,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
18061804 // generates.
18071805 let context = ImplTraitContext :: ReturnPositionOpaqueTy {
18081806 fn_def_id,
1809- origin : hir:: OpaqueTyOrigin :: FnReturn ,
1807+ origin : hir:: OpaqueTyOrigin :: FnReturn ( fn_def_id ) ,
18101808 } ;
18111809 self . lower_ty ( ty, context)
18121810 }
@@ -2443,17 +2441,12 @@ impl<'hir> GenericArgsCtor<'hir> {
24432441 }
24442442}
24452443
2444+ #[ tracing:: instrument( level = "debug" ) ]
24462445fn lifetimes_from_impl_trait_bounds (
24472446 opaque_ty_id : NodeId ,
24482447 bounds : hir:: GenericBounds < ' _ > ,
24492448 lifetimes_to_include : Option < & FxHashSet < hir:: LifetimeName > > ,
24502449) -> Vec < ( hir:: LifetimeName , Span ) > {
2451- debug ! (
2452- "lifetimes_from_impl_trait_bounds(opaque_ty_id={:?}, \
2453- bounds={:#?})",
2454- opaque_ty_id, bounds,
2455- ) ;
2456-
24572450 // This visitor walks over `impl Trait` bounds and creates defs for all lifetimes that
24582451 // appear in the bounds, excluding lifetimes that are created within the bounds.
24592452 // E.g., `'a`, `'b`, but not `'c` in `impl for<'c> SomeTrait<'a, 'b, 'c>`.
0 commit comments