about summary refs log tree commit diff
path: root/src/libsyntax/visit.rs
diff options
context:
space:
mode:
authorJohn Clements <clements@racket-lang.org>2014-06-30 18:02:14 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-07-03 12:54:51 -0700
commite38cb972dcfc0fdab44270257eac3405a39bd996 (patch)
treef45affb2ba2b0e35e03f102755103f93063ac9e5 /src/libsyntax/visit.rs
parentcff79ab5633f0900eb71a53ccb924632f7b1090c (diff)
downloadrust-e38cb972dcfc0fdab44270257eac3405a39bd996.tar.gz
rust-e38cb972dcfc0fdab44270257eac3405a39bd996.zip
Simplify PatIdent to contain an Ident rather than a Path
Rationale: for what appear to be historical reasons only, the PatIdent contains
a Path rather than an Ident.  This means that there are many places in the code
where an ident is artificially promoted to a path, and---much more problematically---
a bunch of elements from a path are simply thrown away, which seems like an invitation
to some really nasty bugs.

This commit replaces the Path in a PatIdent with a SpannedIdent, which just contains an ident
and a span.
Diffstat (limited to 'src/libsyntax/visit.rs')
-rw-r--r--src/libsyntax/visit.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs
index 6f0fc217533..4ab064a88b7 100644
--- a/src/libsyntax/visit.rs
+++ b/src/libsyntax/visit.rs
@@ -454,8 +454,8 @@ pub fn walk_pat<E: Clone, V: Visitor<E>>(visitor: &mut V, pattern: &Pat, env: E)
         PatRegion(ref subpattern) => {
             visitor.visit_pat(&**subpattern, env)
         }
-        PatIdent(_, ref path, ref optional_subpattern) => {
-            visitor.visit_path(path, pattern.id, env.clone());
+        PatIdent(_, ref pth1, ref optional_subpattern) => {
+            visitor.visit_ident(pth1.span, pth1.node, env.clone());
             match *optional_subpattern {
                 None => {}
                 Some(ref subpattern) => visitor.visit_pat(&**subpattern, env),