diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2014-02-07 00:38:33 +0200 |
|---|---|---|
| committer | Eduard Burtescu <edy.burt@gmail.com> | 2014-02-07 00:38:33 +0200 |
| commit | b2d30b72bfaa1f36808151e5825073cdff2e7ea7 (patch) | |
| tree | 14ff6b505eeee456236727940e5804e3e812b1b5 /src/test/run-pass/explicit-self.rs | |
| parent | c13a929d58c3f866687ccf12cc33b2b59a2e10b8 (diff) | |
| download | rust-b2d30b72bfaa1f36808151e5825073cdff2e7ea7.tar.gz rust-b2d30b72bfaa1f36808151e5825073cdff2e7ea7.zip | |
Removed @self and @Trait.
Diffstat (limited to 'src/test/run-pass/explicit-self.rs')
| -rw-r--r-- | src/test/run-pass/explicit-self.rs | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/test/run-pass/explicit-self.rs b/src/test/run-pass/explicit-self.rs index 65e6e384c5f..1076fc1662f 100644 --- a/src/test/run-pass/explicit-self.rs +++ b/src/test/run-pass/explicit-self.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[feature(managed_boxes)]; - static tau: f64 = 2.0*3.14159265358979323; struct Point {x: f64, y: f64} @@ -49,7 +47,7 @@ struct thing { #[deriving(Clone)] struct A { - a: @int + a: int } fn thing(x: A) -> thing { @@ -59,26 +57,20 @@ fn thing(x: A) -> thing { } impl thing { - pub fn foo(@self) -> int { *self.x.a } - pub fn bar(~self) -> int { *self.x.a } - pub fn quux(&self) -> int { *self.x.a } + pub fn bar(~self) -> 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 } + pub fn spam(self) -> int { self.x.a } } trait Nus { fn f(&self); } impl Nus for thing { fn f(&self) {} } pub fn main() { - - let x = @thing(A {a: @10}); - assert_eq!(x.foo(), 10); - assert_eq!(x.quux(), 10); - - let y = ~thing(A {a: @10}); + let y = ~thing(A {a: 10}); assert_eq!(y.clone().bar(), 10); assert_eq!(y.quux(), 10); - let z = thing(A {a: @11}); + let z = thing(A {a: 11}); assert_eq!(z.spam(), 11); } |
