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 {
839
839
fn attrs ( & self ) -> & [ Attribute ] {
840
840
match * self {
841
841
StmtKind :: Local ( ref local) => local. attrs ( ) ,
842
- StmtKind :: Item ( ref item ) => item . attrs ( ) ,
842
+ StmtKind :: Item ( .. ) => & [ ] ,
843
843
StmtKind :: Expr ( ref expr) | StmtKind :: Semi ( ref expr) => expr. attrs ( ) ,
844
844
StmtKind :: Mac ( ref mac) => {
845
845
let ( _, _, ref attrs) = * * mac;
@@ -851,7 +851,7 @@ impl HasAttrs for StmtKind {
851
851
fn map_attrs < F : FnOnce ( Vec < Attribute > ) -> Vec < Attribute > > ( self , f : F ) -> Self {
852
852
match self {
853
853
StmtKind :: Local ( local) => StmtKind :: Local ( local. map_attrs ( f) ) ,
854
- StmtKind :: Item ( item ) => StmtKind :: Item ( item . map_attrs ( f ) ) ,
854
+ StmtKind :: Item ( .. ) => self ,
855
855
StmtKind :: Expr ( expr) => StmtKind :: Expr ( expr. map_attrs ( f) ) ,
856
856
StmtKind :: Semi ( expr) => StmtKind :: Semi ( expr. map_attrs ( f) ) ,
857
857
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> {
213
213
}
214
214
215
215
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 ( ) ) ;
222
217
self . configure ( stmt) . map ( |stmt| fold:: noop_fold_stmt ( stmt, self ) )
223
218
. unwrap_or ( SmallVector :: zero ( ) )
224
219
}
You can’t perform that action at this time.
0 commit comments