about summary refs log tree commit diff
path: root/src/libstd/bitv.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2012-11-28 13:51:50 -0800
committerPatrick Walton <pcwalton@mimiga.net>2012-12-04 14:51:31 -0800
commitd1ebdbeb6c00fe7d119ce17cabb303c5731f9bf7 (patch)
treebde6bd5862f6838776d2176e52ea96235828e348 /src/libstd/bitv.rs
parent56ece46f7de9d1703dd39f952afac9bed22633b6 (diff)
librustc: Implement explicit self for Add and Index; add a hack in the borrow checker to support this. r=nmatsakis
Diffstat (limited to 'src/libstd/bitv.rs')
-rw-r--r--src/libstd/bitv.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libstd/bitv.rs b/src/libstd/bitv.rs
index e9ff56df30d..72f21a687da 100644
--- a/src/libstd/bitv.rs
+++ b/src/libstd/bitv.rs
@@ -565,11 +565,19 @@ pure fn land(w0: uint, w1: uint) -> uint { return w0 & w1; }
 
 pure fn right(_w0: uint, w1: uint) -> uint { return w1; }
 
+#[cfg(stage0)]
 impl Bitv: ops::Index<uint,bool> {
     pure fn index(i: uint) -> bool {
         self.get(i)
     }
 }
+#[cfg(stage1)]
+#[cfg(stage2)]
+impl Bitv: ops::Index<uint,bool> {
+    pure fn index(&self, i: uint) -> bool {
+        self.get(i)
+    }
+}
 
 #[cfg(test)]
 mod tests {