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 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); } impl Foo for int { - fn foo(~self) { } + fn foo(self: Box) { } } 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) {} //~ 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); } 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 Struct { arg1 } - fn self_owned(~self, arg1: int, arg2: T2) -> int { + fn self_owned(self: Box>, 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, 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 Struct { arg1 + arg2 } - fn self_owned(~self, arg1: int, arg2: int) -> int { + fn self_owned(self: Box>, 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, 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, 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, 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, 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, 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(~self, arg1: int, arg2: T) -> int { + fn self_owned(self: Box, 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) -> uint; } impl double for uint { - fn double(~self) -> uint { *self * 2u } + fn double(self: Box) -> 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) -> uint; } impl double for Box { - fn double(~self) -> uint { **self * 2u } + fn double(self: Box>) -> 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) -> uint; } impl double for uint { - fn double(~self) -> uint { *self * 2u } + fn double(self: Box) -> 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) -> uint; } impl double for uint { - fn double(~self) -> uint { *self * 2u } + fn double(self: Box) -> 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); } struct S { @@ -18,7 +18,7 @@ struct S { } impl Foo for S { - fn f(~self) { + fn f(self: Box) { 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) -> 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); } + fn foo(self: Box) { bar(self as Box); } } fn bar(_b: Box) { } 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) -> uint; } struct BarStruct { @@ -22,7 +22,7 @@ struct BarStruct { } impl FooTrait for BarStruct { - fn foo(~self) -> uint { + fn foo(self: Box) -> 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 { + fn change_again(mut self: Box) -> Box { 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; + fn change(mut self: Box) -> Box; } impl Changer for X { - fn change(mut ~self) -> Box { + fn change(mut self: Box) -> Box { self.a = 55; self }