@@ -131,22 +131,17 @@ impl<'a, 'b> visit::Visitor<'a> for DefCollector<'a, 'b> {
131131
132132 fn visit_fn ( & mut self , fn_kind : FnKind < ' a > , span : Span , _: NodeId ) {
133133 if let FnKind :: Fn ( _, _, sig, _, generics, body) = fn_kind {
134- if let Async :: Yes { closure_id, return_impl_trait_id , .. } = sig. header . asyncness {
134+ if let Async :: Yes { closure_id, .. } = sig. header . asyncness {
135135 self . visit_generics ( generics) ;
136136
137- let return_impl_trait_id =
138- self . create_def ( return_impl_trait_id, DefPathData :: ImplTrait , span) ;
139-
140137 // For async functions, we need to create their inner defs inside of a
141138 // closure to match their desugared representation. Besides that,
142139 // we must mirror everything that `visit::walk_fn` below does.
143140 self . visit_fn_header ( & sig. header ) ;
144141 for param in & sig. decl . inputs {
145142 self . visit_param ( param) ;
146143 }
147- self . with_parent ( return_impl_trait_id, |this| {
148- this. visit_fn_ret_ty ( & sig. decl . output )
149- } ) ;
144+ self . visit_fn_ret_ty ( & sig. decl . output ) ;
150145 // If this async fn has no body (i.e. it's an async fn signature in a trait)
151146 // then the closure_def will never be used, and we should avoid generating a
152147 // def-id for it.
0 commit comments