@@ -228,7 +228,7 @@ enum ImplTraitContext<'b, 'a> {
228228 ReturnPositionOpaqueTy {
229229 /// `DefId` for the parent function, used to look up necessary
230230 /// information later.
231- fn_def_id : DefId ,
231+ fn_def_id : LocalDefId ,
232232 /// Origin: Either OpaqueTyOrigin::FnReturn or OpaqueTyOrigin::AsyncFn,
233233 origin : hir:: OpaqueTyOrigin ,
234234 } ,
@@ -1376,7 +1376,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
13761376 fn lower_opaque_impl_trait (
13771377 & mut self ,
13781378 span : Span ,
1379- fn_def_id : Option < DefId > ,
1379+ fn_def_id : Option < LocalDefId > ,
13801380 origin : hir:: OpaqueTyOrigin ,
13811381 opaque_ty_node_id : NodeId ,
13821382 capturable_lifetimes : Option < & FxHashSet < hir:: LifetimeName > > ,
@@ -1448,7 +1448,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
14481448 span : lctx. lower_span ( span) ,
14491449 } ,
14501450 bounds : hir_bounds,
1451- impl_trait_fn : fn_def_id,
14521451 origin,
14531452 } ;
14541453
@@ -1518,7 +1517,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
15181517 fn lower_fn_decl (
15191518 & mut self ,
15201519 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 > > ) > ,
15221521 impl_trait_return_allow : bool ,
15231522 make_ret_async : Option < NodeId > ,
15241523 ) -> & ' hir hir:: FnDecl < ' hir > {
@@ -1576,7 +1575,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
15761575 Some ( ( def_id, _) ) if impl_trait_return_allow => {
15771576 ImplTraitContext :: ReturnPositionOpaqueTy {
15781577 fn_def_id : def_id,
1579- origin : hir:: OpaqueTyOrigin :: FnReturn ,
1578+ origin : hir:: OpaqueTyOrigin :: FnReturn ( def_id ) ,
15801579 }
15811580 }
15821581 _ => ImplTraitContext :: disallowed ( ) ,
@@ -1631,7 +1630,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
16311630 fn lower_async_fn_ret_ty (
16321631 & mut self ,
16331632 output : & FnRetTy ,
1634- fn_def_id : DefId ,
1633+ fn_def_id : LocalDefId ,
16351634 opaque_ty_node_id : NodeId ,
16361635 ) -> hir:: FnRetTy < ' hir > {
16371636 debug ! (
@@ -1746,8 +1745,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
17461745 span : this. lower_span ( span) ,
17471746 } ,
17481747 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) ,
17511749 } ;
17521750
17531751 trace ! ( "exist ty from async fn def id: {:#?}" , opaque_ty_def_id) ;
@@ -1793,7 +1791,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
17931791 fn lower_async_fn_output_type_to_future_bound (
17941792 & mut self ,
17951793 output : & FnRetTy ,
1796- fn_def_id : DefId ,
1794+ fn_def_id : LocalDefId ,
17971795 span : Span ,
17981796 ) -> hir:: GenericBound < ' hir > {
17991797 // Compute the `T` in `Future<Output = T>` from the return type.
@@ -1804,7 +1802,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
18041802 // generates.
18051803 let context = ImplTraitContext :: ReturnPositionOpaqueTy {
18061804 fn_def_id,
1807- origin : hir:: OpaqueTyOrigin :: FnReturn ,
1805+ origin : hir:: OpaqueTyOrigin :: FnReturn ( fn_def_id ) ,
18081806 } ;
18091807 self . lower_ty ( ty, context)
18101808 }
@@ -2440,17 +2438,12 @@ impl<'hir> GenericArgsCtor<'hir> {
24402438 }
24412439}
24422440
2441+ #[ tracing:: instrument( level = "debug" ) ]
24432442fn lifetimes_from_impl_trait_bounds (
24442443 opaque_ty_id : NodeId ,
24452444 bounds : hir:: GenericBounds < ' _ > ,
24462445 lifetimes_to_include : Option < & FxHashSet < hir:: LifetimeName > > ,
24472446) -> Vec < ( hir:: LifetimeName , Span ) > {
2448- debug ! (
2449- "lifetimes_from_impl_trait_bounds(opaque_ty_id={:?}, \
2450- bounds={:#?})",
2451- opaque_ty_id, bounds,
2452- ) ;
2453-
24542447 // This visitor walks over `impl Trait` bounds and creates defs for all lifetimes that
24552448 // appear in the bounds, excluding lifetimes that are created within the bounds.
24562449 // E.g., `'a`, `'b`, but not `'c` in `impl for<'c> SomeTrait<'a, 'b, 'c>`.
0 commit comments