librustc: Remove implicit self from the language, except for old-style drop blocks.

This commit is contained in:
Patrick Walton 2013-03-12 19:32:14 -07:00
parent a410652bc9
commit 8fa66e8e07
133 changed files with 339 additions and 395 deletions

View file

@ -9,6 +9,6 @@
// except according to those terms.
trait me {
fn me() -> uint;
fn me(&self) -> uint;
}
impl me for uint { fn me() -> uint { self } }
impl me for uint { fn me(&self) -> uint { self } }

View file

@ -17,7 +17,7 @@ pub mod kitties {
}
pub impl cat {
fn speak() {}
fn speak(&self) {}
}
pub fn cat(in_x : uint, in_y : int) -> cat {

View file

@ -11,12 +11,12 @@
#[link(name="cci_impl_lib", vers="0.0")];
trait uint_helpers {
fn to(v: uint, f: &fn(uint));
fn to(self, v: uint, f: &fn(uint));
}
impl uint_helpers for uint {
#[inline]
fn to(v: uint, f: &fn(uint)) {
fn to(self, v: uint, f: &fn(uint)) {
let mut i = self;
while i < v {
f(i);

View file

@ -16,11 +16,11 @@ pub mod name_pool {
pub type name_pool = ();
pub trait add {
fn add(s: ~str);
fn add(&self, s: ~str);
}
impl add for name_pool {
fn add(s: ~str) {
fn add(&self, s: ~str) {
}
}
}
@ -31,11 +31,11 @@ pub mod rust {
pub type rt = @();
pub trait cx {
fn cx();
fn cx(&self);
}
impl cx for rt {
fn cx() {
fn cx(&self) {
}
}
}

View file

@ -14,10 +14,10 @@
type t1 = uint;
trait foo {
fn foo();
fn foo(&self);
}
impl foo for ~str {
fn foo() {}
fn foo(&self) {}
}

View file

@ -56,5 +56,5 @@ fn context_res() -> context_res {
pub type context = arc_destruct<context_res>;
pub impl context {
fn socket() { }
fn socket(&self) { }
}

View file

@ -12,13 +12,13 @@
pub struct S(());
pub impl S {
fn foo() { }
fn foo(&self) { }
}
pub trait T {
fn bar();
fn bar(&self);
}
impl T for S {
fn bar() { }
fn bar(&self) { }
}

View file

@ -9,11 +9,11 @@
// except according to those terms.
trait x {
fn use_x<T>();
fn use_x<T>(&self);
}
struct y(());
impl x for y {
fn use_x<T>() {
fn use_x<T>(&self) {
struct foo { //~ ERROR quux
i: ()
}

View file

@ -8,14 +8,14 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
pub trait Foo { fn f() -> int; }
pub trait Bar { fn g() -> int; }
pub trait Baz { fn h() -> int; }
pub trait Foo { fn f(&self) -> int; }
pub trait Bar { fn g(&self) -> int; }
pub trait Baz { fn h(&self) -> int; }
pub struct A { x: int }
impl Foo for A { fn f() -> int { 10 } }
impl Bar for A { fn g() -> int { 20 } }
impl Baz for A { fn h() -> int { 30 } }
impl Foo for A { fn f(&self) -> int { 10 } }
impl Bar for A { fn g(&self) -> int { 20 } }
impl Baz for A { fn h(&self) -> int { 30 } }

View file

@ -8,9 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
trait Foo { fn f() -> int; }
trait Bar { fn g() -> int; }
trait Baz { fn h() -> int; }
trait Foo { fn f(&self) -> int; }
trait Bar { fn g(&self) -> int; }
trait Baz { fn h(&self) -> int; }
trait Quux: Foo + Bar + Baz { }

View file

@ -10,7 +10,7 @@
pub trait Foo {
fn f() -> int;
fn f(&self) -> int;
}
pub struct A {
@ -18,5 +18,5 @@ pub struct A {
}
impl Foo for A {
fn f() -> int { 10 }
fn f(&self) -> int { 10 }
}