@@ -735,7 +735,7 @@ impl<'a> LintContext for EarlyContext<'a> {
735735 }
736736
737737 fn enter_attrs ( & mut self , attrs : & [ ast:: Attribute ] ) {
738- debug ! ( "early context: exit_attrs ({:?})" , attrs) ;
738+ debug ! ( "early context: enter_attrs ({:?})" , attrs) ;
739739 run_lints ! ( self , enter_lint_attrs, early_passes, attrs) ;
740740 }
741741
@@ -934,8 +934,10 @@ impl<'a, 'v> ast_visit::Visitor<'v> for EarlyContext<'a> {
934934 }
935935
936936 fn visit_expr ( & mut self , e : & ast:: Expr ) {
937- run_lints ! ( self , check_expr, early_passes, e) ;
938- ast_visit:: walk_expr ( self , e) ;
937+ self . with_lint_attrs ( e. attrs . as_attr_slice ( ) , |cx| {
938+ run_lints ! ( cx, check_expr, early_passes, e) ;
939+ ast_visit:: walk_expr ( cx, e) ;
940+ } )
939941 }
940942
941943 fn visit_stmt ( & mut self , s : & ast:: Stmt ) {
@@ -990,8 +992,10 @@ impl<'a, 'v> ast_visit::Visitor<'v> for EarlyContext<'a> {
990992 }
991993
992994 fn visit_local ( & mut self , l : & ast:: Local ) {
993- run_lints ! ( self , check_local, early_passes, l) ;
994- ast_visit:: walk_local ( self , l) ;
995+ self . with_lint_attrs ( l. attrs . as_attr_slice ( ) , |cx| {
996+ run_lints ! ( cx, check_local, early_passes, l) ;
997+ ast_visit:: walk_local ( cx, l) ;
998+ } )
995999 }
9961000
9971001 fn visit_block ( & mut self , b : & ast:: Block ) {
0 commit comments