File tree Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -839,7 +839,7 @@ impl HasAttrs for StmtKind {
839839 fn attrs ( & self ) -> & [ Attribute ] {
840840 match * self {
841841 StmtKind :: Local ( ref local) => local. attrs ( ) ,
842- StmtKind :: Item ( ref item ) => item . attrs ( ) ,
842+ StmtKind :: Item ( .. ) => & [ ] ,
843843 StmtKind :: Expr ( ref expr) | StmtKind :: Semi ( ref expr) => expr. attrs ( ) ,
844844 StmtKind :: Mac ( ref mac) => {
845845 let ( _, _, ref attrs) = * * mac;
@@ -851,7 +851,7 @@ impl HasAttrs for StmtKind {
851851 fn map_attrs < F : FnOnce ( Vec < Attribute > ) -> Vec < Attribute > > ( self , f : F ) -> Self {
852852 match self {
853853 StmtKind :: Local ( local) => StmtKind :: Local ( local. map_attrs ( f) ) ,
854- StmtKind :: Item ( item ) => StmtKind :: Item ( item . map_attrs ( f ) ) ,
854+ StmtKind :: Item ( .. ) => self ,
855855 StmtKind :: Expr ( expr) => StmtKind :: Expr ( expr. map_attrs ( f) ) ,
856856 StmtKind :: Semi ( expr) => StmtKind :: Semi ( expr. map_attrs ( f) ) ,
857857 StmtKind :: Mac ( mac) => StmtKind :: Mac ( mac. map ( |( mac, style, attrs) | {
Original file line number Diff line number Diff line change @@ -213,12 +213,7 @@ impl<'a> fold::Folder for StripUnconfigured<'a> {
213213 }
214214
215215 fn fold_stmt ( & mut self , stmt : ast:: Stmt ) -> SmallVector < ast:: Stmt > {
216- // avoid calling `visit_stmt_or_expr_attrs` on items
217- match stmt. node {
218- ast:: StmtKind :: Item ( _) => { }
219- _ => self . visit_stmt_or_expr_attrs ( stmt. attrs ( ) ) ,
220- }
221-
216+ self . visit_stmt_or_expr_attrs ( stmt. attrs ( ) ) ;
222217 self . configure ( stmt) . map ( |stmt| fold:: noop_fold_stmt ( stmt, self ) )
223218 . unwrap_or ( SmallVector :: zero ( ) )
224219 }
You can’t perform that action at this time.
0 commit comments