about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2013-01-30 19:42:06 -0800
committerPatrick Walton <pcwalton@mimiga.net>2013-01-30 19:52:45 -0800
commit366812a5c3b1933a9175c39af2567ce348b5281d (patch)
tree19d1b67d1f4df41a709f6e3f4f661bf1da24ed63
parent63b2b9c4a89a13fb6855086d183272bd5e360a65 (diff)
downloadrust-366812a5c3b1933a9175c39af2567ce348b5281d.tar.gz
rust-366812a5c3b1933a9175c39af2567ce348b5281d.zip
librustc: Change `self` as a type to `Self` everywhere. r=brson
-rw-r--r--doc/tutorial.md8
-rw-r--r--src/libcore/clone.rs2
-rw-r--r--src/libcore/cmp.rs12
-rw-r--r--src/libcore/container.rs14
-rw-r--r--src/libcore/from_str.rs2
-rw-r--r--src/libcore/iter.rs2
-rw-r--r--src/libcore/num.rs20
-rw-r--r--src/libcore/path.rs25
-rw-r--r--src/libcore/ptr.rs2
-rw-r--r--src/libcore/str.rs6
-rw-r--r--src/librustc/middle/astencode.rs2
-rw-r--r--src/librustc/middle/resolve.rs2
-rw-r--r--src/librustc/middle/typeck/infer/lattice.rs6
-rw-r--r--src/librustc/middle/typeck/infer/unify.rs4
-rw-r--r--src/libstd/cmp.rs4
-rw-r--r--src/libstd/flatpipes.rs4
-rw-r--r--src/libstd/serialize.rs2
-rw-r--r--src/libsyntax/codemap.rs2
-rw-r--r--src/test/auxiliary/static-methods-crate.rs2
-rw-r--r--src/test/auxiliary/static_fn_inline_xc_aux.rs2
-rw-r--r--src/test/auxiliary/static_fn_trait_xc_aux.rs2
-rw-r--r--src/test/auxiliary/trait_inheritance_overloading_xc.rs2
-rw-r--r--src/test/compile-fail/infinite-instantiation.rs2
-rw-r--r--src/test/compile-fail/missing-derivable-attr.rs2
-rw-r--r--src/test/compile-fail/selftype-astparam.rs2
-rw-r--r--src/test/compile-fail/selftype-traittype.rs2
-rw-r--r--src/test/compile-fail/trait-impl-different-num-params.rs2
-rw-r--r--src/test/compile-fail/trait-test-2.rs2
-rw-r--r--src/test/run-pass/static-method-in-trait-with-tps-intracrate.rs4
-rw-r--r--src/test/run-pass/static-method-test.rs4
-rw-r--r--src/test/run-pass/static-methods-in-traits.rs2
-rw-r--r--src/test/run-pass/static-methods-in-traits2.rs4
-rw-r--r--src/test/run-pass/trait-inheritance-num0.rs4
-rw-r--r--src/test/run-pass/trait-inheritance-overloading.rs2
-rw-r--r--src/test/run-pass/trait-inheritance-self.rs2
-rw-r--r--src/test/run-pass/trait-inheritance-static.rs2
-rw-r--r--src/test/run-pass/trait-inheritance-static2.rs2
-rw-r--r--src/test/run-pass/trait-inheritance-subst.rs2
-rw-r--r--src/test/run-pass/trait-inheritance-subst2.rs2
-rw-r--r--src/test/run-pass/typeclasses-eq-example-static.rs4
-rw-r--r--src/test/run-pass/typeclasses-eq-example.rs4
41 files changed, 87 insertions, 90 deletions
diff --git a/doc/tutorial.md b/doc/tutorial.md
index 9df646fbf91..6ccf13a8d4d 100644
--- a/doc/tutorial.md
+++ b/doc/tutorial.md
@@ -1993,10 +1993,10 @@ trait, `self` is a type, and in an impl, `self` is a value. The
 following trait describes types that support an equality operation:
 
 ~~~~
-// In a trait, `self` refers both to the self argument
-// and to the type implementing the trait
+// In a trait, `self` refers to the self argument.
+// `Self` refers to the type implementing the trait.
 trait Eq {
-    fn equals(&self, other: &self) -> bool;
+    fn equals(&self, other: &Self) -> bool;
 }
 
 // In an impl, `self` refers just to the value of the receiver
@@ -2015,7 +2015,7 @@ the method name with the trait name.
 The compiler will use type inference to decide which implementation to call.
 
 ~~~~
-trait Shape { static fn new(area: float) -> self; }
+trait Shape { static fn new(area: float) -> Self; }
 # use float::consts::pi;
 # use float::sqrt;
 struct Circle { radius: float }
diff --git a/src/libcore/clone.rs b/src/libcore/clone.rs
index 6fbcf2df454..7b66c7c934b 100644
--- a/src/libcore/clone.rs
+++ b/src/libcore/clone.rs
@@ -12,7 +12,7 @@
 Clonable types are copied with the clone method
 */
 pub trait Clone {
-    fn clone(&self) -> self;
+    fn clone(&self) -> Self;
 }
 
 impl (): Clone {
diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs
index 05dc74fb3c8..038ea2ba675 100644
--- a/src/libcore/cmp.rs
+++ b/src/libcore/cmp.rs
@@ -37,8 +37,8 @@ and `Eq` to overload the `==` and `!=` operators.
 */
 #[lang="eq"]
 pub trait Eq {
-    pure fn eq(&self, other: &self) -> bool;
-    pure fn ne(&self, other: &self) -> bool;
+    pure fn eq(&self, other: &Self) -> bool;
+    pure fn ne(&self, other: &Self) -> bool;
 }
 
 /**
@@ -53,10 +53,10 @@ pub trait Eq {
 */
 #[lang="ord"]
 pub trait Ord {
-    pure fn lt(&self, other: &self) -> bool;
-    pure fn le(&self, other: &self) -> bool;
-    pure fn ge(&self, other: &self) -> bool;
-    pure fn gt(&self, other: &self) -> bool;
+    pure fn lt(&self, other: &Self) -> bool;
+    pure fn le(&self, other: &Self) -> bool;
+    pure fn ge(&self, other: &Self) -> bool;
+    pure fn gt(&self, other: &Self) -> bool;
 }
 
 #[inline(always)]
diff --git a/src/libcore/container.rs b/src/libcore/container.rs
index 0a79a0ae19d..c8be690a38c 100644
--- a/src/libcore/container.rs
+++ b/src/libcore/container.rs
@@ -68,23 +68,23 @@ pub trait Set<T>: Mutable {
 
     /// Return true if the set has no elements in common with `other`.
     /// This is equivalent to checking for an empty intersection.
-    pure fn is_disjoint(&self, other: &self) -> bool;
+    pure fn is_disjoint(&self, other: &Self) -> bool;
 
     /// Return true if the set is a subset of another
-    pure fn is_subset(&self, other: &self) -> bool;
+    pure fn is_subset(&self, other: &Self) -> bool;
 
     /// Return true if the set is a superset of another
-    pure fn is_superset(&self, other: &self) -> bool;
+    pure fn is_superset(&self, other: &Self) -> bool;
 
     /// Visit the values representing the difference
-    pure fn difference(&self, other: &self, f: fn(&T) -> bool);
+    pure fn difference(&self, other: &Self, f: fn(&T) -> bool);
 
     /// Visit the values representing the symmetric difference
-    pure fn symmetric_difference(&self, other: &self, f: fn(&T) -> bool);
+    pure fn symmetric_difference(&self, other: &Self, f: fn(&T) -> bool);
 
     /// Visit the values representing the intersection
-    pure fn intersection(&self, other: &self, f: fn(&T) -> bool);
+    pure fn intersection(&self, other: &Self, f: fn(&T) -> bool);
 
     /// Visit the values representing the union
-    pure fn union(&self, other: &self, f: fn(&T) -> bool);
+    pure fn union(&self, other: &Self, f: fn(&T) -> bool);
 }
diff --git a/src/libcore/from_str.rs b/src/libcore/from_str.rs
index f6dc385778e..c3fda7eb8bd 100644
--- a/src/libcore/from_str.rs
+++ b/src/libcore/from_str.rs
@@ -17,6 +17,6 @@
 use option::Option;
 
 pub trait FromStr {
-    static pure fn from_str(s: &str) -> Option<self>;
+    static pure fn from_str(s: &str) -> Option<Self>;
 }
 
diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs
index 658e250bc36..69f7bd3f478 100644
--- a/src/libcore/iter.rs
+++ b/src/libcore/iter.rs
@@ -85,7 +85,7 @@ pub trait Buildable<A> {
      *             onto the sequence being constructed.
      */
      static pure fn build_sized(size: uint,
-                                builder: fn(push: pure fn(A))) -> self;
+                                builder: fn(push: pure fn(A))) -> Self;
 }
 
 #[inline(always)]
diff --git a/src/libcore/num.rs b/src/libcore/num.rs
index 6eb22e53a24..5680e3116bf 100644
--- a/src/libcore/num.rs
+++ b/src/libcore/num.rs
@@ -12,26 +12,26 @@
 
 pub trait Num {
     // FIXME: Trait composition. (#2616)
-    pure fn add(&self, other: &self) -> self;
-    pure fn sub(&self, other: &self) -> self;
-    pure fn mul(&self, other: &self) -> self;
-    pure fn div(&self, other: &self) -> self;
-    pure fn modulo(&self, other: &self) -> self;
-    pure fn neg(&self) -> self;
+    pure fn add(&self, other: &Self) -> Self;
+    pure fn sub(&self, other: &Self) -> Self;
+    pure fn mul(&self, other: &Self) -> Self;
+    pure fn div(&self, other: &Self) -> Self;
+    pure fn modulo(&self, other: &Self) -> Self;
+    pure fn neg(&self) -> Self;
 
     pure fn to_int(&self) -> int;
-    static pure fn from_int(n: int) -> self;
+    static pure fn from_int(n: int) -> Self;
 }
 
 pub trait IntConvertible {
     pure fn to_int(&self) -> int;
-    static pure fn from_int(n: int) -> self;
+    static pure fn from_int(n: int) -> Self;
 }
 
 pub trait Zero {
-    static pure fn zero() -> self;
+    static pure fn zero() -> Self;
 }
 
 pub trait One {
-    static pure fn one() -> self;
+    static pure fn one() -> Self;
 }
diff --git a/src/libcore/path.rs b/src/libcore/path.rs
index 7f5f334ac1f..2f9b2967775 100644
--- a/src/libcore/path.rs
+++ b/src/libcore/path.rs
@@ -48,28 +48,27 @@ pub pure fn PosixPath(s: &str) -> PosixPath {
 }
 
 pub trait GenericPath {
-
-    static pure fn from_str(&str) -> self;
+    static pure fn from_str(&str) -> Self;
 
     pure fn dirname() -> ~str;
     pure fn filename() -> Option<~str>;
     pure fn filestem() -> Option<~str>;
     pure fn filetype() -> Option<~str>;
 
-    pure fn with_dirname((&str)) -> self;
-    pure fn with_filename((&str)) -> self;
-    pure fn with_filestem((&str)) -> self;
-    pure fn with_filetype((&str)) -> self;
+    pure fn with_dirname((&str)) -> Self;
+    pure fn with_filename((&str)) -> Self;
+    pure fn with_filestem((&str)) -> Self;
+    pure fn with_filetype((&str)) -> Self;
 
-    pure fn dir_path() -> self;
-    pure fn file_path() -> self;
+    pure fn dir_path() -> Self;
+    pure fn file_path() -> Self;
 
-    pure fn push((&str)) -> self;
-    pure fn push_rel((&self)) -> self;
-    pure fn push_many((&[~str])) -> self;
-    pure fn pop() -> self;
+    pure fn push((&str)) -> Self;
+    pure fn push_rel((&Self)) -> Self;
+    pure fn push_many((&[~str])) -> Self;
+    pure fn pop() -> Self;
 
-    pure fn normalize() -> self;
+    pure fn normalize() -> Self;
 }
 
 #[cfg(windows)]
diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs
index dd5c4143b6d..fb82c07da04 100644
--- a/src/libcore/ptr.rs
+++ b/src/libcore/ptr.rs
@@ -187,7 +187,7 @@ pub pure fn ref_eq<T>(thing: &a/T, other: &b/T) -> bool {
 pub trait Ptr<T> {
     pure fn is_null() -> bool;
     pure fn is_not_null() -> bool;
-    pure fn offset(count: uint) -> self;
+    pure fn offset(count: uint) -> Self;
 }
 
 #[cfg(stage0)]
diff --git a/src/libcore/str.rs b/src/libcore/str.rs
index 312bfab58c0..d3759dca517 100644
--- a/src/libcore/str.rs
+++ b/src/libcore/str.rs
@@ -2119,9 +2119,9 @@ pub mod raw {
 }
 
 pub trait Trimmable {
-    pure fn trim() -> self;
-    pure fn trim_left() -> self;
-    pure fn trim_right() -> self;
+    pure fn trim() -> Self;
+    pure fn trim_left() -> Self;
+    pure fn trim_right() -> Self;
 }
 
 /// Extension methods for strings
diff --git a/src/librustc/middle/astencode.rs b/src/librustc/middle/astencode.rs
index 6510b1cbb19..ff7e5363d7c 100644
--- a/src/librustc/middle/astencode.rs
+++ b/src/librustc/middle/astencode.rs
@@ -77,7 +77,7 @@ enum extended_decode_ctxt {
 }
 
 trait tr {
-    fn tr(xcx: extended_decode_ctxt) -> self;
+    fn tr(xcx: extended_decode_ctxt) -> Self;
 }
 
 trait tr_intern {
diff --git a/src/librustc/middle/resolve.rs b/src/librustc/middle/resolve.rs
index 3c1b7b3c1f9..a17db8652ce 100644
--- a/src/librustc/middle/resolve.rs
+++ b/src/librustc/middle/resolve.rs
@@ -3581,8 +3581,6 @@ pub impl Resolver {
                 // Create a new rib for the self type.
                 let self_type_rib = @Rib(NormalRibKind);
                 (*self.type_ribs).push(self_type_rib);
-                self_type_rib.bindings.insert(self.self_ident,
-                                              dl_def(def_self_ty(item.id)));
                 self_type_rib.bindings.insert(self.type_self_ident,
                                               dl_def(def_self_ty(item.id)));
 
diff --git a/src/librustc/middle/typeck/infer/lattice.rs b/src/librustc/middle/typeck/infer/lattice.rs
index f061aeb459b..5ea7937845d 100644
--- a/src/librustc/middle/typeck/infer/lattice.rs
+++ b/src/librustc/middle/typeck/infer/lattice.rs
@@ -50,9 +50,9 @@ use middle::typeck::infer::to_str::InferStr;
 use std::list;
 
 pub trait LatticeValue {
-    static fn sub(cf: &CombineFields, a: &self, b: &self) -> ures;
-    static fn lub(cf: &CombineFields, a: &self, b: &self) -> cres<self>;
-    static fn glb(cf: &CombineFields, a: &self, b: &self) -> cres<self>;
+    static fn sub(cf: &CombineFields, a: &Self, b: &Self) -> ures;
+    static fn lub(cf: &CombineFields, a: &Self, b: &Self) -> cres<Self>;
+    static fn glb(cf: &CombineFields, a: &Self, b: &Self) -> cres<Self>;
 }
 
 pub type LatticeOp<T> = &fn(cf: &CombineFields, a: &T, b: &T) -> cres<T>;
diff --git a/src/librustc/middle/typeck/infer/unify.rs b/src/librustc/middle/typeck/infer/unify.rs
index db3dab297a7..30329f29945 100644
--- a/src/librustc/middle/typeck/infer/unify.rs
+++ b/src/librustc/middle/typeck/infer/unify.rs
@@ -39,7 +39,7 @@ pub struct Node<V, T> {
 
 pub trait UnifyVid<T> {
     static fn appropriate_vals_and_bindings(infcx: &v/InferCtxt)
-        -> &v/ValsAndBindings<self, T>;
+        -> &v/ValsAndBindings<Self, T>;
 }
 
 pub impl InferCtxt {
@@ -136,7 +136,7 @@ pub impl InferCtxt {
 // doesn't have a subtyping relationship we need to worry about.
 
 pub trait SimplyUnifiable {
-    static fn to_type_err(expected_found<self>) -> ty::type_err;
+    static fn to_type_err(expected_found<Self>) -> ty::type_err;
 }
 
 pub fn mk_err<T: SimplyUnifiable>(+a_is_expected: bool,
diff --git a/src/libstd/cmp.rs b/src/libstd/cmp.rs
index 7f5f65fe52b..0bd7538d947 100644
--- a/src/libstd/cmp.rs
+++ b/src/libstd/cmp.rs
@@ -18,8 +18,8 @@ use core::float;
 const fuzzy_epsilon: float = 1.0e-6;
 
 pub trait FuzzyEq {
-    pure fn fuzzy_eq(&self, other: &self) -> bool;
-    pure fn fuzzy_eq_eps(&self, other: &self, epsilon: &self) -> bool;
+    pure fn fuzzy_eq(&self, other: &Self) -> bool;
+    pure fn fuzzy_eq_eps(&self, other: &Self, epsilon: &Self) -> bool;
 }
 
 impl float: FuzzyEq {
diff --git a/src/libstd/flatpipes.rs b/src/libstd/flatpipes.rs
index bd684baf6b3..f032d19271d 100644
--- a/src/libstd/flatpipes.rs
+++ b/src/libstd/flatpipes.rs
@@ -467,11 +467,11 @@ pub mod flatteners {
     }
 
     pub trait FromReader {
-        static fn from_reader(r: Reader) -> self;
+        static fn from_reader(r: Reader) -> Self;
     }
 
     pub trait FromWriter {
-        static fn from_writer(w: Writer) -> self;
+        static fn from_writer(w: Writer) -> Self;
     }
 
     impl json::Decoder: FromReader {
diff --git a/src/libstd/serialize.rs b/src/libstd/serialize.rs
index 6e70f844e42..91e1f05daae 100644
--- a/src/libstd/serialize.rs
+++ b/src/libstd/serialize.rs
@@ -111,7 +111,7 @@ pub trait Encodable<S: Encoder> {
 }
 
 pub trait Decodable<D: Decoder> {
-    static fn decode(&self, d: &D) -> self;
+    static fn decode(&self, d: &D) -> Self;
 }
 
 pub impl<S: Encoder> uint: Encodable<S> {
diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs
index 584b2bcfdc6..980d4a236e0 100644
--- a/src/libsyntax/codemap.rs
+++ b/src/libsyntax/codemap.rs
@@ -34,7 +34,7 @@ use core::vec;
 use std::serialize::{Encodable, Decodable, Encoder, Decoder};
 
 pub trait Pos {
-    static pure fn from_uint(n: uint) -> self;
+    static pure fn from_uint(n: uint) -> Self;
     pure fn to_uint(&self) -> uint;
 }
 
diff --git a/src/test/auxiliary/static-methods-crate.rs b/src/test/auxiliary/static-methods-crate.rs
index 530309536d9..798f05b8485 100644
--- a/src/test/auxiliary/static-methods-crate.rs
+++ b/src/test/auxiliary/static-methods-crate.rs
@@ -14,7 +14,7 @@
 #[crate_type = "lib"];
 
 pub trait read {
-    static fn readMaybe(s: ~str) -> Option<self>;
+    static fn readMaybe(s: ~str) -> Option<Self>;
 }
 
 impl int: read {
diff --git a/src/test/auxiliary/static_fn_inline_xc_aux.rs b/src/test/auxiliary/static_fn_inline_xc_aux.rs
index 2a1cce54783..78e3dcca39d 100644
--- a/src/test/auxiliary/static_fn_inline_xc_aux.rs
+++ b/src/test/auxiliary/static_fn_inline_xc_aux.rs
@@ -11,7 +11,7 @@
 
 pub mod num {
     pub trait Num2 {
-        static pure fn from_int2(n: int) -> self;
+        static pure fn from_int2(n: int) -> Self;
     }
 }
 
diff --git a/src/test/auxiliary/static_fn_trait_xc_aux.rs b/src/test/auxiliary/static_fn_trait_xc_aux.rs
index 40659da8dae..d28d6ce187a 100644
--- a/src/test/auxiliary/static_fn_trait_xc_aux.rs
+++ b/src/test/auxiliary/static_fn_trait_xc_aux.rs
@@ -1,6 +1,6 @@
 pub mod num {
     pub trait Num2 {
-        static pure fn from_int2(n: int) -> self;
+        static pure fn from_int2(n: int) -> Self;
     }
 }
 
diff --git a/src/test/auxiliary/trait_inheritance_overloading_xc.rs b/src/test/auxiliary/trait_inheritance_overloading_xc.rs
index 4adb3777986..950f4b6bbe7 100644
--- a/src/test/auxiliary/trait_inheritance_overloading_xc.rs
+++ b/src/test/auxiliary/trait_inheritance_overloading_xc.rs
@@ -10,7 +10,7 @@
 
 use cmp::Eq;
 
-pub trait MyNum : Add<self,self> Sub<self,self> Mul<self,self> Eq {
+pub trait MyNum : Add<Self,Self> Sub<Self,Self> Mul<Self,Self> Eq {
 }
 
 pub struct MyInt {
diff --git a/src/test/compile-fail/infinite-instantiation.rs b/src/test/compile-fail/infinite-instantiation.rs
index e7b737eeb4b..8b068f47c8f 100644
--- a/src/test/compile-fail/infinite-instantiation.rs
+++ b/src/test/compile-fail/infinite-instantiation.rs
@@ -12,7 +12,7 @@
 // issue 2258
 
 trait to_opt {
-    fn to_option() -> Option<self>;
+    fn to_option() -> Option<Self>;
 }
 
 impl uint: to_opt {
diff --git a/src/test/compile-fail/missing-derivable-attr.rs b/src/test/compile-fail/missing-derivable-attr.rs
index 7262d9776fa..bff6344bc55 100644
--- a/src/test/compile-fail/missing-derivable-attr.rs
+++ b/src/test/compile-fail/missing-derivable-attr.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 trait MyEq {
-    pure fn eq(&self, other: &self) -> bool;
+    pure fn eq(&self, other: &Self) -> bool;
 }
 
 struct A {
diff --git a/src/test/compile-fail/selftype-astparam.rs b/src/test/compile-fail/selftype-astparam.rs
index 2898c7f4f87..e3bdb97e744 100644
--- a/src/test/compile-fail/selftype-astparam.rs
+++ b/src/test/compile-fail/selftype-astparam.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 trait add {
-    fn plus(++x: self) -> self;
+    fn plus(++x: Self) -> Self;
 }
 
 impl int: add {
diff --git a/src/test/compile-fail/selftype-traittype.rs b/src/test/compile-fail/selftype-traittype.rs
index 7d76c7e532d..f704f408662 100644
--- a/src/test/compile-fail/selftype-traittype.rs
+++ b/src/test/compile-fail/selftype-traittype.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 trait add {
-    fn plus(x: self) -> self;
+    fn plus(x: Self) -> Self;
 }
 
 fn do_add(x: add, y: add) -> add {
diff --git a/src/test/compile-fail/trait-impl-different-num-params.rs b/src/test/compile-fail/trait-impl-different-num-params.rs
index 170b52421b3..8ff4188d4b6 100644
--- a/src/test/compile-fail/trait-impl-different-num-params.rs
+++ b/src/test/compile-fail/trait-impl-different-num-params.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 trait foo {
-    fn bar(x: uint) -> self;
+    fn bar(x: uint) -> Self;
 }
 impl int: foo {
     fn bar() -> int {
diff --git a/src/test/compile-fail/trait-test-2.rs b/src/test/compile-fail/trait-test-2.rs
index e8ed23d319b..cabcbff1154 100644
--- a/src/test/compile-fail/trait-test-2.rs
+++ b/src/test/compile-fail/trait-test-2.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-trait bar { fn dup() -> self; fn blah<X>(); }
+trait bar { fn dup() -> Self; fn blah<X>(); }
 impl int: bar { fn dup() -> int { self } fn blah<X>() {} }
 impl uint: bar { fn dup() -> uint { self } fn blah<X>() {} }
 
diff --git a/src/test/run-pass/static-method-in-trait-with-tps-intracrate.rs b/src/test/run-pass/static-method-in-trait-with-tps-intracrate.rs
index 605ffe2d15b..6eba8771fce 100644
--- a/src/test/run-pass/static-method-in-trait-with-tps-intracrate.rs
+++ b/src/test/run-pass/static-method-in-trait-with-tps-intracrate.rs
@@ -13,7 +13,7 @@ trait Deserializer {
 }
 
 trait Deserializable<D: Deserializer> {
-    static fn deserialize(d: &D) -> self;
+    static fn deserialize(d: &D) -> Self;
 }
 
 impl<D: Deserializer> int: Deserializable<D> {
@@ -32,4 +32,4 @@ fn main() {
     let d = FromThinAir { dummy: () };
     let i: int = Deserializable::deserialize(&d);
     assert i == 22;
-}
\ No newline at end of file
+}
diff --git a/src/test/run-pass/static-method-test.rs b/src/test/run-pass/static-method-test.rs
index 4e844fc709b..9ee65547cba 100644
--- a/src/test/run-pass/static-method-test.rs
+++ b/src/test/run-pass/static-method-test.rs
@@ -14,7 +14,7 @@
 // A trait for objects that can be used to do an if-then-else
 // (No actual need for this to be static, but it is a simple test.)
 trait bool_like {
-    static fn select<A>(b: self, +x1: A, +x2: A) -> A;
+    static fn select<A>(b: Self, +x1: A, +x2: A) -> A;
 }
 
 fn andand<T: bool_like Copy>(x1: T, x2: T) -> T {
@@ -36,7 +36,7 @@ impl int: bool_like {
 // A trait for sequences that can be constructed imperatively.
 trait buildable<A> {
      static pure fn build_sized(size: uint,
-                                builder: fn(push: pure fn(+v: A))) -> self;
+                                builder: fn(push: pure fn(+v: A))) -> Self;
 }
 
 
diff --git a/src/test/run-pass/static-methods-in-traits.rs b/src/test/run-pass/static-methods-in-traits.rs
index e72aac82e73..6e5160da763 100644
--- a/src/test/run-pass/static-methods-in-traits.rs
+++ b/src/test/run-pass/static-methods-in-traits.rs
@@ -10,7 +10,7 @@
 
 mod a {
 	pub trait Foo {
-		static pub fn foo() -> self;
+		static pub fn foo() -> Self;
 	}
 
 	impl int : Foo {
diff --git a/src/test/run-pass/static-methods-in-traits2.rs b/src/test/run-pass/static-methods-in-traits2.rs
index 1545c98156d..7851aa481d3 100644
--- a/src/test/run-pass/static-methods-in-traits2.rs
+++ b/src/test/run-pass/static-methods-in-traits2.rs
@@ -1,5 +1,5 @@
 pub trait Number: NumConv {
-    static pure fn from<T:Number>(n: T) -> self;
+    static pure fn from<T:Number>(n: T) -> Self;
 }
 
 pub impl float: Number {
@@ -16,4 +16,4 @@ pub impl float: NumConv {
 
 fn main() {
     let _: float = Number::from(0.0f);
-}
\ No newline at end of file
+}
diff --git a/src/test/run-pass/trait-inheritance-num0.rs b/src/test/run-pass/trait-inheritance-num0.rs
index cd671f82dd9..2d82832652f 100644
--- a/src/test/run-pass/trait-inheritance-num0.rs
+++ b/src/test/run-pass/trait-inheritance-num0.rs
@@ -15,8 +15,8 @@
 use Num::from_int;
 
 trait Num {
-    static fn from_int(i: int) -> self;
-    fn gt(&self, other: &self) -> bool;
+    static fn from_int(i: int) -> Self;
+    fn gt(&self, other: &Self) -> bool;
 }
 
 pub trait NumExt: Num { }
diff --git a/src/test/run-pass/trait-inheritance-overloading.rs b/src/test/run-pass/trait-inheritance-overloading.rs
index bfe56827d82..e4f98bb7962 100644
--- a/src/test/run-pass/trait-inheritance-overloading.rs
+++ b/src/test/run-pass/trait-inheritance-overloading.rs
@@ -10,7 +10,7 @@
 
 use cmp::Eq;
 
-trait MyNum : Add<self,self> Sub<self,self> Mul<self,self> Eq { }
+trait MyNum : Add<Self,Self> Sub<Self,Self> Mul<Self,Self> Eq { }
 
 struct MyInt { val: int }
 
diff --git a/src/test/run-pass/trait-inheritance-self.rs b/src/test/run-pass/trait-inheritance-self.rs
index 10eaa9b188a..636cd5cd397 100644
--- a/src/test/run-pass/trait-inheritance-self.rs
+++ b/src/test/run-pass/trait-inheritance-self.rs
@@ -2,7 +2,7 @@ trait Foo<T> {
     fn f(&self, x: &T);
 }
 
-trait Bar : Foo<self> {
+trait Bar : Foo<Self> {
     fn g(&self);
 }
 
diff --git a/src/test/run-pass/trait-inheritance-static.rs b/src/test/run-pass/trait-inheritance-static.rs
index 15dcde281d2..4a874f02a6a 100644
--- a/src/test/run-pass/trait-inheritance-static.rs
+++ b/src/test/run-pass/trait-inheritance-static.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 trait MyNum {
-    static fn from_int(int) -> self;
+    static fn from_int(int) -> Self;
 }
 
 pub trait NumExt: MyNum { }
diff --git a/src/test/run-pass/trait-inheritance-static2.rs b/src/test/run-pass/trait-inheritance-static2.rs
index a523c90fe37..b767f34b4b1 100644
--- a/src/test/run-pass/trait-inheritance-static2.rs
+++ b/src/test/run-pass/trait-inheritance-static2.rs
@@ -11,7 +11,7 @@
 trait MyEq { }
 
 trait MyNum {
-    static fn from_int(int) -> self;
+    static fn from_int(int) -> Self;
 }
 
 pub trait NumExt: MyEq MyNum { }
diff --git a/src/test/run-pass/trait-inheritance-subst.rs b/src/test/run-pass/trait-inheritance-subst.rs
index a908708f96b..686c5cba633 100644
--- a/src/test/run-pass/trait-inheritance-subst.rs
+++ b/src/test/run-pass/trait-inheritance-subst.rs
@@ -12,7 +12,7 @@ pub trait Add<RHS,Result> {
     pure fn add(rhs: &RHS) -> Result;
 }
 
-trait MyNum : Add<self,self> { }
+trait MyNum : Add<Self,Self> { }
 
 struct MyInt { val: int }
 
diff --git a/src/test/run-pass/trait-inheritance-subst2.rs b/src/test/run-pass/trait-inheritance-subst2.rs
index 3ce74bad0a6..54a7e811a1c 100644
--- a/src/test/run-pass/trait-inheritance-subst2.rs
+++ b/src/test/run-pass/trait-inheritance-subst2.rs
@@ -16,7 +16,7 @@ trait Add<RHS,Result>: Panda<RHS> {
     fn add(rhs: &RHS) -> Result;
 }
 
-trait MyNum : Add<self,self> { }
+trait MyNum : Add<Self,Self> { }
 
 struct MyInt { val: int }
 
diff --git a/src/test/run-pass/typeclasses-eq-example-static.rs b/src/test/run-pass/typeclasses-eq-example-static.rs
index 582358a4012..3da714f0a7b 100644
--- a/src/test/run-pass/typeclasses-eq-example-static.rs
+++ b/src/test/run-pass/typeclasses-eq-example-static.rs
@@ -12,7 +12,7 @@
 // methods!
 
 trait Equal {
-    static fn isEq(a: self, b: self) -> bool;
+    static fn isEq(a: Self, b: Self) -> bool;
 }
 
 enum Color { cyan, magenta, yellow, black }
@@ -62,4 +62,4 @@ fn main() {
                  branch(@leaf(magenta), @leaf(magenta)));
 
     log(error, "Assertions all succeeded!");
-}
\ No newline at end of file
+}
diff --git a/src/test/run-pass/typeclasses-eq-example.rs b/src/test/run-pass/typeclasses-eq-example.rs
index c3a2ed2ca10..75a574b1dda 100644
--- a/src/test/run-pass/typeclasses-eq-example.rs
+++ b/src/test/run-pass/typeclasses-eq-example.rs
@@ -11,7 +11,7 @@
 // Example from lkuper's intern talk, August 2012.
 
 trait Equal {
-    fn isEq(a: self) -> bool;
+    fn isEq(a: Self) -> bool;
 }
 
 enum Color { cyan, magenta, yellow, black }
@@ -61,4 +61,4 @@ fn main() {
         .isEq(branch(@leaf(magenta), @leaf(magenta)));
 
     log(error, "Assertions all succeeded!");
-}
\ No newline at end of file
+}