about summary refs log tree commit diff
path: root/compiler/rustc_ast/src/visit.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_ast/src/visit.rs')
-rw-r--r--compiler/rustc_ast/src/visit.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/compiler/rustc_ast/src/visit.rs b/compiler/rustc_ast/src/visit.rs
index d9de5b8e197..aed24e11c4e 100644
--- a/compiler/rustc_ast/src/visit.rs
+++ b/compiler/rustc_ast/src/visit.rs
@@ -308,8 +308,12 @@ pub fn walk_item<'a, V: Visitor<'a>>(visitor: &mut V, item: &'a Item) {
     match &item.kind {
         ItemKind::ExternCrate(_) => {}
         ItemKind::Use(use_tree) => visitor.visit_use_tree(use_tree, item.id, false),
-        ItemKind::Static(box StaticItem { ty, mutability: _, expr })
-        | ItemKind::Const(box ConstItem { ty, expr, .. }) => {
+        ItemKind::Static(box StaticItem { ty, mutability: _, expr }) => {
+            visitor.visit_ty(ty);
+            walk_list!(visitor, visit_expr, expr);
+        }
+        ItemKind::Const(box ConstItem { defaultness: _, generics, ty, expr }) => {
+            visitor.visit_generics(generics);
             visitor.visit_ty(ty);
             walk_list!(visitor, visit_expr, expr);
         }
@@ -677,7 +681,8 @@ pub fn walk_assoc_item<'a, V: Visitor<'a>>(visitor: &mut V, item: &'a AssocItem,
     visitor.visit_ident(ident);
     walk_list!(visitor, visit_attribute, attrs);
     match kind {
-        AssocItemKind::Const(box ConstItem { ty, expr, .. }) => {
+        AssocItemKind::Const(box ConstItem { defaultness: _, generics, ty, expr }) => {
+            visitor.visit_generics(generics);
             visitor.visit_ty(ty);
             walk_list!(visitor, visit_expr, expr);
         }