@@ -121,6 +121,19 @@ 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+
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) ;
124137 } )
125138 }
126139
@@ -215,21 +228,6 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T>
215228 } )
216229 }
217230
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-
233231 fn visit_generic_arg ( & mut self , arg : & ' a ast:: GenericArg ) {
234232 lint_callback ! ( self , check_generic_arg, arg) ;
235233 ast_visit:: walk_generic_arg ( self , arg) ;
0 commit comments