@@ -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 } ,
@@ -1377,7 +1377,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
13771377 fn lower_opaque_impl_trait (
13781378 & mut self ,
13791379 span : Span ,
1380- fn_def_id : Option < DefId > ,
1380+ fn_def_id : Option < LocalDefId > ,
13811381 origin : hir:: OpaqueTyOrigin ,
13821382 opaque_ty_node_id : NodeId ,
13831383 capturable_lifetimes : Option < & FxHashSet < hir:: LifetimeName > > ,
@@ -1449,7 +1449,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
14491449 span : lctx. lower_span ( span) ,
14501450 } ,
14511451 bounds : hir_bounds,
1452- impl_trait_fn : fn_def_id,
14531452 origin,
14541453 } ;
14551454
@@ -1519,7 +1518,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
15191518 fn lower_fn_decl (
15201519 & mut self ,
15211520 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 > > ) > ,
15231522 impl_trait_return_allow : bool ,
15241523 make_ret_async : Option < NodeId > ,
15251524 ) -> & ' hir hir:: FnDecl < ' hir > {
@@ -1577,7 +1576,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
15771576 Some ( ( def_id, _) ) if impl_trait_return_allow => {
15781577 ImplTraitContext :: ReturnPositionOpaqueTy {
15791578 fn_def_id : def_id,
1580- origin : hir:: OpaqueTyOrigin :: FnReturn ,
1579+ origin : hir:: OpaqueTyOrigin :: FnReturn ( def_id ) ,
15811580 }
15821581 }
15831582 _ => ImplTraitContext :: disallowed ( ) ,
@@ -1632,7 +1631,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
16321631 fn lower_async_fn_ret_ty (
16331632 & mut self ,
16341633 output : & FnRetTy ,
1635- fn_def_id : DefId ,
1634+ fn_def_id : LocalDefId ,
16361635 opaque_ty_node_id : NodeId ,
16371636 ) -> hir:: FnRetTy < ' hir > {
16381637 debug ! (
@@ -1747,8 +1746,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
17471746 span : this. lower_span ( span) ,
17481747 } ,
17491748 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) ,
17521750 } ;
17531751
17541752 trace ! ( "exist ty from async fn def id: {:#?}" , opaque_ty_def_id) ;
@@ -1794,7 +1792,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
17941792 fn lower_async_fn_output_type_to_future_bound (
17951793 & mut self ,
17961794 output : & FnRetTy ,
1797- fn_def_id : DefId ,
1795+ fn_def_id : LocalDefId ,
17981796 span : Span ,
17991797 ) -> hir:: GenericBound < ' hir > {
18001798 // Compute the `T` in `Future<Output = T>` from the return type.
@@ -1805,7 +1803,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
18051803 // generates.
18061804 let context = ImplTraitContext :: ReturnPositionOpaqueTy {
18071805 fn_def_id,
1808- origin : hir:: OpaqueTyOrigin :: FnReturn ,
1806+ origin : hir:: OpaqueTyOrigin :: FnReturn ( fn_def_id ) ,
18091807 } ;
18101808 self . lower_ty ( ty, context)
18111809 }
@@ -2442,17 +2440,12 @@ impl<'hir> GenericArgsCtor<'hir> {
24422440 }
24432441}
24442442
2443+ #[ tracing:: instrument( level = "debug" ) ]
24452444fn lifetimes_from_impl_trait_bounds (
24462445 opaque_ty_id : NodeId ,
24472446 bounds : hir:: GenericBounds < ' _ > ,
24482447 lifetimes_to_include : Option < & FxHashSet < hir:: LifetimeName > > ,
24492448) -> Vec < ( hir:: LifetimeName , Span ) > {
2450- debug ! (
2451- "lifetimes_from_impl_trait_bounds(opaque_ty_id={:?}, \
2452- bounds={:#?})",
2453- opaque_ty_id, bounds,
2454- ) ;
2455-
24562449 // This visitor walks over `impl Trait` bounds and creates defs for all lifetimes that
24572450 // appear in the bounds, excluding lifetimes that are created within the bounds.
24582451 // E.g., `'a`, `'b`, but not `'c` in `impl for<'c> SomeTrait<'a, 'b, 'c>`.
0 commit comments