about summary refs log tree commit diff
path: root/src/libsyntax/ast_map
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsyntax/ast_map')
-rw-r--r--src/libsyntax/ast_map/mod.rs22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/libsyntax/ast_map/mod.rs b/src/libsyntax/ast_map/mod.rs
index 5fccf6cc3f0..993c5ce676a 100644
--- a/src/libsyntax/ast_map/mod.rs
+++ b/src/libsyntax/ast_map/mod.rs
@@ -68,10 +68,15 @@ impl<'a> Iterator<PathElem> for LinkedPath<'a> {
     }
 }
 
-// HACK(eddyb) move this into libstd (value wrapper for slice::Items).
+#[cfg(stage0)]
 #[deriving(Clone)]
 pub struct Values<'a, T>(pub slice::Items<'a, T>);
 
+// HACK(eddyb) move this into libstd (value wrapper for slice::Items).
+#[cfg(not(stage0))]
+#[deriving(Clone)]
+pub struct Values<'a, T:'a>(pub slice::Items<'a, T>);
+
 impl<'a, T: Copy> Iterator<T> for Values<'a, T> {
     fn next(&mut self) -> Option<T> {
         let &Values(ref mut items) = self;
@@ -478,6 +483,7 @@ impl Map {
     }
 }
 
+#[cfg(stage0)]
 pub struct NodesMatchingSuffix<'a, S> {
     map: &'a Map,
     item_name: &'a S,
@@ -485,6 +491,14 @@ pub struct NodesMatchingSuffix<'a, S> {
     idx: NodeId,
 }
 
+#[cfg(not(stage0))]
+pub struct NodesMatchingSuffix<'a, S:'a> {
+    map: &'a Map,
+    item_name: &'a S,
+    in_which: &'a [S],
+    idx: NodeId,
+}
+
 impl<'a,S:Str> NodesMatchingSuffix<'a,S> {
     /// Returns true only if some suffix of the module path for parent
     /// matches `self.in_which`.
@@ -676,11 +690,7 @@ impl<'a, F: FoldOps> Folder for Ctx<'a, F> {
                     None => {}
                 }
             }
-            ItemTrait(_, _, ref traits, ref methods) => {
-                for t in traits.iter() {
-                    self.insert(t.ref_id, EntryItem(self.parent, i));
-                }
-
+            ItemTrait(_, _, _, ref methods) => {
                 for tm in methods.iter() {
                     match *tm {
                         RequiredMethod(ref m) => {