@@ -636,7 +636,7 @@ impl<'a> LintContext for EarlyContext<'a> {
636636 }
637637
638638 fn enter_attrs ( & mut self , attrs : & [ ast:: Attribute ] ) {
639- debug ! ( "early context: exit_attrs ({:?})" , attrs) ;
639+ debug ! ( "early context: enter_attrs ({:?})" , attrs) ;
640640 run_lints ! ( self , enter_lint_attrs, early_passes, attrs) ;
641641 }
642642
@@ -834,8 +834,10 @@ impl<'a, 'v> ast_visit::Visitor<'v> for EarlyContext<'a> {
834834 }
835835
836836 fn visit_expr ( & mut self , e : & ast:: Expr ) {
837- run_lints ! ( self , check_expr, early_passes, e) ;
838- ast_visit:: walk_expr ( self , e) ;
837+ self . with_lint_attrs ( e. attrs . as_attr_slice ( ) , |cx| {
838+ run_lints ! ( cx, check_expr, early_passes, e) ;
839+ ast_visit:: walk_expr ( cx, e) ;
840+ } )
839841 }
840842
841843 fn visit_stmt ( & mut self , s : & ast:: Stmt ) {
@@ -890,8 +892,10 @@ impl<'a, 'v> ast_visit::Visitor<'v> for EarlyContext<'a> {
890892 }
891893
892894 fn visit_local ( & mut self , l : & ast:: Local ) {
893- run_lints ! ( self , check_local, early_passes, l) ;
894- ast_visit:: walk_local ( self , l) ;
895+ self . with_lint_attrs ( l. attrs . as_attr_slice ( ) , |cx| {
896+ run_lints ! ( cx, check_local, early_passes, l) ;
897+ ast_visit:: walk_local ( cx, l) ;
898+ } )
895899 }
896900
897901 fn visit_block ( & mut self , b : & ast:: Block ) {
0 commit comments