about summary refs log tree commit diff
path: root/src/libsyntax/ext/base.rs
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2013-04-10 13:11:27 -0700
committerNiko Matsakis <niko@alum.mit.edu>2013-04-10 17:32:02 -0700
commit49de82cdca2064a909d3104f4e5eccacb0425fd0 (patch)
tree476daee1450ae400b436dcfa8c764310ecd6eb34 /src/libsyntax/ext/base.rs
parent3322595e896e95c3e19ca33c854ad529f2ef3c19 (diff)
downloadrust-49de82cdca2064a909d3104f4e5eccacb0425fd0.tar.gz
rust-49de82cdca2064a909d3104f4e5eccacb0425fd0.zip
Issue #5656: Make &self not mean "&'self self"
Fixes #5656.
Fixes #5541.
Diffstat (limited to 'src/libsyntax/ext/base.rs')
-rw-r--r--src/libsyntax/ext/base.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs
index 92f0c7c7679..886af694920 100644
--- a/src/libsyntax/ext/base.rs
+++ b/src/libsyntax/ext/base.rs
@@ -454,6 +454,7 @@ impl <K: Eq + Hash + IterBytes ,V: Copy> MapChain<K,V>{
 
     // ugh: can't get this to compile with mut because of the
     // lack of flow sensitivity.
+    #[cfg(stage0)]
     fn get_map(&self) -> &'self HashMap<K,@V> {
         match *self {
             BaseMapChain (~ref map) => map,
@@ -461,6 +462,18 @@ impl <K: Eq + Hash + IterBytes ,V: Copy> MapChain<K,V>{
         }
     }
 
+    // ugh: can't get this to compile with mut because of the
+    // lack of flow sensitivity.
+    #[cfg(stage1)]
+    #[cfg(stage2)]
+    #[cfg(stage3)]
+    fn get_map<'a>(&'a self) -> &'a HashMap<K,@V> {
+        match *self {
+            BaseMapChain (~ref map) => map,
+            ConsMapChain (~ref map,_) => map
+        }
+    }
+
 // traits just don't work anywhere...?
 //pub impl Map<Name,SyntaxExtension> for MapChain {