@@ -121,6 +121,18 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T>
121121 self . with_lint_attrs ( e. id , & e. attrs , |cx| {
122122 lint_callback ! ( cx, check_expr, e) ;
123123 ast_visit:: walk_expr ( cx, e) ;
124+ // Explicitly check for lints associated with 'closure_id', since
125+ // it does not have a corresponding AST node
126+ match e. kind {
127+ ast:: ExprKind :: Closure ( box ast:: Closure {
128+ coroutine_kind : Some ( coroutine_kind) ,
129+ ..
130+ } ) => {
131+ cx. check_id ( coroutine_kind. closure_id ( ) ) ;
132+ }
133+ _ => { }
134+ }
135+ lint_callback ! ( cx, check_expr_post, e) ;
124136 } )
125137 }
126138
@@ -214,21 +226,6 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T>
214226 } )
215227 }
216228
217- fn visit_expr_post ( & mut self , e : & ' a ast:: Expr ) {
218- // Explicitly check for lints associated with 'closure_id', since
219- // it does not have a corresponding AST node
220- match e. kind {
221- ast:: ExprKind :: Closure ( box ast:: Closure {
222- coroutine_kind : Some ( coroutine_kind) ,
223- ..
224- } ) => {
225- self . check_id ( coroutine_kind. closure_id ( ) ) ;
226- }
227- _ => { }
228- }
229- lint_callback ! ( self , check_expr_post, e) ;
230- }
231-
232229 fn visit_generic_arg ( & mut self , arg : & ' a ast:: GenericArg ) {
233230 lint_callback ! ( self , check_generic_arg, arg) ;
234231 ast_visit:: walk_generic_arg ( self , arg) ;
0 commit comments