@@ -121,6 +121,19 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T>
121
121
self . with_lint_attrs ( e. id , & e. attrs , |cx| {
122
122
lint_callback ! ( cx, check_expr, e) ;
123
123
ast_visit:: walk_expr ( cx, e) ;
124
+
125
+ // Explicitly check for lints associated with 'closure_id', since
126
+ // it does not have a corresponding AST node
127
+ match e. kind {
128
+ ast:: ExprKind :: Closure ( box ast:: Closure {
129
+ coroutine_kind : Some ( coroutine_kind) ,
130
+ ..
131
+ } ) => {
132
+ cx. check_id ( coroutine_kind. closure_id ( ) ) ;
133
+ }
134
+ _ => { }
135
+ }
136
+ lint_callback ! ( cx, check_expr_post, e) ;
124
137
} )
125
138
}
126
139
@@ -215,21 +228,6 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T>
215
228
} )
216
229
}
217
230
218
- fn visit_expr_post ( & mut self , e : & ' a ast:: Expr ) {
219
- // Explicitly check for lints associated with 'closure_id', since
220
- // it does not have a corresponding AST node
221
- match e. kind {
222
- ast:: ExprKind :: Closure ( box ast:: Closure {
223
- coroutine_kind : Some ( coroutine_kind) ,
224
- ..
225
- } ) => {
226
- self . check_id ( coroutine_kind. closure_id ( ) ) ;
227
- }
228
- _ => { }
229
- }
230
- lint_callback ! ( self , check_expr_post, e) ;
231
- }
232
-
233
231
fn visit_generic_arg ( & mut self , arg : & ' a ast:: GenericArg ) {
234
232
lint_callback ! ( self , check_generic_arg, arg) ;
235
233
ast_visit:: walk_generic_arg ( self , arg) ;
0 commit comments