about summary refs log tree commit diff
path: root/src/libsyntax/opt_vec.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsyntax/opt_vec.rs')
-rw-r--r--src/libsyntax/opt_vec.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libsyntax/opt_vec.rs b/src/libsyntax/opt_vec.rs
index fd54746f3dc..1604c40f917 100644
--- a/src/libsyntax/opt_vec.rs
+++ b/src/libsyntax/opt_vec.rs
@@ -61,6 +61,7 @@ impl<T> OptVec<T> {
         }
     }
 
+    #[cfg(stage0)]
     fn get(&self, i: uint) -> &'self T {
         match *self {
             Empty => fail!(fmt!("Invalid index %u", i)),
@@ -68,6 +69,16 @@ impl<T> OptVec<T> {
         }
     }
 
+    #[cfg(stage1)]
+    #[cfg(stage2)]
+    #[cfg(stage3)]
+    fn get<'a>(&'a self, i: uint) -> &'a T {
+        match *self {
+            Empty => fail!(fmt!("Invalid index %u", i)),
+            Vec(ref v) => &v[i]
+        }
+    }
+
     fn is_empty(&self) -> bool {
         self.len() == 0
     }