Skip to content

Commit 5e7dc36

Browse files
committed
Fix HasAttrs for StmtKind::Item
1 parent 73c3f55 commit 5e7dc36

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libsyntax/attr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@ impl HasAttrs for StmtKind {
12911291
fn attrs(&self) -> &[Attribute] {
12921292
match *self {
12931293
StmtKind::Local(ref local) => local.attrs(),
1294-
StmtKind::Item(..) => &[],
1294+
StmtKind::Item(ref item) => item.attrs(),
12951295
StmtKind::Expr(ref expr) | StmtKind::Semi(ref expr) => expr.attrs(),
12961296
StmtKind::Mac(ref mac) => {
12971297
let (_, _, ref attrs) = **mac;
@@ -1303,7 +1303,7 @@ impl HasAttrs for StmtKind {
13031303
fn map_attrs<F: FnOnce(Vec<Attribute>) -> Vec<Attribute>>(self, f: F) -> Self {
13041304
match self {
13051305
StmtKind::Local(local) => StmtKind::Local(local.map_attrs(f)),
1306-
StmtKind::Item(..) => self,
1306+
StmtKind::Item(item) => StmtKind::Item(item.map_attrs(f)),
13071307
StmtKind::Expr(expr) => StmtKind::Expr(expr.map_attrs(f)),
13081308
StmtKind::Semi(expr) => StmtKind::Semi(expr.map_attrs(f)),
13091309
StmtKind::Mac(mac) => StmtKind::Mac(mac.map(|(mac, style, attrs)| {

0 commit comments

Comments
 (0)