diff options
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/mut_visit.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/visit.rs | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index bbb629012a9..ca39fbd6c5d 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -2654,6 +2654,8 @@ pub enum AssocItemKind { /// A constant, `const $ident: $ty $def?;` where `def ::= "=" $expr? ;`. /// If `def` is parsed, then the constant is provided, and otherwise required. Const(P<Ty>, Option<P<Expr>>), + /// A static item (`static FOO: u8`). + Static(P<Ty>, Mutability, Option<P<Expr>>), /// A function. Fn(FnSig, Generics, Option<P<Block>>), /// A type. diff --git a/src/libsyntax/mut_visit.rs b/src/libsyntax/mut_visit.rs index 62f640f0bfa..91db6158689 100644 --- a/src/libsyntax/mut_visit.rs +++ b/src/libsyntax/mut_visit.rs @@ -954,7 +954,7 @@ pub fn noop_flat_map_assoc_item<T: MutVisitor>( visitor.visit_vis(vis); visit_attrs(attrs, visitor); match kind { - AssocItemKind::Const(ty, expr) => { + AssocItemKind::Const(ty, expr) | AssocItemKind::Static(ty, _, expr) => { visitor.visit_ty(ty); visit_opt(expr, |expr| visitor.visit_expr(expr)); } diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index 0dd21cdf12f..f5763ecf573 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -633,7 +633,7 @@ pub fn walk_assoc_item<'a, V: Visitor<'a>>(visitor: &mut V, item: &'a AssocItem, visitor.visit_ident(item.ident); walk_list!(visitor, visit_attribute, &item.attrs); match item.kind { - AssocItemKind::Const(ref ty, ref expr) => { + AssocItemKind::Const(ref ty, ref expr) | AssocItemKind::Static(ref ty, _, ref expr) => { visitor.visit_ty(ty); walk_list!(visitor, visit_expr, expr); } |
