about summary refs log tree commit diff
path: root/src/libsyntax/ast_map
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2014-08-27 21:46:52 -0400
committerNiko Matsakis <niko@alum.mit.edu>2014-08-27 21:46:52 -0400
commit1b487a890695e7d6dfbfe5dcd7d4fa0e8ca8003f (patch)
tree552fabade603ab0d148a49ae3cf1abd3f399740a /src/libsyntax/ast_map
parent3ee047ae1ffab454270bc1859b3beef3556ef8f9 (diff)
downloadrust-1b487a890695e7d6dfbfe5dcd7d4fa0e8ca8003f.tar.gz
rust-1b487a890695e7d6dfbfe5dcd7d4fa0e8ca8003f.zip
Implement generalized object and type parameter bounds (Fixes #16462)
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) => {