@@ -131,22 +131,17 @@ impl<'a, 'b> visit::Visitor<'a> for DefCollector<'a, 'b> {
131
131
132
132
fn visit_fn ( & mut self , fn_kind : FnKind < ' a > , span : Span , _: NodeId ) {
133
133
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 {
135
135
self . visit_generics ( generics) ;
136
136
137
- let return_impl_trait_id =
138
- self . create_def ( return_impl_trait_id, DefPathData :: ImplTrait , span) ;
139
-
140
137
// For async functions, we need to create their inner defs inside of a
141
138
// closure to match their desugared representation. Besides that,
142
139
// we must mirror everything that `visit::walk_fn` below does.
143
140
self . visit_fn_header ( & sig. header ) ;
144
141
for param in & sig. decl . inputs {
145
142
self . visit_param ( param) ;
146
143
}
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 ) ;
150
145
// If this async fn has no body (i.e. it's an async fn signature in a trait)
151
146
// then the closure_def will never be used, and we should avoid generating a
152
147
// def-id for it.
0 commit comments