about summary refs log tree commit diff
path: root/src/test/run-pass/static-impl.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2013-03-12 19:32:14 -0700
committerPatrick Walton <pcwalton@mimiga.net>2013-03-13 20:07:10 -0700
commit8fa66e8e07ca565119de195ceefb20cff50ae1ea (patch)
treef9ae9910b40b04ae62daff56b8de1ae002765d2e /src/test/run-pass/static-impl.rs
parenta410652bc953137c8d579f218c2e3e68a9ef8c1c (diff)
downloadrust-8fa66e8e07ca565119de195ceefb20cff50ae1ea.tar.gz
rust-8fa66e8e07ca565119de195ceefb20cff50ae1ea.zip
librustc: Remove implicit self from the language, except for old-style drop blocks.
Diffstat (limited to 'src/test/run-pass/static-impl.rs')
-rw-r--r--src/test/run-pass/static-impl.rs26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/test/run-pass/static-impl.rs b/src/test/run-pass/static-impl.rs
index 2ee6f631ea5..fe5a6bd2bd5 100644
--- a/src/test/run-pass/static-impl.rs
+++ b/src/test/run-pass/static-impl.rs
@@ -11,42 +11,42 @@
 // xfail-fast
 
 pub trait plus {
-    fn plus() -> int;
+    fn plus(&self) -> int;
 }
 
 mod a {
     use plus;
-    impl plus for uint { fn plus() -> int { self as int + 20 } }
+    impl plus for uint { fn plus(&self) -> int { self as int + 20 } }
 }
 
 mod b {
     use plus;
-    impl plus for ~str { fn plus() -> int { 200 } }
+    impl plus for ~str { fn plus(&self) -> int { 200 } }
 }
 
 trait uint_utils {
-    fn str() -> ~str;
-    fn multi(f: &fn(uint));
+    fn str(self) -> ~str;
+    fn multi(self, f: &fn(uint));
 }
 
 impl uint_utils for uint {
-    fn str() -> ~str { uint::to_str(self) }
-    fn multi(f: &fn(uint)) {
+    fn str(self) -> ~str { uint::to_str(self) }
+    fn multi(self, f: &fn(uint)) {
         let mut c = 0u;
         while c < self { f(c); c += 1u; }
     }
 }
 
 trait vec_utils<T> {
-    fn length_() -> uint;
-    fn iter_(f: &fn(&T));
-    fn map_<U:Copy>(f: &fn(&T) -> U) -> ~[U];
+    fn length_(&self, ) -> uint;
+    fn iter_(&self, f: &fn(&T));
+    fn map_<U:Copy>(&self, f: &fn(&T) -> U) -> ~[U];
 }
 
 impl<T> vec_utils<T> for ~[T] {
-    fn length_() -> uint { vec::len(self) }
-    fn iter_(f: &fn(&T)) { for self.each |x| { f(x); } }
-    fn map_<U:Copy>(f: &fn(&T) -> U) -> ~[U] {
+    fn length_(&self) -> uint { vec::len(self) }
+    fn iter_(&self, f: &fn(&T)) { for self.each |x| { f(x); } }
+    fn map_<U:Copy>(&self, f: &fn(&T) -> U) -> ~[U] {
         let mut r = ~[];
         for self.each |elt| { r += ~[f(elt)]; }
         r