about summary refs log tree commit diff
path: root/src/test/run-pass/const-struct.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2012-11-14 18:59:30 -0800
committerPatrick Walton <pcwalton@mimiga.net>2012-11-19 15:33:11 -0800
commit318e534895f20e7991abbc644eec311816010ef1 (patch)
tree764ce1ae3e9efbecd4fdc057663beb522b10bda9 /src/test/run-pass/const-struct.rs
parent4101587a88d719659d2e30feaad8437c55af9150 (diff)
downloadrust-318e534895f20e7991abbc644eec311816010ef1.tar.gz
rust-318e534895f20e7991abbc644eec311816010ef1.zip
rustc: Implement explicit self for Eq and Ord. r=graydon
Diffstat (limited to 'src/test/run-pass/const-struct.rs')
-rw-r--r--src/test/run-pass/const-struct.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/test/run-pass/const-struct.rs b/src/test/run-pass/const-struct.rs
index dd6adadf985..3e292a4528d 100644
--- a/src/test/run-pass/const-struct.rs
+++ b/src/test/run-pass/const-struct.rs
@@ -2,10 +2,12 @@
 struct foo { a: int, b: int, c: int }
 
 impl foo : cmp::Eq {
-    pure fn eq(other: &foo) -> bool {
-        self.a == (*other).a && self.b == (*other).b && self.c == (*other).c
+    pure fn eq(&self, other: &foo) -> bool {
+        (*self).a == (*other).a &&
+        (*self).b == (*other).b &&
+        (*self).c == (*other).c
     }
-    pure fn ne(other: &foo) -> bool { !self.eq(other) }
+    pure fn ne(&self, other: &foo) -> bool { !(*self).eq(other) }
 }
 
 const x : foo = foo { a:1, b:2, c: 3 };