]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/middle/save/mod.rs
Simplify PatIdent to contain an Ident rather than a Path
[rust.git] / src / librustc / middle / save / mod.rs
index 2b2f3b8fb0b5fd085ba00cdc24736f1bde36644d..56894ad3e5c2b70c94bd720d291997226df8007b 100644 (file)
@@ -926,7 +926,7 @@ fn process_pat(&mut self, p:&ast::Pat, e: DxrVisitorEnv) {
                 self.collected_paths.push((p.id, path.clone(), false, recorder::VarRef));
                 visit::walk_pat(self, p, e);
             }
-            ast::PatIdent(bm, ref path, ref optional_subpattern) => {
+            ast::PatIdent(bm, ref path1, ref optional_subpattern) => {
                 let immut = match bm {
                     // Even if the ref is mut, you can't change the ref, only
                     // the data pointed at, so showing the initialising expression
@@ -940,7 +940,8 @@ fn process_pat(&mut self, p:&ast::Pat, e: DxrVisitorEnv) {
                     }
                 };
                 // collect path for either visit_local or visit_arm
-                self.collected_paths.push((p.id, path.clone(), immut, recorder::VarRef));
+                let path = ast_util::ident_to_path(path1.span,path1.node);
+                self.collected_paths.push((p.id, path, immut, recorder::VarRef));
                 match *optional_subpattern {
                     None => {}
                     Some(subpattern) => self.visit_pat(&*subpattern, e),