]> git.lizzy.rs Git - rust.git/commitdiff
syntax: don't store a secondary NodeId for TyPath.
authorEduard Burtescu <edy.burt@gmail.com>
Thu, 29 Jan 2015 19:18:17 +0000 (21:18 +0200)
committerEduard Burtescu <edy.burt@gmail.com>
Tue, 24 Feb 2015 12:14:16 +0000 (14:14 +0200)
21 files changed:
src/librustc/lint/builtin.rs
src/librustc/metadata/encoder.rs
src/librustc/middle/astconv_util.rs
src/librustc/middle/infer/error_reporting.rs
src/librustc/middle/resolve_lifetime.rs
src/librustc_privacy/lib.rs
src/librustc_resolve/build_reduced_graph.rs
src/librustc_resolve/lib.rs
src/librustc_trans/save/mod.rs
src/librustc_typeck/astconv.rs
src/librustdoc/clean/mod.rs
src/libsyntax/ast.rs
src/libsyntax/ast_util.rs
src/libsyntax/ext/build.rs
src/libsyntax/ext/expand.rs
src/libsyntax/feature_gate.rs
src/libsyntax/fold.rs
src/libsyntax/parse/mod.rs
src/libsyntax/parse/parser.rs
src/libsyntax/print/pprust.rs
src/libsyntax/visit.rs

index 8a00622486ddc294a9cdd9506f1375cf8e3f8148..8c6984972718fa092ef36d00e487080967bec672 100644 (file)
@@ -405,8 +405,8 @@ struct ImproperCTypesVisitor<'a, 'tcx: 'a> {
 }
 
 impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
-    fn check_def(&mut self, sp: Span, ty_id: ast::NodeId, path_id: ast::NodeId) {
-        match self.cx.tcx.def_map.borrow()[path_id].clone() {
+    fn check_def(&mut self, sp: Span, id: ast::NodeId) {
+        match self.cx.tcx.def_map.borrow()[id].clone() {
             def::DefPrimTy(ast::TyInt(ast::TyIs(_))) => {
                 self.cx.span_lint(IMPROPER_CTYPES, sp,
                                   "found rust type `isize` in foreign module, while \
@@ -418,7 +418,7 @@ fn check_def(&mut self, sp: Span, ty_id: ast::NodeId, path_id: ast::NodeId) {
                                    libc::c_uint or libc::c_ulong should be used");
             }
             def::DefTy(..) => {
-                let tty = match self.cx.tcx.ast_ty_to_ty_cache.borrow().get(&ty_id) {
+                let tty = match self.cx.tcx.ast_ty_to_ty_cache.borrow().get(&id) {
                     Some(&ty::atttce_resolved(t)) => t,
                     _ => panic!("ast_ty_to_ty_cache was incomplete after typeck!")
                 };
@@ -437,9 +437,8 @@ fn check_def(&mut self, sp: Span, ty_id: ast::NodeId, path_id: ast::NodeId) {
 
 impl<'a, 'tcx, 'v> Visitor<'v> for ImproperCTypesVisitor<'a, 'tcx> {
     fn visit_ty(&mut self, ty: &ast::Ty) {
-        match ty.node {
-            ast::TyPath(_, id) => self.check_def(ty.span, ty.id, id),
-            _ => (),
+        if let ast::TyPath(_) = ty.node {
+            self.check_def(ty.span, ty.id);
         }
         visit::walk_ty(self, ty);
     }
index e0832bb683a1c9064963500c8c5387bcabaf5752..e6f5c36a2f81254896258330fc8b1529502d5597 100644 (file)
@@ -1221,7 +1221,7 @@ fn add_to_index(item: &ast::Item, rbml_w: &Encoder,
         encode_unsafety(rbml_w, unsafety);
         encode_polarity(rbml_w, polarity);
         match ty.node {
-            ast::TyPath(ref path, _) if path.segments.len() == 1 => {
+            ast::TyPath(ref path) if path.segments.len() == 1 => {
                 let ident = path.segments.last().unwrap().identifier;
                 encode_impl_type_basename(rbml_w, ident);
             }
index d699ba40e822045bf4ac34ff6b13a86bfc93198e..d4680844838982919c922c7c61ab00408b2b70f7 100644 (file)
@@ -43,8 +43,8 @@ pub fn check_path_args(tcx: &ty::ctxt,
 pub fn ast_ty_to_prim_ty<'tcx>(tcx: &ty::ctxt<'tcx>, ast_ty: &ast::Ty)
                                -> Option<Ty<'tcx>> {
     match ast_ty.node {
-        ast::TyPath(ref path, id) => {
-            let a_def = match tcx.def_map.borrow().get(&id) {
+        ast::TyPath(ref path) => {
+            let a_def = match tcx.def_map.borrow().get(&ast_ty.id) {
                 None => {
                     tcx.sess.span_bug(ast_ty.span,
                                       &format!("unbound path {}",
index 110c7bf41e559136aa7e7f5059c45e5e140c44ee..4439472ab5671bb0f4d2bf43a42cc29254cd30b9 100644 (file)
@@ -1233,8 +1233,8 @@ fn rebuild_arg_ty_or_output(&self,
                     }
                     ty_queue.push(&*mut_ty.ty);
                 }
-                ast::TyPath(ref path, id) => {
-                    let a_def = match self.tcx.def_map.borrow().get(&id) {
+                ast::TyPath(ref path) => {
+                    let a_def = match self.tcx.def_map.borrow().get(&cur_ty.id) {
                         None => {
                             self.tcx
                                 .sess
@@ -1279,7 +1279,7 @@ fn rebuild_arg_ty_or_output(&self,
                             let new_path = self.rebuild_path(rebuild_info, lifetime);
                             let to = ast::Ty {
                                 id: cur_ty.id,
-                                node: ast::TyPath(new_path, id),
+                                node: ast::TyPath(new_path),
                                 span: cur_ty.span
                             };
                             new_ty = self.rebuild_ty(new_ty, P(to));
index 9012de0850fa2184e8127bc672a2958b5bed4d8e..7b957d6ce84986368123b4988aa3255ffcb25947 100644 (file)
@@ -165,13 +165,13 @@ fn visit_ty(&mut self, ty: &ast::Ty) {
                     visit::walk_ty(this, ty);
                 });
             }
-            ast::TyPath(ref path, id) => {
+            ast::TyPath(ref path) => {
                 // if this path references a trait, then this will resolve to
                 // a trait ref, which introduces a binding scope.
-                match self.def_map.borrow().get(&id) {
+                match self.def_map.borrow().get(&ty.id) {
                     Some(&def::DefTrait(..)) => {
                         self.with(LateScope(&Vec::new(), self.scope), |_, this| {
-                            this.visit_path(path, id);
+                            this.visit_path(path, ty.id);
                         });
                     }
                     _ => {
@@ -270,16 +270,12 @@ fn visit_poly_trait_ref(&mut self,
                 for lifetime in &trait_ref.bound_lifetimes {
                     this.visit_lifetime_def(lifetime);
                 }
-                this.visit_trait_ref(&trait_ref.trait_ref)
+                visit::walk_path(this, &trait_ref.trait_ref.path)
             })
         } else {
             self.visit_trait_ref(&trait_ref.trait_ref)
         }
     }
-
-    fn visit_trait_ref(&mut self, trait_ref: &ast::TraitRef) {
-        self.visit_path(&trait_ref.path, trait_ref.ref_id);
-    }
 }
 
 impl<'a> LifetimeContext<'a> {
index 3d92b387cdb3265b35cc0bad5cb62d5be0abdc0a..838ba9c658cf1661fda1b7e3b4ac3c9949d8d848 100644 (file)
@@ -259,8 +259,8 @@ fn visit_item(&mut self, item: &ast::Item) {
             // * Private trait impls for private types can be completely ignored
             ast::ItemImpl(_, _, _, _, ref ty, ref impl_items) => {
                 let public_ty = match ty.node {
-                    ast::TyPath(_, id) => {
-                        match self.tcx.def_map.borrow()[id].clone() {
+                    ast::TyPath(_) => {
+                        match self.tcx.def_map.borrow()[ty.id].clone() {
                             def::DefPrimTy(..) => true,
                             def => {
                                 let did = def.def_id();
@@ -326,8 +326,8 @@ fn visit_item(&mut self, item: &ast::Item) {
             }
 
             ast::ItemTy(ref ty, _) if public_first => {
-                if let ast::TyPath(_, id) = ty.node {
-                    match self.tcx.def_map.borrow()[id].clone() {
+                if let ast::TyPath(_) = ty.node {
+                    match self.tcx.def_map.borrow()[ty.id].clone() {
                         def::DefPrimTy(..) | def::DefTyParam(..) => {},
                         def => {
                             let did = def.def_id();
@@ -628,11 +628,11 @@ fn ensure_public(&self, span: Span, to_check: ast::DefId,
                     // back up the chains to find the relevant struct/enum that
                     // was private.
                     ast::ItemImpl(_, _, _, _, ref ty, _) => {
-                        let id = match ty.node {
-                            ast::TyPath(_, id) => id,
+                        match ty.node {
+                            ast::TyPath(_) => {}
                             _ => return Some((err_span, err_msg, None)),
                         };
-                        let def = self.tcx.def_map.borrow()[id].clone();
+                        let def = self.tcx.def_map.borrow()[ty.id].clone();
                         let did = def.def_id();
                         assert!(is_local(did));
                         match self.tcx.map.get(did.node) {
@@ -716,13 +716,13 @@ fn check_static_method(&mut self,
     }
 
     // Checks that a path is in scope.
-    fn check_path(&mut self, span: Span, path_id: ast::NodeId, path: &ast::Path) {
+    fn check_path(&mut self, span: Span, path_id: ast::NodeId, last: ast::Ident) {
         debug!("privacy - path {}", self.nodestr(path_id));
         let orig_def = self.tcx.def_map.borrow()[path_id].clone();
         let ck = |tyname: &str| {
             let ck_public = |def: ast::DefId| {
                 debug!("privacy - ck_public {:?}", def);
-                let name = token::get_ident(path.segments.last().unwrap().identifier);
+                let name = token::get_ident(last);
                 let origdid = orig_def.def_id();
                 self.ensure_public(span,
                                    def,
@@ -832,37 +832,22 @@ fn check_method(&mut self, span: Span, origin: &MethodOrigin,
 
 impl<'a, 'tcx, 'v> Visitor<'v> for PrivacyVisitor<'a, 'tcx> {
     fn visit_item(&mut self, item: &ast::Item) {
-        match item.node {
-            ast::ItemUse(ref vpath) => {
-                match vpath.node {
-                    ast::ViewPathSimple(..) | ast::ViewPathGlob(..) => {}
-                    ast::ViewPathList(ref prefix, ref list) => {
-                        for pid in list {
-                            match pid.node {
-                                ast::PathListIdent { id, name } => {
-                                    debug!("privacy - ident item {}", id);
-                                    let seg = ast::PathSegment {
-                                        identifier: name,
-                                        parameters: ast::PathParameters::none(),
-                                    };
-                                    let segs = vec![seg];
-                                    let path = ast::Path {
-                                        global: false,
-                                        span: pid.span,
-                                        segments: segs,
-                                    };
-                                    self.check_path(pid.span, id, &path);
-                                }
-                                ast::PathListMod { id } => {
-                                    debug!("privacy - mod item {}", id);
-                                    self.check_path(pid.span, id, prefix);
-                                }
-                            }
+        if let ast::ItemUse(ref vpath) = item.node {
+            if let ast::ViewPathList(ref prefix, ref list) = vpath.node {
+                for pid in list {
+                    match pid.node {
+                        ast::PathListIdent { id, name } => {
+                            debug!("privacy - ident item {}", id);
+                            self.check_path(pid.span, id, name);
+                        }
+                        ast::PathListMod { id } => {
+                            debug!("privacy - mod item {}", id);
+                            let name = prefix.segments.last().unwrap().identifier;
+                            self.check_path(pid.span, id, name);
                         }
                     }
                 }
             }
-            _ => {}
         }
         let orig_curitem = replace(&mut self.curitem, item.id);
         visit::walk_item(self, item);
@@ -1033,7 +1018,7 @@ fn visit_foreign_item(&mut self, fi: &ast::ForeignItem) {
     }
 
     fn visit_path(&mut self, path: &ast::Path, id: ast::NodeId) {
-        self.check_path(path.span, id, path);
+        self.check_path(path.span, id, path.segments.last().unwrap().identifier);
         visit::walk_path(self, path);
     }
 }
@@ -1273,8 +1258,8 @@ fn check_ty_param_bound(&self,
 
 impl<'a, 'b, 'tcx, 'v> Visitor<'v> for CheckTypeForPrivatenessVisitor<'a, 'b, 'tcx> {
     fn visit_ty(&mut self, ty: &ast::Ty) {
-        if let ast::TyPath(_, path_id) = ty.node {
-            if self.inner.path_is_private_type(path_id) {
+        if let ast::TyPath(_) = ty.node {
+            if self.inner.path_is_private_type(ty.id) {
                 self.contains_private = true;
                 // found what we're looking for so let's stop
                 // working.
@@ -1398,7 +1383,7 @@ fn visit_item(&mut self, item: &ast::Item) {
                             //
                             // Those in 2. are warned via walk_generics and this
                             // call here.
-                            self.visit_trait_ref(tr)
+                            visit::walk_path(self, &tr.path);
                         }
                     }
                 } else if trait_ref.is_none() && self_is_public_path {
@@ -1479,9 +1464,9 @@ fn visit_fn(&mut self, fk: visit::FnKind<'v>, fd: &'v ast::FnDecl,
     }
 
     fn visit_ty(&mut self, t: &ast::Ty) {
-        if let ast::TyPath(ref p, path_id) = t.node {
+        if let ast::TyPath(ref p) = t.node {
             if !self.tcx.sess.features.borrow().visible_private_types &&
-                self.path_is_private_type(path_id) {
+                self.path_is_private_type(t.id) {
                 self.tcx.sess.span_err(p.span,
                                        "private type in exported type signature");
             }
index a181497010faf2fa71e29d3bf784835bc2ce3d0f..ad5fa600bd81b86584dfcd59b266e39520aa17f9 100644 (file)
@@ -523,14 +523,14 @@ fn build_reduced_graph_for_item(&mut self, item: &Item, parent: &Rc<Module>) ->
                 // within this module.
 
                 let mod_name = match ty.node {
-                    TyPath(ref path, _) if path.segments.len() == 1 => {
+                    TyPath(ref path) if path.segments.len() == 1 => {
                         // FIXME(18446) we should distinguish between the name of
                         // a trait and the name of an impl of that trait.
                         Some(path.segments.last().unwrap().identifier.name)
                     }
                     TyObjectSum(ref lhs_ty, _) => {
                         match lhs_ty.node {
-                            TyPath(ref path, _) if path.segments.len() == 1 => {
+                            TyPath(ref path) if path.segments.len() == 1 => {
                                 Some(path.segments.last().unwrap().identifier.name)
                             }
                             _ => {
index 2da8bd5b538b67a8a7bad4a142af16dbe9f814d6..55ad52762e0c6b750be63e95dce017c0e432c65e 100644 (file)
@@ -3387,8 +3387,8 @@ fn resolve_implementation(&mut self,
                 // type, the result will be that the type name resolves to a module but not
                 // a type (shadowing any imported modules or types with this name), leading
                 // to weird user-visible bugs. So we ward this off here. See #15060.
-                TyPath(ref path, path_id) => {
-                    match self.def_map.borrow().get(&path_id) {
+                TyPath(ref path) => {
+                    match self.def_map.borrow().get(&self_type.id) {
                         // FIXME: should we catch other options and give more precise errors?
                         Some(&DefMod(_)) => {
                             self.resolve_error(path.span, "inherent implementations are not \
@@ -3576,7 +3576,7 @@ fn resolve_type(&mut self, ty: &Ty) {
             // Like path expressions, the interpretation of path types depends
             // on whether the path has multiple elements in it or not.
 
-            TyPath(ref path, path_id) => {
+            TyPath(ref path) => {
                 // This is a path in the type namespace. Walk through scopes
                 // looking for it.
                 let mut result_def = None;
@@ -3617,8 +3617,8 @@ fn resolve_type(&mut self, ty: &Ty) {
                         debug!("(resolving type) writing resolution for `{}` \
                                 (id {}) = {:?}",
                                self.path_names_to_string(path),
-                               path_id, def);
-                        self.record_def(path_id, def);
+                               ty.id, def);
+                        self.record_def(ty.id, def);
                     }
                     None => {
                         let msg = format!("use of undeclared type name `{}`",
@@ -4281,7 +4281,7 @@ fn find_fallback_in_self_type(&mut self, name: Name) -> FallbackSuggestion {
         fn extract_path_and_node_id(t: &Ty, allow: FallbackChecks)
                                                     -> Option<(Path, NodeId, FallbackChecks)> {
             match t.node {
-                TyPath(ref path, node_id) => Some((path.clone(), node_id, allow)),
+                TyPath(ref path) => Some((path.clone(), t.id, allow)),
                 TyPtr(ref mut_ty) => extract_path_and_node_id(&*mut_ty.ty, OnlyTraitAndStatics),
                 TyRptr(_, ref mut_ty) => extract_path_and_node_id(&*mut_ty.ty, allow),
                 // This doesn't handle the remaining `Ty` variants as they are not
index 59fca4b03188662d5146b6ad5228e4a6ca3b2d94..af891001ea00e0ce16528a290de795fab9d2eeac 100644 (file)
@@ -662,9 +662,9 @@ fn process_impl(&mut self,
         let trait_id = trait_ref.as_ref().and_then(|tr| self.lookup_type_ref(tr.ref_id));
         match typ.node {
             // Common case impl for a struct or something basic.
-            ast::TyPath(ref path, id) => {
+            ast::TyPath(ref path) => {
                 let sub_span = self.span.sub_span_for_type_name(path.span);
-                let self_id = self.lookup_type_ref(id).map(|id| {
+                let self_id = self.lookup_type_ref(typ.id).map(|id| {
                     self.fmt.ref_str(recorder::TypeRef,
                                      path.span,
                                      sub_span,
@@ -1303,8 +1303,8 @@ fn visit_ty(&mut self, t: &ast::Ty) {
         }
 
         match t.node {
-            ast::TyPath(ref path, id) => {
-                match self.lookup_type_ref(id) {
+            ast::TyPath(ref path) => {
+                match self.lookup_type_ref(t.id) {
                     Some(id) => {
                         let sub_span = self.span.sub_span_for_type_name(t.span);
                         self.fmt.ref_str(recorder::TypeRef,
index 46a7041fff67249bc0d44b067e91235b243ca483..16a2dbf26870a64f1a79ed9a963dd72118ee3ba9 100644 (file)
@@ -852,8 +852,8 @@ pub fn ast_ty_to_builtin_ty<'tcx>(
     }
 
     match ast_ty.node {
-        ast::TyPath(ref path, id) => {
-            let a_def = match this.tcx().def_map.borrow().get(&id) {
+        ast::TyPath(ref path) => {
+            let a_def = match this.tcx().def_map.borrow().get(&ast_ty.id) {
                 None => {
                     this.tcx()
                         .sess
@@ -912,8 +912,8 @@ fn ast_ty_to_trait_ref<'tcx>(this: &AstConv<'tcx>,
      */
 
     match ty.node {
-        ast::TyPath(ref path, id) => {
-            match this.tcx().def_map.borrow().get(&id) {
+        ast::TyPath(ref path) => {
+            match this.tcx().def_map.borrow().get(&ty.id) {
                 Some(&def::DefTrait(trait_def_id)) => {
                     let mut projection_bounds = Vec::new();
                     let trait_ref = object_path_to_poly_trait_ref(this,
@@ -1183,8 +1183,8 @@ pub fn ast_ty_to_ty<'tcx>(this: &AstConv<'tcx>,
             ast::TyPolyTraitRef(ref bounds) => {
                 conv_ty_poly_trait_ref(this, rscope, ast_ty.span, &bounds[..])
             }
-            ast::TyPath(ref path, id) => {
-                let a_def = match tcx.def_map.borrow().get(&id) {
+            ast::TyPath(ref path) => {
+                let a_def = match tcx.def_map.borrow().get(&ast_ty.id) {
                     None => {
                         tcx.sess
                            .span_bug(ast_ty.span,
index 058d55bd7ba953ee894aa85b1d1994252a72e28a..d05aa4d20066bdaa4f45beb39c9b213f4046ee21 100644 (file)
@@ -1496,8 +1496,8 @@ fn clean(&self, cx: &DocContext) -> Type {
             TyFixedLengthVec(ref ty, ref e) => FixedVector(box ty.clean(cx),
                                                            e.span.to_src(cx)),
             TyTup(ref tys) => Tuple(tys.clean(cx)),
-            TyPath(ref p, id) => {
-                resolve_type(cx, p.clean(cx), id)
+            TyPath(ref p) => {
+                resolve_type(cx, p.clean(cx), self.id)
             }
             TyObjectSum(ref lhs, ref bounds) => {
                 let lhs_ty = lhs.clean(cx);
index effaac52716340e2c0f77f4821b0de6d0f01a5e9..7c83286f656b15392b9cf53298029cc863cc681f 100644 (file)
@@ -1257,7 +1257,7 @@ pub enum Ty_ {
     /// A path (`module::module::...::Type`) or primitive
     ///
     /// Type parameters are stored in the Path itself
-    TyPath(Path, NodeId),
+    TyPath(Path),
     /// Something like `A+B`. Note that `B` must always be a path.
     TyObjectSum(P<Ty>, TyParamBounds),
     /// A type like `for<'a> Foo<&'a Bar>`
index f1228c1d36308a365d968d36ed34660fdd5d18bb..6ea37aaf72ce2971961c65be07ad3d3fd740be17 100644 (file)
@@ -488,9 +488,6 @@ fn visit_expr(&mut self, expression: &Expr) {
 
     fn visit_ty(&mut self, typ: &Ty) {
         self.operation.visit_id(typ.id);
-        if let TyPath(_, id) = typ.node {
-            self.operation.visit_id(id);
-        }
         visit::walk_ty(self, typ)
     }
 
index 656d507ed69b826952ecbe61bb354f1c72c69836..baa2fab044f3f6e320a4ab549d88b2eeb3e6f636 100644 (file)
@@ -398,7 +398,7 @@ fn ty(&self, span: Span, ty: ast::Ty_) -> P<ast::Ty> {
     }
 
     fn ty_path(&self, path: ast::Path) -> P<ast::Ty> {
-        self.ty(path.span, ast::TyPath(path, ast::DUMMY_NODE_ID))
+        self.ty(path.span, ast::TyPath(path))
     }
 
     fn ty_sum(&self, path: ast::Path, bounds: OwnedSlice<ast::TyParamBound>) -> P<ast::Ty> {
index bc239d0c7c2698fb5d097579ff555f56202ff8ea..f7014d6cc3c006f6694715277323ac60dc301625 100644 (file)
@@ -41,7 +41,7 @@ pub fn expand_type(t: P<ast::Ty>,
     debug!("expanding type {:?} with impl_ty {:?}", t, impl_ty);
     let t = match (t.node.clone(), impl_ty) {
         // Expand uses of `Self` in impls to the concrete type.
-        (ast::Ty_::TyPath(ref path, _), Some(ref impl_ty)) => {
+        (ast::Ty_::TyPath(ref path), Some(ref impl_ty)) => {
             let path_as_ident = path_to_ident(path);
             // Note unhygenic comparison here. I think this is correct, since
             // even though `Self` is almost just a type parameter, the treatment
index 071158fcebb5cf32da776b2e98394450dbf47108..4efae84fea5aebd845efdadfcc09fe317548b585 100644 (file)
@@ -549,7 +549,7 @@ fn visit_foreign_item(&mut self, i: &ast::ForeignItem) {
 
     fn visit_ty(&mut self, t: &ast::Ty) {
         match t.node {
-            ast::TyPath(ref p, _) => {
+            ast::TyPath(ref p) => {
                 match &*p.segments {
 
                     [ast::PathSegment { identifier, .. }] => {
index dae830583c44b43ce2c9e0b2e9832d95a1942bd9..ae4d2a80045982712e272c7035069041c5fd1eda 100644 (file)
@@ -428,10 +428,7 @@ pub fn noop_fold_ty<T: Folder>(t: P<Ty>, fld: &mut T) -> P<Ty> {
             }
             TyTup(tys) => TyTup(tys.move_map(|ty| fld.fold_ty(ty))),
             TyParen(ty) => TyParen(fld.fold_ty(ty)),
-            TyPath(path, id) => {
-                let id = fld.new_id(id);
-                TyPath(fld.fold_path(path), id)
-            }
+            TyPath(path) => TyPath(fld.fold_path(path)),
             TyObjectSum(ty, bounds) => {
                 TyObjectSum(fld.fold_ty(ty),
                             fld.fold_bounds(bounds))
index 43dfcbae57e497b0a82f493ff427bbaccfe75fe4..d4c66529e77df4ef268aa59ba767110e4e0f925c 100644 (file)
@@ -1051,7 +1051,7 @@ fn parser_done(p: Parser){
                                                 parameters: ast::PathParameters::none(),
                                             }
                                         ),
-                                        }, ast::DUMMY_NODE_ID),
+                                        }),
                                         span:sp(10,13)
                                     }),
                                     pat: P(ast::Pat {
index fec33eddb91c18756a46170bff4f9c57081c5a3c..bcef7238d7f21007035b7512234ee6d3ca6b5684 100644 (file)
@@ -1076,8 +1076,7 @@ pub fn parse_for_in_type(&mut self) -> Ty_ {
     }
 
     pub fn parse_ty_path(&mut self) -> Ty_ {
-        let path = self.parse_path(LifetimeAndTypesWithoutColons);
-        TyPath(path, ast::DUMMY_NODE_ID)
+        TyPath(self.parse_path(LifetimeAndTypesWithoutColons))
     }
 
     /// parse a TyBareFn type:
@@ -4815,10 +4814,10 @@ fn parse_item_impl(&mut self, unsafety: ast::Unsafety) -> ItemInfo {
         let opt_trait = if could_be_trait && self.eat_keyword(keywords::For) {
             // New-style trait. Reinterpret the type as a trait.
             match ty.node {
-                TyPath(ref path, node_id) => {
+                TyPath(ref path) => {
                     Some(TraitRef {
                         path: (*path).clone(),
-                        ref_id: node_id,
+                        ref_id: ty.id,
                     })
                 }
                 _ => {
index 869dad867ebc4f6c8d7fc45783410ac8b6e45a34..752d34a19c6e1760a64a8b60074d9904233579be 100644 (file)
@@ -729,7 +729,7 @@ pub fn print_type(&mut self, ty: &ast::Ty) -> IoResult<()> {
                                       &generics,
                                       None));
             }
-            ast::TyPath(ref path, _) => {
+            ast::TyPath(ref path) => {
                 try!(self.print_path(path, false));
             }
             ast::TyObjectSum(ref ty, ref bounds) => {
index 412bf0fa22a00a37dd77567636fd9eeb40a4914e..4586495227d02d37833d98194405a7045d808ec2 100644 (file)
@@ -399,8 +399,8 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty) {
             walk_fn_ret_ty(visitor, &function_declaration.decl.output);
             walk_lifetime_decls_helper(visitor, &function_declaration.lifetimes);
         }
-        TyPath(ref path, id) => {
-            visitor.visit_path(path, id);
+        TyPath(ref path) => {
+            visitor.visit_path(path, typ.id);
         }
         TyObjectSum(ref ty, ref bounds) => {
             visitor.visit_ty(&**ty);