diff options
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/visit.rs | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index f253943943d..12432c8c78f 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -764,7 +764,7 @@ pub enum Expr_ { pub struct QPath { pub self_type: P<Ty>, pub trait_ref: P<TraitRef>, - pub item_name: Ident, + pub item_name: Ident, // FIXME(#20301) -- should use Name } #[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index 1cd21ccac7a..40ca6354ca6 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -133,6 +133,9 @@ pub trait Visitor<'v> { fn visit_path_parameters(&mut self, path_span: Span, path_parameters: &'v PathParameters) { walk_path_parameters(self, path_span, path_parameters) } + fn visit_assoc_type_binding(&mut self, type_binding: &'v TypeBinding) { + walk_assoc_type_binding(self, type_binding) + } fn visit_attribute(&mut self, _attr: &'v Attribute) {} } @@ -467,6 +470,9 @@ pub fn walk_path_parameters<'v, V: Visitor<'v>>(visitor: &mut V, for lifetime in data.lifetimes.iter() { visitor.visit_lifetime_ref(lifetime); } + for binding in data.bindings.iter() { + visitor.visit_assoc_type_binding(&**binding); + } } ast::ParenthesizedParameters(ref data) => { for typ in data.inputs.iter() { @@ -479,6 +485,12 @@ pub fn walk_path_parameters<'v, V: Visitor<'v>>(visitor: &mut V, } } +pub fn walk_assoc_type_binding<'v, V: Visitor<'v>>(visitor: &mut V, + type_binding: &'v TypeBinding) { + visitor.visit_ident(type_binding.span, type_binding.ident); + visitor.visit_ty(&*type_binding.ty); +} + pub fn walk_pat<'v, V: Visitor<'v>>(visitor: &mut V, pattern: &'v Pat) { match pattern.node { PatEnum(ref path, ref children) => { |
