about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2014-07-07 23:19:35 -0700
committerPatrick Walton <pcwalton@mimiga.net>2014-07-16 23:16:12 -0700
commit00c70d1a803e62ccbe2545d5c5522f4dcd6953b9 (patch)
tree162e3b98fc57b10079f3ed04ff2144bafbfabae4
parentfe49cbeb82deaa771dcaa4f512cb9f967beb5996 (diff)
downloadrust-00c70d1a803e62ccbe2545d5c5522f4dcd6953b9.tar.gz
rust-00c70d1a803e62ccbe2545d5c5522f4dcd6953b9.zip
librustc: Allow the new UFCS explicit self in trait definitions, and
remove `~self` from the test suite.
-rw-r--r--src/librustdoc/clean/mod.rs2
-rw-r--r--src/test/compile-fail/issue-5153.rs4
-rw-r--r--src/test/compile-fail/lint-unused-mut-self.rs2
-rw-r--r--src/test/compile-fail/object-pointer-types.rs2
-rw-r--r--src/test/debuginfo/generic-method-on-generic-struct.rs2
-rw-r--r--src/test/debuginfo/method-on-enum.rs2
-rw-r--r--src/test/debuginfo/method-on-generic-struct.rs2
-rw-r--r--src/test/debuginfo/method-on-struct.rs2
-rw-r--r--src/test/debuginfo/method-on-trait.rs4
-rw-r--r--src/test/debuginfo/method-on-tuple-struct.rs2
-rw-r--r--src/test/debuginfo/self-in-default-method.rs2
-rw-r--r--src/test/debuginfo/self-in-generic-default-method.rs2
-rw-r--r--src/test/run-pass/autoderef-method-on-trait.rs4
-rw-r--r--src/test/run-pass/autoderef-method-twice-but-not-thrice.rs4
-rw-r--r--src/test/run-pass/autoderef-method-twice.rs4
-rw-r--r--src/test/run-pass/autoderef-method.rs4
-rw-r--r--src/test/run-pass/explicit-self-objects-uniq.rs4
-rw-r--r--src/test/run-pass/explicit-self.rs2
-rw-r--r--src/test/run-pass/issue-7320.rs2
-rw-r--r--src/test/run-pass/objects-owned-object-owned-method.rs4
-rw-r--r--src/test/run-pass/self-in-mut-slot-default-method.rs2
-rw-r--r--src/test/run-pass/uniq-self-in-mut-slot.rs4
22 files changed, 31 insertions, 31 deletions
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs
index 5be66885320..c94759d7d7e 100644
--- a/src/librustdoc/clean/mod.rs
+++ b/src/librustdoc/clean/mod.rs
@@ -1003,7 +1003,7 @@ impl Clean<Item> for ty::Method {
                 };
                 let s = match s {
                     ty::ByReferenceExplicitSelfCategory(..) => {
-                        match ty::get(*self.fty.sig.inputs[0]).sty {
+                        match ty::get(self.fty.sig.inputs[0]).sty {
                             ty::ty_rptr(r, mt) => {
                                 SelfBorrowed(r.clean(), mt.mutbl.clean())
                             }
diff --git a/src/test/compile-fail/issue-5153.rs b/src/test/compile-fail/issue-5153.rs
index f8c1a914642..57a158d2438 100644
--- a/src/test/compile-fail/issue-5153.rs
+++ b/src/test/compile-fail/issue-5153.rs
@@ -11,11 +11,11 @@
 // error-pattern: type `&Foo` does not implement any method in scope named `foo`
 
 trait Foo {
-    fn foo(~self);
+    fn foo(self: Box<Self>);
 }
 
 impl Foo for int {
-    fn foo(~self) { }
+    fn foo(self: Box<int>) { }
 }
 
 fn main() {
diff --git a/src/test/compile-fail/lint-unused-mut-self.rs b/src/test/compile-fail/lint-unused-mut-self.rs
index 84c484a91e2..fc19a1ba06f 100644
--- a/src/test/compile-fail/lint-unused-mut-self.rs
+++ b/src/test/compile-fail/lint-unused-mut-self.rs
@@ -16,7 +16,7 @@
 struct Foo;
 impl Foo {
     fn foo(mut self) {} //~ ERROR: variable does not need to be mutable
-    fn bar(mut ~self) {} //~ ERROR: variable does not need to be mutable
+    fn bar(mut self: Box<Foo>) {} //~ ERROR: variable does not need to be mutable
 }
 
 fn main() {}
diff --git a/src/test/compile-fail/object-pointer-types.rs b/src/test/compile-fail/object-pointer-types.rs
index 8868ddd4dfa..84e7f98a40d 100644
--- a/src/test/compile-fail/object-pointer-types.rs
+++ b/src/test/compile-fail/object-pointer-types.rs
@@ -13,7 +13,7 @@ trait Foo {
     fn borrowed(&self);
     fn borrowed_mut(&mut self);
 
-    fn owned(~self);
+    fn owned(self: Box<Self>);
 }
 
 fn borrowed_receiver(x: &Foo) {
diff --git a/src/test/debuginfo/generic-method-on-generic-struct.rs b/src/test/debuginfo/generic-method-on-generic-struct.rs
index 0f05eea6282..2e43dcdeb49 100644
--- a/src/test/debuginfo/generic-method-on-generic-struct.rs
+++ b/src/test/debuginfo/generic-method-on-generic-struct.rs
@@ -134,7 +134,7 @@ impl<T1> Struct<T1> {
         arg1
     }
 
-    fn self_owned<T2>(~self, arg1: int, arg2: T2) -> int {
+    fn self_owned<T2>(self: Box<Struct<T1>>, arg1: int, arg2: T2) -> int {
         zzz(); // #break
         arg1
     }
diff --git a/src/test/debuginfo/method-on-enum.rs b/src/test/debuginfo/method-on-enum.rs
index f3d723e88bc..74f4882bd4b 100644
--- a/src/test/debuginfo/method-on-enum.rs
+++ b/src/test/debuginfo/method-on-enum.rs
@@ -136,7 +136,7 @@ impl Enum {
         arg1 + arg2
     }
 
-    fn self_owned(~self, arg1: int, arg2: int) -> int {
+    fn self_owned(self: Box<Enum>, arg1: int, arg2: int) -> int {
         zzz(); // #break
         arg1 + arg2
     }
diff --git a/src/test/debuginfo/method-on-generic-struct.rs b/src/test/debuginfo/method-on-generic-struct.rs
index 489ea114e1f..590a821fcb6 100644
--- a/src/test/debuginfo/method-on-generic-struct.rs
+++ b/src/test/debuginfo/method-on-generic-struct.rs
@@ -134,7 +134,7 @@ impl<T> Struct<T> {
         arg1 + arg2
     }
 
-    fn self_owned(~self, arg1: int, arg2: int) -> int {
+    fn self_owned(self: Box<Struct<T>>, arg1: int, arg2: int) -> int {
         zzz(); // #break
         arg1 + arg2
     }
diff --git a/src/test/debuginfo/method-on-struct.rs b/src/test/debuginfo/method-on-struct.rs
index f2db6e3af47..5ea89f15489 100644
--- a/src/test/debuginfo/method-on-struct.rs
+++ b/src/test/debuginfo/method-on-struct.rs
@@ -133,7 +133,7 @@ impl Struct {
         self.x + arg1 + arg2
     }
 
-    fn self_owned(~self, arg1: int, arg2: int) -> int {
+    fn self_owned(self: Box<Struct>, arg1: int, arg2: int) -> int {
         zzz(); // #break
         self.x + arg1 + arg2
     }
diff --git a/src/test/debuginfo/method-on-trait.rs b/src/test/debuginfo/method-on-trait.rs
index e38aace11b9..1fc136ac1f6 100644
--- a/src/test/debuginfo/method-on-trait.rs
+++ b/src/test/debuginfo/method-on-trait.rs
@@ -124,7 +124,7 @@ struct Struct {
 trait Trait {
     fn self_by_ref(&self, arg1: int, arg2: int) -> int;
     fn self_by_val(self, arg1: int, arg2: int) -> int;
-    fn self_owned(~self, arg1: int, arg2: int) -> int;
+    fn self_owned(self: Box<Self>, arg1: int, arg2: int) -> int;
 }
 
 impl Trait for Struct {
@@ -139,7 +139,7 @@ impl Trait for Struct {
         self.x + arg1 + arg2
     }
 
-    fn self_owned(~self, arg1: int, arg2: int) -> int {
+    fn self_owned(self: Box<Struct>, arg1: int, arg2: int) -> int {
         zzz(); // #break
         self.x + arg1 + arg2
     }
diff --git a/src/test/debuginfo/method-on-tuple-struct.rs b/src/test/debuginfo/method-on-tuple-struct.rs
index 6f8a6182063..d4051e333c1 100644
--- a/src/test/debuginfo/method-on-tuple-struct.rs
+++ b/src/test/debuginfo/method-on-tuple-struct.rs
@@ -131,7 +131,7 @@ impl TupleStruct {
         arg1 + arg2
     }
 
-    fn self_owned(~self, arg1: int, arg2: int) -> int {
+    fn self_owned(self: Box<TupleStruct>, arg1: int, arg2: int) -> int {
         zzz(); // #break
         arg1 + arg2
     }
diff --git a/src/test/debuginfo/self-in-default-method.rs b/src/test/debuginfo/self-in-default-method.rs
index ddca9bf0792..4268c0adcc3 100644
--- a/src/test/debuginfo/self-in-default-method.rs
+++ b/src/test/debuginfo/self-in-default-method.rs
@@ -133,7 +133,7 @@ trait Trait {
         arg1 + arg2
     }
 
-    fn self_owned(~self, arg1: int, arg2: int) -> int {
+    fn self_owned(self: Box<Self>, arg1: int, arg2: int) -> int {
         zzz(); // #break
         arg1 + arg2
     }
diff --git a/src/test/debuginfo/self-in-generic-default-method.rs b/src/test/debuginfo/self-in-generic-default-method.rs
index 57ffc4a2e19..35f3dffa0b6 100644
--- a/src/test/debuginfo/self-in-generic-default-method.rs
+++ b/src/test/debuginfo/self-in-generic-default-method.rs
@@ -134,7 +134,7 @@ trait Trait {
         arg1
     }
 
-    fn self_owned<T>(~self, arg1: int, arg2: T) -> int {
+    fn self_owned<T>(self: Box<Self>, arg1: int, arg2: T) -> int {
         zzz(); // #break
         arg1
     }
diff --git a/src/test/run-pass/autoderef-method-on-trait.rs b/src/test/run-pass/autoderef-method-on-trait.rs
index e50825a401f..f13f598fda2 100644
--- a/src/test/run-pass/autoderef-method-on-trait.rs
+++ b/src/test/run-pass/autoderef-method-on-trait.rs
@@ -10,11 +10,11 @@
 
 
 trait double {
-    fn double(~self) -> uint;
+    fn double(self: Box<Self>) -> uint;
 }
 
 impl double for uint {
-    fn double(~self) -> uint { *self * 2u }
+    fn double(self: Box<uint>) -> uint { *self * 2u }
 }
 
 pub fn main() {
diff --git a/src/test/run-pass/autoderef-method-twice-but-not-thrice.rs b/src/test/run-pass/autoderef-method-twice-but-not-thrice.rs
index 7acd54788a8..856ee686db3 100644
--- a/src/test/run-pass/autoderef-method-twice-but-not-thrice.rs
+++ b/src/test/run-pass/autoderef-method-twice-but-not-thrice.rs
@@ -10,11 +10,11 @@
 
 
 trait double {
-    fn double(~self) -> uint;
+    fn double(self: Box<Self>) -> uint;
 }
 
 impl double for Box<uint> {
-    fn double(~self) -> uint { **self * 2u }
+    fn double(self: Box<Box<uint>>) -> uint { **self * 2u }
 }
 
 pub fn main() {
diff --git a/src/test/run-pass/autoderef-method-twice.rs b/src/test/run-pass/autoderef-method-twice.rs
index a8b6b6f74f4..94da61483ea 100644
--- a/src/test/run-pass/autoderef-method-twice.rs
+++ b/src/test/run-pass/autoderef-method-twice.rs
@@ -9,11 +9,11 @@
 // except according to those terms.
 
 trait double {
-    fn double(~self) -> uint;
+    fn double(self: Box<Self>) -> uint;
 }
 
 impl double for uint {
-    fn double(~self) -> uint { *self * 2u }
+    fn double(self: Box<uint>) -> uint { *self * 2u }
 }
 
 pub fn main() {
diff --git a/src/test/run-pass/autoderef-method.rs b/src/test/run-pass/autoderef-method.rs
index 4c4ebdc94f0..2e9751ce6ac 100644
--- a/src/test/run-pass/autoderef-method.rs
+++ b/src/test/run-pass/autoderef-method.rs
@@ -9,11 +9,11 @@
 // except according to those terms.
 
 trait double {
-    fn double(~self) -> uint;
+    fn double(self: Box<Self>) -> uint;
 }
 
 impl double for uint {
-    fn double(~self) -> uint { *self * 2u }
+    fn double(self: Box<uint>) -> uint { *self * 2u }
 }
 
 pub fn main() {
diff --git a/src/test/run-pass/explicit-self-objects-uniq.rs b/src/test/run-pass/explicit-self-objects-uniq.rs
index 595bb4f6b9e..e566f218aa8 100644
--- a/src/test/run-pass/explicit-self-objects-uniq.rs
+++ b/src/test/run-pass/explicit-self-objects-uniq.rs
@@ -10,7 +10,7 @@
 
 
 trait Foo {
-    fn f(~self);
+    fn f(self: Box<Self>);
 }
 
 struct S {
@@ -18,7 +18,7 @@ struct S {
 }
 
 impl Foo for S {
-    fn f(~self) {
+    fn f(self: Box<S>) {
         assert_eq!(self.x, 3);
     }
 }
diff --git a/src/test/run-pass/explicit-self.rs b/src/test/run-pass/explicit-self.rs
index 6c2e17046d3..32ac14ab180 100644
--- a/src/test/run-pass/explicit-self.rs
+++ b/src/test/run-pass/explicit-self.rs
@@ -57,7 +57,7 @@ fn thing(x: A) -> thing {
 }
 
 impl thing {
-    pub fn bar(~self) -> int { self.x.a }
+    pub fn bar(self: Box<thing>) -> int { self.x.a }
     pub fn quux(&self) -> int { self.x.a }
     pub fn baz<'a>(&'a self) -> &'a A { &self.x }
     pub fn spam(self) -> int { self.x.a }
diff --git a/src/test/run-pass/issue-7320.rs b/src/test/run-pass/issue-7320.rs
index 99ed4288a7e..c7087f8e3a8 100644
--- a/src/test/run-pass/issue-7320.rs
+++ b/src/test/run-pass/issue-7320.rs
@@ -10,7 +10,7 @@
 
 
 trait Foo {
-    fn foo(~self) { bar(self as Box<Foo>); }
+    fn foo(self: Box<Self>) { bar(self as Box<Foo>); }
 }
 
 fn bar(_b: Box<Foo>) { }
diff --git a/src/test/run-pass/objects-owned-object-owned-method.rs b/src/test/run-pass/objects-owned-object-owned-method.rs
index 540593c43fb..14ddc5d660f 100644
--- a/src/test/run-pass/objects-owned-object-owned-method.rs
+++ b/src/test/run-pass/objects-owned-object-owned-method.rs
@@ -14,7 +14,7 @@
 
 
 trait FooTrait {
-    fn foo(~self) -> uint;
+    fn foo(self: Box<Self>) -> uint;
 }
 
 struct BarStruct {
@@ -22,7 +22,7 @@ struct BarStruct {
 }
 
 impl FooTrait for BarStruct {
-    fn foo(~self) -> uint {
+    fn foo(self: Box<BarStruct>) -> uint {
         self.x
     }
 }
diff --git a/src/test/run-pass/self-in-mut-slot-default-method.rs b/src/test/run-pass/self-in-mut-slot-default-method.rs
index 8ab27cfb4ee..b4a46f34015 100644
--- a/src/test/run-pass/self-in-mut-slot-default-method.rs
+++ b/src/test/run-pass/self-in-mut-slot-default-method.rs
@@ -19,7 +19,7 @@ trait Changer {
         self
     }
 
-    fn change_again(mut ~self) -> Box<Self> {
+    fn change_again(mut self: Box<Self>) -> Box<Self> {
         self.set_to(45);
         self
     }
diff --git a/src/test/run-pass/uniq-self-in-mut-slot.rs b/src/test/run-pass/uniq-self-in-mut-slot.rs
index 3700e02051a..4d7830e1cdc 100644
--- a/src/test/run-pass/uniq-self-in-mut-slot.rs
+++ b/src/test/run-pass/uniq-self-in-mut-slot.rs
@@ -14,11 +14,11 @@ struct X {
 }
 
 trait Changer {
-    fn change(mut ~self) -> Box<Self>;
+    fn change(mut self: Box<Self>) -> Box<Self>;
 }
 
 impl Changer for X {
-    fn change(mut ~self) -> Box<X> {
+    fn change(mut self: Box<X>) -> Box<X> {
         self.a = 55;
         self
     }