diff --git a/src/libcore/bool.rs b/src/libcore/bool.rs index 1eebb716a5973..89ffaeff63d93 100644 --- a/src/libcore/bool.rs +++ b/src/libcore/bool.rs @@ -74,7 +74,7 @@ pub fn all_values(blk: fn(v: bool)) { pub pure fn to_bit(v: bool) -> u8 { if v { 1u8 } else { 0u8 } } #[cfg(notest)] -impl bool : cmp::Eq { +impl cmp::Eq for bool { pure fn eq(&self, other: &bool) -> bool { (*self) == (*other) } pure fn ne(&self, other: &bool) -> bool { (*self) != (*other) } } diff --git a/src/libcore/char.rs b/src/libcore/char.rs index 13e4595a77a80..daff7d116e844 100644 --- a/src/libcore/char.rs +++ b/src/libcore/char.rs @@ -251,7 +251,7 @@ pub pure fn cmp(a: char, b: char) -> int { } #[cfg(notest)] -impl char : Eq { +impl Eq for char { pure fn eq(&self, other: &char) -> bool { (*self) == (*other) } pure fn ne(&self, other: &char) -> bool { (*self) != (*other) } } diff --git a/src/libcore/clone.rs b/src/libcore/clone.rs index 7b66c7c934b2b..6580ce55ddd66 100644 --- a/src/libcore/clone.rs +++ b/src/libcore/clone.rs @@ -15,7 +15,7 @@ pub trait Clone { fn clone(&self) -> Self; } -impl (): Clone { +impl Clone for () { #[inline(always)] fn clone(&self) -> () { () } } diff --git a/src/libcore/condition.rs b/src/libcore/condition.rs index fb44ff4514d8c..a7c8c1f4d6600 100644 --- a/src/libcore/condition.rs +++ b/src/libcore/condition.rs @@ -84,7 +84,7 @@ struct Guard { cond: &Condition } -impl Guard : Drop { +impl Drop for Guard { fn finalize(&self) { unsafe { debug!("Guard: popping handler from TLS"); diff --git a/src/libcore/dvec.rs b/src/libcore/dvec.rs index b0c33dc6f2601..0a96bd633d1ef 100644 --- a/src/libcore/dvec.rs +++ b/src/libcore/dvec.rs @@ -358,7 +358,7 @@ impl DVec { } } -impl DVec: Index { +impl Index for DVec { #[inline(always)] pure fn index(&self, idx: uint) -> A { self.get_elt(idx) diff --git a/src/libcore/hash.rs b/src/libcore/hash.rs index 4e391d6ee0052..b4f4e7d343b0a 100644 --- a/src/libcore/hash.rs +++ b/src/libcore/hash.rs @@ -59,7 +59,7 @@ pub trait HashUtil { pure fn hash() -> u64; } -impl A: HashUtil { +impl HashUtil for A { #[inline(always)] pure fn hash() -> u64 { self.hash_keyed(0,0) } } @@ -74,7 +74,7 @@ pub trait Streaming { fn reset(); } -impl A: Hash { +impl Hash for A { #[inline(always)] pure fn hash_keyed(k0: u64, k1: u64) -> u64 { unsafe { @@ -187,7 +187,7 @@ fn SipState(key0: u64, key1: u64) -> SipState { } -impl SipState : io::Writer { +impl io::Writer for SipState { // Methods for io::writer #[inline(always)] @@ -295,7 +295,7 @@ impl SipState : io::Writer { } } -impl &SipState : Streaming { +impl Streaming for &SipState { #[inline(always)] fn input(buf: &[const u8]) { diff --git a/src/libcore/hashmap.rs b/src/libcore/hashmap.rs index fc117f99e9087..1e9f05a35ebdc 100644 --- a/src/libcore/hashmap.rs +++ b/src/libcore/hashmap.rs @@ -240,7 +240,7 @@ pub mod linear { } } - impl LinearMap: BaseIter<(&K, &V)> { + impl BaseIter<(&K, &V)> for LinearMap { /// Visit all key-value pairs pure fn each(&self, blk: fn(&(&self/K, &self/V)) -> bool) { for uint::range(0, self.buckets.len()) |i| { @@ -257,7 +257,7 @@ pub mod linear { } - impl LinearMap: Container { + impl Container for LinearMap { /// Return the number of elements in the map pure fn len(&self) -> uint { self.size } @@ -265,7 +265,7 @@ pub mod linear { pure fn is_empty(&self) -> bool { self.len() == 0 } } - impl LinearMap: Mutable { + impl Mutable for LinearMap { /// Clear the map, removing all key-value pairs. fn clear(&mut self) { for uint::range(0, self.buckets.len()) |idx| { @@ -275,7 +275,7 @@ pub mod linear { } } - impl LinearMap: Map { + impl Map for LinearMap { /// Return true if the map contains a value for the specified key pure fn contains_key(&self, k: &K) -> bool { match self.bucket_for_key(k) { @@ -443,7 +443,7 @@ pub mod linear { } } - impl LinearMap: Eq { + impl Eq for LinearMap { pure fn eq(&self, other: &LinearMap) -> bool { if self.len() != other.len() { return false; } @@ -464,13 +464,13 @@ pub mod linear { priv map: LinearMap } - impl LinearSet: BaseIter { + impl BaseIter for LinearSet { /// Visit all values in order pure fn each(&self, f: fn(&T) -> bool) { self.map.each_key(f) } pure fn size_hint(&self) -> Option { Some(self.len()) } } - impl LinearSet: Eq { + impl Eq for LinearSet { pure fn eq(&self, other: &LinearSet) -> bool { self.map == other.map } @@ -479,7 +479,7 @@ pub mod linear { } } - impl LinearSet: Container { + impl Container for LinearSet { /// Return the number of elements in the set pure fn len(&self) -> uint { self.map.len() } @@ -487,12 +487,12 @@ pub mod linear { pure fn is_empty(&self) -> bool { self.map.is_empty() } } - impl LinearSet: Mutable { + impl Mutable for LinearSet { /// Clear the set, removing all values. fn clear(&mut self) { self.map.clear() } } - impl LinearSet: Set { + impl Set for LinearSet { /// Return true if the set contains a value pure fn contains(&self, value: &T) -> bool { self.map.contains_key(value) diff --git a/src/libcore/io.rs b/src/libcore/io.rs index 571d9344243a4..2173efe5ac66f 100644 --- a/src/libcore/io.rs +++ b/src/libcore/io.rs @@ -169,7 +169,7 @@ pub trait ReaderUtil { fn read_i8(&self) -> i8; } -impl T : ReaderUtil { +impl ReaderUtil for T { fn read_bytes(&self,len: uint) -> ~[u8] { let mut bytes = vec::with_capacity(len); @@ -415,7 +415,7 @@ fn convert_whence(whence: SeekStyle) -> i32 { }; } -impl *libc::FILE: Reader { +impl Reader for *libc::FILE { fn read(&self, bytes: &mut [u8], len: uint) -> uint { unsafe { do vec::as_mut_buf(bytes) |buf_p, buf_len| { @@ -460,7 +460,7 @@ struct Wrapper { // A forwarding impl of reader that also holds on to a resource for the // duration of its lifetime. // FIXME there really should be a better way to do this // #2004 -impl Wrapper: Reader { +impl Reader for Wrapper { fn read(&self, bytes: &mut [u8], len: uint) -> uint { self.base.read(bytes, len) } @@ -527,7 +527,7 @@ pub struct BytesReader { mut pos: uint } -impl BytesReader: Reader { +impl Reader for BytesReader { fn read(&self, bytes: &mut [u8], len: uint) -> uint { let count = uint::min(len, self.bytes.len() - self.pos); @@ -589,7 +589,7 @@ pub trait Writer { fn get_type(&self) -> WriterType; } -impl Wrapper: Writer { +impl Writer for Wrapper { fn write(&self, bs: &[const u8]) { self.base.write(bs); } fn seek(&self, off: int, style: SeekStyle) { self.base.seek(off, style); } fn tell(&self) -> uint { self.base.tell() } @@ -597,7 +597,7 @@ impl Wrapper: Writer { fn get_type(&self) -> WriterType { File } } -impl *libc::FILE: Writer { +impl Writer for *libc::FILE { fn write(&self, v: &[const u8]) { unsafe { do vec::as_const_buf(v) |vbuf, len| { @@ -647,7 +647,7 @@ pub fn FILE_writer(f: *libc::FILE, cleanup: bool) -> Writer { } } -impl fd_t: Writer { +impl Writer for fd_t { fn write(&self, v: &[const u8]) { unsafe { let mut count = 0u; @@ -890,7 +890,7 @@ pub trait WriterUtil { fn write_i8(&self, n: i8); } -impl T : WriterUtil { +impl WriterUtil for T { fn write_char(&self, ch: char) { if ch as uint < 128u { self.write(&[ch as u8]); @@ -996,7 +996,7 @@ pub struct BytesWriter { mut pos: uint, } -impl BytesWriter: Writer { +impl Writer for BytesWriter { fn write(&self, v: &[const u8]) { do self.bytes.swap |bytes| { let mut bytes = move bytes; @@ -1112,7 +1112,7 @@ pub mod fsync { arg: Arg, } - impl Res: Drop { + impl Drop for Res { fn finalize(&self) { match self.arg.opt_level { None => (), diff --git a/src/libcore/iter-trait.rs b/src/libcore/iter-trait.rs index df2aa6271d1f8..7c2b5d7ffcd40 100644 --- a/src/libcore/iter-trait.rs +++ b/src/libcore/iter-trait.rs @@ -20,14 +20,14 @@ use option::Option; use self::inst::{IMPL_T, EACH, SIZE_HINT}; -impl IMPL_T: iter::BaseIter { +impl iter::BaseIter for IMPL_T { #[inline(always)] pure fn each(&self, blk: fn(v: &A) -> bool) { EACH(self, blk) } #[inline(always)] pure fn size_hint(&self) -> Option { SIZE_HINT(self) } } -impl IMPL_T: iter::ExtendedIter { +impl iter::ExtendedIter for IMPL_T { #[inline(always)] pure fn eachi(&self, blk: fn(uint, v: &A) -> bool) { iter::eachi(self, blk) @@ -60,14 +60,14 @@ impl IMPL_T: iter::ExtendedIter { } -impl IMPL_T: iter::EqIter { +impl iter::EqIter for IMPL_T { #[inline(always)] pure fn contains(&self, x: &A) -> bool { iter::contains(self, x) } #[inline(always)] pure fn count(&self, x: &A) -> uint { iter::count(self, x) } } -impl IMPL_T: iter::CopyableIter { +impl iter::CopyableIter for IMPL_T { #[inline(always)] pure fn filter_to_vec(&self, pred: fn(&A) -> bool) -> ~[A] { iter::filter_to_vec(self, pred) @@ -80,7 +80,7 @@ impl IMPL_T: iter::CopyableIter { } } -impl IMPL_T: iter::CopyableOrderedIter { +impl iter::CopyableOrderedIter for IMPL_T { #[inline(always)] pure fn min(&self) -> A { iter::min(self) } #[inline(always)] diff --git a/src/libcore/managed.rs b/src/libcore/managed.rs index 7cb20f7b44e9e..0f13a8485afdb 100644 --- a/src/libcore/managed.rs +++ b/src/libcore/managed.rs @@ -46,7 +46,7 @@ pub pure fn mut_ptr_eq(a: @mut T, b: @mut T) -> bool { } #[cfg(notest)] -impl @const T : Eq { +impl Eq for @const T { #[inline(always)] pure fn eq(&self, other: &@const T) -> bool { *(*self) == *(*other) } #[inline(always)] @@ -54,7 +54,7 @@ impl @const T : Eq { } #[cfg(notest)] -impl @const T : Ord { +impl Ord for @const T { #[inline(always)] pure fn lt(&self, other: &@const T) -> bool { *(*self) < *(*other) } #[inline(always)] diff --git a/src/libcore/nil.rs b/src/libcore/nil.rs index 8f03a1b6e3498..62ed1d24d790e 100644 --- a/src/libcore/nil.rs +++ b/src/libcore/nil.rs @@ -17,7 +17,7 @@ Functions for the unit type. use cmp::{Eq, Ord}; #[cfg(notest)] -impl () : Eq { +impl Eq for () { #[inline(always)] pure fn eq(&self, _other: &()) -> bool { true } #[inline(always)] @@ -25,7 +25,7 @@ impl () : Eq { } #[cfg(notest)] -impl () : Ord { +impl Ord for () { #[inline(always)] pure fn lt(&self, _other: &()) -> bool { false } #[inline(always)] diff --git a/src/libcore/num/f32.rs b/src/libcore/num/f32.rs index d27393fe50783..8350ba42591d7 100644 --- a/src/libcore/num/f32.rs +++ b/src/libcore/num/f32.rs @@ -253,7 +253,7 @@ pub pure fn logarithm(n: f32, b: f32) -> f32 { } #[cfg(notest)] -impl f32 : cmp::Eq { +impl cmp::Eq for f32 { #[inline(always)] pure fn eq(&self, other: &f32) -> bool { (*self) == (*other) } #[inline(always)] @@ -261,7 +261,7 @@ impl f32 : cmp::Eq { } #[cfg(notest)] -impl f32 : cmp::Ord { +impl cmp::Ord for f32 { #[inline(always)] pure fn lt(&self, other: &f32) -> bool { (*self) < (*other) } #[inline(always)] @@ -272,12 +272,12 @@ impl f32 : cmp::Ord { pure fn gt(&self, other: &f32) -> bool { (*self) > (*other) } } -impl f32: num::Zero { +impl num::Zero for f32 { #[inline(always)] static pure fn zero() -> f32 { 0.0 } } -impl f32: num::One { +impl num::One for f32 { #[inline(always)] static pure fn one() -> f32 { 1.0 } } @@ -336,7 +336,7 @@ pub extern { fn floorf32(val: f32) -> f32; } -impl f32: num::Round { +impl num::Round for f32 { #[inline(always)] pure fn round(&self, mode: num::RoundMode) -> f32 { match mode { @@ -464,12 +464,12 @@ pub pure fn to_str_digits(num: f32, dig: uint) -> ~str { r } -impl f32: to_str::ToStr { +impl to_str::ToStr for f32 { #[inline(always)] pure fn to_str(&self) -> ~str { to_str_digits(*self, 8) } } -impl f32: num::ToStrRadix { +impl num::ToStrRadix for f32 { #[inline(always)] pure fn to_str_radix(&self, rdx: uint) -> ~str { to_str_radix(*self, rdx) @@ -564,12 +564,12 @@ pub pure fn from_str_radix(num: &str, rdx: uint) -> Option { num::from_str_common(num, rdx, true, true, false, num::ExpNone, false) } -impl f32: from_str::FromStr { +impl from_str::FromStr for f32 { #[inline(always)] static pure fn from_str(val: &str) -> Option { from_str(val) } } -impl f32: num::FromStrRadix { +impl num::FromStrRadix for f32 { #[inline(always)] static pure fn from_str_radix(val: &str, rdx: uint) -> Option { from_str_radix(val, rdx) diff --git a/src/libcore/num/f64.rs b/src/libcore/num/f64.rs index d189a0254eba8..474067a1860c8 100644 --- a/src/libcore/num/f64.rs +++ b/src/libcore/num/f64.rs @@ -278,7 +278,7 @@ pub pure fn logarithm(n: f64, b: f64) -> f64 { } #[cfg(notest)] -impl f64 : cmp::Eq { +impl cmp::Eq for f64 { #[inline(always)] pure fn eq(&self, other: &f64) -> bool { (*self) == (*other) } #[inline(always)] @@ -286,7 +286,7 @@ impl f64 : cmp::Eq { } #[cfg(notest)] -impl f64 : cmp::Ord { +impl cmp::Ord for f64 { #[inline(always)] pure fn lt(&self, other: &f64) -> bool { (*self) < (*other) } #[inline(always)] @@ -321,12 +321,12 @@ pub impl f64: NumCast { #[inline(always)] pure fn to_float(&self) -> float { *self as float } } -impl f64: num::Zero { +impl num::Zero for f64 { #[inline(always)] static pure fn zero() -> f64 { 0.0 } } -impl f64: num::One { +impl num::One for f64 { #[inline(always)] static pure fn one() -> f64 { 1.0 } } @@ -361,7 +361,7 @@ pub extern { fn floorf64(val: f64) -> f64; } -impl f64: num::Round { +impl num::Round for f64 { #[inline(always)] pure fn round(&self, mode: num::RoundMode) -> f64 { match mode { @@ -489,12 +489,12 @@ pub pure fn to_str_digits(num: f64, dig: uint) -> ~str { r } -impl f64: to_str::ToStr { +impl to_str::ToStr for f64 { #[inline(always)] pure fn to_str(&self) -> ~str { to_str_digits(*self, 8) } } -impl f64: num::ToStrRadix { +impl num::ToStrRadix for f64 { #[inline(always)] pure fn to_str_radix(&self, rdx: uint) -> ~str { to_str_radix(*self, rdx) @@ -589,12 +589,12 @@ pub pure fn from_str_radix(num: &str, rdx: uint) -> Option { num::from_str_common(num, rdx, true, true, false, num::ExpNone, false) } -impl f64: from_str::FromStr { +impl from_str::FromStr for f64 { #[inline(always)] static pure fn from_str(val: &str) -> Option { from_str(val) } } -impl f64: num::FromStrRadix { +impl num::FromStrRadix for f64 { #[inline(always)] static pure fn from_str_radix(val: &str, rdx: uint) -> Option { from_str_radix(val, rdx) diff --git a/src/libcore/num/float.rs b/src/libcore/num/float.rs index bbea58f5cf5dc..0f0b721e4626a 100644 --- a/src/libcore/num/float.rs +++ b/src/libcore/num/float.rs @@ -201,12 +201,12 @@ pub pure fn to_str_digits(num: float, digits: uint) -> ~str { r } -impl float: to_str::ToStr { +impl to_str::ToStr for float { #[inline(always)] pure fn to_str(&self) -> ~str { to_str_digits(*self, 8) } } -impl float: num::ToStrRadix { +impl num::ToStrRadix for float { #[inline(always)] pure fn to_str_radix(&self, radix: uint) -> ~str { to_str_radix(*self, radix) @@ -301,12 +301,12 @@ pub pure fn from_str_radix(num: &str, radix: uint) -> Option { num::from_str_common(num, radix, true, true, false, num::ExpNone, false) } -impl float: from_str::FromStr { +impl from_str::FromStr for float { #[inline(always)] static pure fn from_str(val: &str) -> Option { from_str(val) } } -impl float: num::FromStrRadix { +impl num::FromStrRadix for float { #[inline(always)] static pure fn from_str_radix(val: &str, radix: uint) -> Option { from_str_radix(val, radix) @@ -392,25 +392,25 @@ pub pure fn tan(x: float) -> float { } #[cfg(notest)] -impl float : Eq { +impl Eq for float { pure fn eq(&self, other: &float) -> bool { (*self) == (*other) } pure fn ne(&self, other: &float) -> bool { (*self) != (*other) } } #[cfg(notest)] -impl float : Ord { +impl Ord for float { pure fn lt(&self, other: &float) -> bool { (*self) < (*other) } pure fn le(&self, other: &float) -> bool { (*self) <= (*other) } pure fn ge(&self, other: &float) -> bool { (*self) >= (*other) } pure fn gt(&self, other: &float) -> bool { (*self) > (*other) } } -impl float: num::Zero { +impl num::Zero for float { #[inline(always)] static pure fn zero() -> float { 0.0 } } -impl float: num::One { +impl num::One for float { #[inline(always)] static pure fn one() -> float { 1.0 } } @@ -439,7 +439,7 @@ pub impl float: NumCast { #[inline(always)] pure fn to_float(&self) -> float { *self } } -impl float: num::Round { +impl num::Round for float { #[inline(always)] pure fn round(&self, mode: num::RoundMode) -> float { match mode { diff --git a/src/libcore/num/int-template.rs b/src/libcore/num/int-template.rs index c25938a187fda..eaaa78b84f837 100644 --- a/src/libcore/num/int-template.rs +++ b/src/libcore/num/int-template.rs @@ -147,7 +147,7 @@ pub pure fn abs(i: T) -> T { } #[cfg(notest)] -impl T : Ord { +impl Ord for T { #[inline(always)] pure fn lt(&self, other: &T) -> bool { return (*self) < (*other); } #[inline(always)] @@ -159,24 +159,24 @@ impl T : Ord { } #[cfg(notest)] -impl T : Eq { +impl Eq for T { #[inline(always)] pure fn eq(&self, other: &T) -> bool { return (*self) == (*other); } #[inline(always)] pure fn ne(&self, other: &T) -> bool { return (*self) != (*other); } } -impl T: num::Zero { +impl num::Zero for T { #[inline(always)] static pure fn zero() -> T { 0 } } -impl T: num::One { +impl num::One for T { #[inline(always)] static pure fn one() -> T { 1 } } -impl T: num::Round { +impl num::Round for T { #[inline(always)] pure fn round(&self, _: num::RoundMode) -> T { *self } @@ -236,14 +236,14 @@ pub pure fn parse_bytes(buf: &[u8], radix: uint) -> Option { num::ExpNone, false) } -impl T : FromStr { +impl FromStr for T { #[inline(always)] static pure fn from_str(s: &str) -> Option { from_str(s) } } -impl T : FromStrRadix { +impl FromStrRadix for T { #[inline(always)] static pure fn from_str_radix(&self, s: &str, radix: uint) -> Option { from_str_radix(s, radix) @@ -281,14 +281,14 @@ pub pure fn to_str_radix(num: T, radix: uint) -> ~str { #[inline(always)] pub pure fn str(i: T) -> ~str { to_str(i) } -impl T : ToStr { +impl ToStr for T { #[inline(always)] pure fn to_str(&self) -> ~str { to_str(*self) } } -impl T : ToStrRadix { +impl ToStrRadix for T { #[inline(always)] pure fn to_str_radix(&self, radix: uint) -> ~str { to_str_radix(*self, radix) diff --git a/src/libcore/num/int-template/i16.rs b/src/libcore/num/int-template/i16.rs index 572cce92ea1d7..76725e3895b55 100644 --- a/src/libcore/num/int-template/i16.rs +++ b/src/libcore/num/int-template/i16.rs @@ -84,4 +84,4 @@ fn test_numcast() { assert (20i16 == num::cast(20f)); assert (20i16 == num::cast(20f32)); assert (20i16 == num::cast(20f64)); -} \ No newline at end of file +} diff --git a/src/libcore/num/int-template/i32.rs b/src/libcore/num/int-template/i32.rs index de2e467d02ab1..1c2d60a80ee2b 100644 --- a/src/libcore/num/int-template/i32.rs +++ b/src/libcore/num/int-template/i32.rs @@ -84,4 +84,4 @@ fn test_numcast() { assert (20i32 == num::cast(20f)); assert (20i32 == num::cast(20f32)); assert (20i32 == num::cast(20f64)); -} \ No newline at end of file +} diff --git a/src/libcore/num/uint-template.rs b/src/libcore/num/uint-template.rs index adfd50e20e791..b1ef3f11fa4e1 100644 --- a/src/libcore/num/uint-template.rs +++ b/src/libcore/num/uint-template.rs @@ -111,7 +111,7 @@ pub pure fn compl(i: T) -> T { } #[cfg(notest)] -impl T : Ord { +impl Ord for T { #[inline(always)] pure fn lt(&self, other: &T) -> bool { (*self) < (*other) } #[inline(always)] @@ -123,24 +123,24 @@ impl T : Ord { } #[cfg(notest)] -impl T : Eq { +impl Eq for T { #[inline(always)] pure fn eq(&self, other: &T) -> bool { return (*self) == (*other); } #[inline(always)] pure fn ne(&self, other: &T) -> bool { return (*self) != (*other); } } -impl T: num::Zero { +impl num::Zero for T { #[inline(always)] static pure fn zero() -> T { 0 } } -impl T: num::One { +impl num::One for T { #[inline(always)] static pure fn one() -> T { 1 } } -impl T: num::Round { +impl num::Round for T { #[inline(always)] pure fn round(&self, _: num::RoundMode) -> T { *self } @@ -200,14 +200,14 @@ pub pure fn parse_bytes(buf: &[u8], radix: uint) -> Option { num::ExpNone, false) } -impl T : FromStr { +impl FromStr for T { #[inline(always)] static pure fn from_str(s: &str) -> Option { from_str(s) } } -impl T : FromStrRadix { +impl FromStrRadix for T { #[inline(always)] static pure fn from_str_radix(&self, s: &str, radix: uint) -> Option { from_str_radix(s, radix) @@ -245,14 +245,14 @@ pub pure fn to_str_radix(num: T, radix: uint) -> ~str { #[inline(always)] pub pure fn str(i: T) -> ~str { to_str(i) } -impl T : ToStr { +impl ToStr for T { #[inline(always)] pure fn to_str(&self) -> ~str { to_str(*self) } } -impl T : ToStrRadix { +impl ToStrRadix for T { #[inline(always)] pure fn to_str_radix(&self, radix: uint) -> ~str { to_str_radix(*self, radix) diff --git a/src/libcore/num/uint-template/u16.rs b/src/libcore/num/uint-template/u16.rs index e2e8e2bc9fce2..57e1f5283f664 100644 --- a/src/libcore/num/uint-template/u16.rs +++ b/src/libcore/num/uint-template/u16.rs @@ -86,4 +86,4 @@ fn test_numcast() { assert (20u16 == num::cast(20f)); assert (20u16 == num::cast(20f32)); assert (20u16 == num::cast(20f64)); -} \ No newline at end of file +} diff --git a/src/libcore/num/uint-template/u32.rs b/src/libcore/num/uint-template/u32.rs index ac2727bff0996..7099d15c40b49 100644 --- a/src/libcore/num/uint-template/u32.rs +++ b/src/libcore/num/uint-template/u32.rs @@ -86,4 +86,4 @@ fn test_numcast() { assert (20u64 == num::cast(20f)); assert (20u64 == num::cast(20f32)); assert (20u64 == num::cast(20f64)); -} \ No newline at end of file +} diff --git a/src/libcore/num/uint-template/u64.rs b/src/libcore/num/uint-template/u64.rs index 345f81c147c77..f4d1482de905f 100644 --- a/src/libcore/num/uint-template/u64.rs +++ b/src/libcore/num/uint-template/u64.rs @@ -86,4 +86,4 @@ fn test_numcast() { assert (20u64 == num::cast(20f)); assert (20u64 == num::cast(20f32)); assert (20u64 == num::cast(20f64)); -} \ No newline at end of file +} diff --git a/src/libcore/num/uint-template/u8.rs b/src/libcore/num/uint-template/u8.rs index 71be36d901961..e2f8e00db8197 100644 --- a/src/libcore/num/uint-template/u8.rs +++ b/src/libcore/num/uint-template/u8.rs @@ -93,4 +93,4 @@ fn test_numcast() { assert (20u8 == num::cast(20f)); assert (20u8 == num::cast(20f32)); assert (20u8 == num::cast(20f64)); -} \ No newline at end of file +} diff --git a/src/libcore/num/uint-template/uint.rs b/src/libcore/num/uint-template/uint.rs index 66689f18dfe99..cfb445cbdc878 100644 --- a/src/libcore/num/uint-template/uint.rs +++ b/src/libcore/num/uint-template/uint.rs @@ -276,4 +276,4 @@ fn test_numcast() { assert (20u == num::cast(20f)); assert (20u == num::cast(20f32)); assert (20u == num::cast(20f64)); -} \ No newline at end of file +} diff --git a/src/libcore/owned.rs b/src/libcore/owned.rs index d841188501d96..230386655e08e 100644 --- a/src/libcore/owned.rs +++ b/src/libcore/owned.rs @@ -13,7 +13,7 @@ use cmp::{Eq, Ord}; #[cfg(notest)] -impl ~const T : Eq { +impl Eq for ~const T { #[inline(always)] pure fn eq(&self, other: &~const T) -> bool { *(*self) == *(*other) } #[inline(always)] @@ -21,7 +21,7 @@ impl ~const T : Eq { } #[cfg(notest)] -impl ~const T : Ord { +impl Ord for ~const T { #[inline(always)] pure fn lt(&self, other: &~const T) -> bool { *(*self) < *(*other) } #[inline(always)] diff --git a/src/libcore/path.rs b/src/libcore/path.rs index bf1f1c713a994..91690b6b5b0b2 100644 --- a/src/libcore/path.rs +++ b/src/libcore/path.rs @@ -363,7 +363,7 @@ impl Path { } } -impl PosixPath : ToStr { +impl ToStr for PosixPath { pure fn to_str(&self) -> ~str { let mut s = ~""; if self.is_absolute { @@ -375,7 +375,7 @@ impl PosixPath : ToStr { // FIXME (#3227): when default methods in traits are working, de-duplicate // PosixPath and WindowsPath, most of their methods are common. -impl PosixPath : GenericPath { +impl GenericPath for PosixPath { static pure fn from_str(s: &str) -> PosixPath { let mut components = str::split_nonempty(s, |c| c == '/'); @@ -526,7 +526,7 @@ impl PosixPath : GenericPath { } -impl WindowsPath : ToStr { +impl ToStr for WindowsPath { pure fn to_str(&self) -> ~str { let mut s = ~""; match self.host { @@ -545,7 +545,7 @@ impl WindowsPath : ToStr { } -impl WindowsPath : GenericPath { +impl GenericPath for WindowsPath { static pure fn from_str(s: &str) -> WindowsPath { let host; diff --git a/src/libcore/pipes.rs b/src/libcore/pipes.rs index 7964b081e4902..a26a6b5f8ec3d 100644 --- a/src/libcore/pipes.rs +++ b/src/libcore/pipes.rs @@ -112,7 +112,7 @@ enum State { Terminated } -impl State : Eq { +impl Eq for State { pure fn eq(&self, other: &State) -> bool { ((*self) as uint) == ((*other) as uint) } @@ -207,7 +207,7 @@ pub trait HasBuffer { fn set_buffer(b: *libc::c_void); } -impl Packet: HasBuffer { +impl HasBuffer for Packet { fn set_buffer(b: *libc::c_void) { self.header.buffer = b; } @@ -561,7 +561,7 @@ pub pure fn peek(p: &RecvPacketBuffered) -> bool { } } -impl RecvPacketBuffered: Peekable { +impl Peekable for RecvPacketBuffered { pure fn peek() -> bool { peek(&self) } @@ -734,7 +734,7 @@ trait Selectable { pure fn header() -> *PacketHeader; } -impl *PacketHeader: Selectable { +impl Selectable for *PacketHeader { pure fn header() -> *PacketHeader { self } } @@ -783,7 +783,7 @@ pub struct SendPacketBuffered { mut buffer: Option>, } -impl SendPacketBuffered : ::ops::Drop { +impl ::ops::Drop for SendPacketBuffered { fn finalize(&self) { //if self.p != none { // debug!("drop send %?", option::get(self.p)); @@ -852,7 +852,7 @@ pub struct RecvPacketBuffered { mut buffer: Option>, } -impl RecvPacketBuffered : ::ops::Drop { +impl ::ops::Drop for RecvPacketBuffered { fn finalize(&self) { //if self.p != none { // debug!("drop recv %?", option::get(self.p)); @@ -884,7 +884,7 @@ impl RecvPacketBuffered { } } -impl RecvPacketBuffered : Selectable { +impl Selectable for RecvPacketBuffered { pure fn header() -> *PacketHeader { match self.p { Some(packet) => unsafe { @@ -1036,7 +1036,7 @@ pub fn stream() -> (Port, Chan) { (Port_(Port_ { endp: Some(s) }), Chan_(Chan_{ endp: Some(c) })) } -impl Chan: GenericChan { +impl GenericChan for Chan { fn send(x: T) { let mut endp = None; endp <-> self.endp; @@ -1045,7 +1045,7 @@ impl Chan: GenericChan { } } -impl Chan: GenericSmartChan { +impl GenericSmartChan for Chan { fn try_send(x: T) -> bool { let mut endp = None; @@ -1060,7 +1060,7 @@ impl Chan: GenericSmartChan { } } -impl Port: GenericPort { +impl GenericPort for Port { fn recv() -> T { let mut endp = None; endp <-> self.endp; @@ -1082,7 +1082,7 @@ impl Port: GenericPort { } } -impl Port: Peekable { +impl Peekable for Port { pure fn peek() -> bool { unsafe { let mut endp = None; @@ -1097,7 +1097,7 @@ impl Port: Peekable { } } -impl Port: Selectable { +impl Selectable for Port { pure fn header() -> *PacketHeader { unsafe { match self.endp { @@ -1132,7 +1132,7 @@ impl PortSet { } } -impl PortSet : GenericPort { +impl GenericPort for PortSet { fn try_recv() -> Option { let mut result = None; @@ -1162,7 +1162,7 @@ impl PortSet : GenericPort { } -impl PortSet : Peekable { +impl Peekable for PortSet { pure fn peek() -> bool { // It'd be nice to use self.port.each, but that version isn't // pure. @@ -1176,7 +1176,7 @@ impl PortSet : Peekable { /// A channel that can be shared between many senders. pub type SharedChan = private::Exclusive>; -impl SharedChan: GenericChan { +impl GenericChan for SharedChan { fn send(x: T) { let mut xx = Some(move x); do self.with_imm |chan| { @@ -1187,7 +1187,7 @@ impl SharedChan: GenericChan { } } -impl SharedChan: GenericSmartChan { +impl GenericSmartChan for SharedChan { fn try_send(x: T) -> bool { let mut xx = Some(move x); do self.with_imm |chan| { diff --git a/src/libcore/private.rs b/src/libcore/private.rs index e6ced90c0d3d9..9df31bbd81f2c 100644 --- a/src/libcore/private.rs +++ b/src/libcore/private.rs @@ -291,7 +291,7 @@ pub unsafe fn clone_shared_mutable_state(rc: &SharedMutableState) ArcDestruct((*rc).data) } -impl SharedMutableState: Clone { +impl Clone for SharedMutableState { fn clone(&self) -> SharedMutableState { unsafe { clone_shared_mutable_state(self) @@ -360,7 +360,7 @@ pub fn exclusive(user_data: T) -> Exclusive { Exclusive { x: unsafe { shared_mutable_state(move data) } } } -impl Exclusive: Clone { +impl Clone for Exclusive { // Duplicate an exclusive ARC, as std::arc::clone. fn clone(&self) -> Exclusive { Exclusive { x: unsafe { clone_shared_mutable_state(&self.x) } } diff --git a/src/libcore/private/at_exit.rs b/src/libcore/private/at_exit.rs index a87301dbe07bb..d80631a29ee60 100644 --- a/src/libcore/private/at_exit.rs +++ b/src/libcore/private/at_exit.rs @@ -95,4 +95,4 @@ fn test_at_exit_many() { assert j > i; } } -} \ No newline at end of file +} diff --git a/src/libcore/private/finally.rs b/src/libcore/private/finally.rs index 30a309e80b049..af7197159ca8d 100644 --- a/src/libcore/private/finally.rs +++ b/src/libcore/private/finally.rs @@ -39,7 +39,7 @@ pub trait Finally { } #[cfg(stage0)] -impl &fn() -> T: Finally { +impl Finally for &fn() -> T { // FIXME #4518: Should not require a mode here fn finally(&self, +dtor: &fn()) -> T { let _d = Finallyalizer { @@ -53,7 +53,7 @@ impl &fn() -> T: Finally { #[cfg(stage1)] #[cfg(stage2)] #[cfg(stage3)] -impl &fn() -> T: Finally { +impl Finally for &fn() -> T { fn finally(&self, dtor: &fn()) -> T { let _d = Finallyalizer { dtor: dtor @@ -67,7 +67,7 @@ struct Finallyalizer { dtor: &fn() } -impl Finallyalizer: Drop { +impl Drop for Finallyalizer { fn finalize(&self) { (self.dtor)(); } diff --git a/src/libcore/private/global.rs b/src/libcore/private/global.rs index e1ab28ce7ecbb..621ead48abc1a 100644 --- a/src/libcore/private/global.rs +++ b/src/libcore/private/global.rs @@ -146,7 +146,7 @@ struct GlobalState { map: LinearMap } -impl GlobalState: Drop { +impl Drop for GlobalState { fn finalize(&self) { for self.map.each_value |v| { match v { diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index 4369b29ba52be..acadf079b3b67 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -194,7 +194,7 @@ pub extern { } /// Extension methods for immutable pointers -impl *T: Ptr { +impl Ptr for *T { /// Returns true if the pointer is equal to the null pointer. #[inline(always)] pure fn is_null() -> bool { is_null(self) } @@ -209,7 +209,7 @@ impl *T: Ptr { } /// Extension methods for mutable pointers -impl *mut T: Ptr { +impl Ptr for *mut T { /// Returns true if the pointer is equal to the null pointer. #[inline(always)] pure fn is_null() -> bool { is_null(self) } @@ -225,7 +225,7 @@ impl *mut T: Ptr { // Equality for pointers #[cfg(notest)] -impl *const T : Eq { +impl Eq for *const T { #[inline(always)] pure fn eq(&self, other: &*const T) -> bool { unsafe { @@ -240,7 +240,7 @@ impl *const T : Eq { // Comparison for pointers #[cfg(notest)] -impl *const T : Ord { +impl Ord for *const T { #[inline(always)] pure fn lt(&self, other: &*const T) -> bool { unsafe { @@ -277,7 +277,7 @@ impl *const T : Ord { // Equality for region pointers #[cfg(notest)] -impl &const T : Eq { +impl Eq for &const T { #[inline(always)] pure fn eq(&self, other: & &self/const T) -> bool { return *(*self) == *(*other); @@ -290,7 +290,7 @@ impl &const T : Eq { // Comparison for region pointers #[cfg(notest)] -impl &const T : Ord { +impl Ord for &const T { #[inline(always)] pure fn lt(&self, other: & &self/const T) -> bool { *(*self) < *(*other) diff --git a/src/libcore/rand.rs b/src/libcore/rand.rs index 1881bd784c4cb..47a0e11941cb0 100644 --- a/src/libcore/rand.rs +++ b/src/libcore/rand.rs @@ -24,91 +24,91 @@ pub trait Rand { static fn rand(rng: rand::Rng) -> Self; } -impl int: Rand { +impl Rand for int { static fn rand(rng: rand::Rng) -> int { rng.gen_int() } } -impl i8: Rand { +impl Rand for i8 { static fn rand(rng: rand::Rng) -> i8 { rng.gen_i8() } } -impl i16: Rand { +impl Rand for i16 { static fn rand(rng: rand::Rng) -> i16 { rng.gen_i16() } } -impl i32: Rand { +impl Rand for i32 { static fn rand(rng: rand::Rng) -> i32 { rng.gen_i32() } } -impl i64: Rand { +impl Rand for i64 { static fn rand(rng: rand::Rng) -> i64 { rng.gen_i64() } } -impl u8: Rand { +impl Rand for u8 { static fn rand(rng: rand::Rng) -> u8 { rng.gen_u8() } } -impl u16: Rand { +impl Rand for u16 { static fn rand(rng: rand::Rng) -> u16 { rng.gen_u16() } } -impl u32: Rand { +impl Rand for u32 { static fn rand(rng: rand::Rng) -> u32 { rng.gen_u32() } } -impl u64: Rand { +impl Rand for u64 { static fn rand(rng: rand::Rng) -> u64 { rng.gen_u64() } } -impl float: Rand { +impl Rand for float { static fn rand(rng: rand::Rng) -> float { rng.gen_float() } } -impl f32: Rand { +impl Rand for f32 { static fn rand(rng: rand::Rng) -> f32 { rng.gen_f32() } } -impl f64: Rand { +impl Rand for f64 { static fn rand(rng: rand::Rng) -> f64 { rng.gen_f64() } } -impl char: Rand { +impl Rand for char { static fn rand(rng: rand::Rng) -> char { rng.gen_char() } } -impl bool: Rand { +impl Rand for bool { static fn rand(rng: rand::Rng) -> bool { rng.gen_bool() } } -impl Option: Rand { +impl Rand for Option { static fn rand(rng: rand::Rng) -> Option { if rng.gen_bool() { Some(Rand::rand(rng)) } else { None } @@ -377,7 +377,7 @@ fn RandRes(c: *rctx) -> RandRes { } } -impl @RandRes: Rng { +impl Rng for @RandRes { fn next() -> u32 { unsafe { return rustrt::rand_next((*self).c); @@ -418,7 +418,7 @@ struct XorShiftState { mut w: u32, } -impl XorShiftState: Rng { +impl Rng for XorShiftState { fn next() -> u32 { let x = self.x; let mut t = x ^ (x << 11); diff --git a/src/libcore/reflect.rs b/src/libcore/reflect.rs index de94100d7a506..eb407cf1128e9 100644 --- a/src/libcore/reflect.rs +++ b/src/libcore/reflect.rs @@ -72,7 +72,7 @@ impl MovePtrAdaptor { } /// Abstract type-directed pointer-movement using the MovePtr trait -impl MovePtrAdaptor: TyVisitor { +impl TyVisitor for MovePtrAdaptor { fn visit_bot(&self) -> bool { self.align_to::<()>(); if ! self.inner.visit_bot() { return false; } diff --git a/src/libcore/repr.rs b/src/libcore/repr.rs index 5848a868f4478..c2266f4fdb042 100644 --- a/src/libcore/repr.rs +++ b/src/libcore/repr.rs @@ -46,7 +46,7 @@ trait EscapedCharWriter { fn write_escaped_char(ch: char); } -impl Writer : EscapedCharWriter { +impl EscapedCharWriter for Writer { fn write_escaped_char(ch: char) { match ch { '\t' => self.write_str("\\t"), @@ -71,64 +71,64 @@ trait Repr { fn write_repr(writer: @Writer); } -impl () : Repr { +impl Repr for () { fn write_repr(writer: @Writer) { writer.write_str("()"); } } -impl bool : Repr { +impl Repr for bool { fn write_repr(writer: @Writer) { writer.write_str(if self { "true" } else { "false" }) } } -impl int : Repr { +impl Repr for int { fn write_repr(writer: @Writer) { writer.write_int(self); } } -impl i8 : Repr { +impl Repr for i8 { fn write_repr(writer: @Writer) { writer.write_int(self as int); } } -impl i16 : Repr { +impl Repr for i16 { fn write_repr(writer: @Writer) { writer.write_int(self as int); } } -impl i32 : Repr { +impl Repr for i32 { fn write_repr(writer: @Writer) { writer.write_int(self as int); } } -impl i64 : Repr { +impl Repr for i64 { // FIXME #4424: This can lose precision. fn write_repr(writer: @Writer) { writer.write_int(self as int); } } -impl uint : Repr { +impl Repr for uint { fn write_repr(writer: @Writer) { writer.write_uint(self); } } -impl u8 : Repr { +impl Repr for u8 { fn write_repr(writer: @Writer) { writer.write_uint(self as uint); } } -impl u16 : Repr { +impl Repr for u16 { fn write_repr(writer: @Writer) { writer.write_uint(self as uint); } } -impl u32 : Repr { +impl Repr for u32 { fn write_repr(writer: @Writer) { writer.write_uint(self as uint); } } -impl u64 : Repr { +impl Repr for u64 { // FIXME #4424: This can lose precision. fn write_repr(writer: @Writer) { writer.write_uint(self as uint); } } -impl float : Repr { +impl Repr for float { // FIXME #4423: This mallocs. fn write_repr(writer: @Writer) { writer.write_str(self.to_str()); } } -impl f32 : Repr { +impl Repr for f32 { // FIXME #4423 This mallocs. fn write_repr(writer: @Writer) { writer.write_str(self.to_str()); } } -impl f64 : Repr { +impl Repr for f64 { // FIXME #4423: This mallocs. fn write_repr(writer: @Writer) { writer.write_str(self.to_str()); } } -impl char : Repr { +impl Repr for char { fn write_repr(writer: @Writer) { writer.write_char(self); } } @@ -154,7 +154,7 @@ pub fn ReprVisitor(ptr: *c_void, writer: @Writer) -> ReprVisitor { writer: writer } } -impl ReprVisitor : MovePtr { +impl MovePtr for ReprVisitor { #[inline(always)] fn move_ptr(adjustment: fn(*c_void) -> *c_void) { self.ptr = adjustment(self.ptr); @@ -262,7 +262,7 @@ impl ReprVisitor { } -impl ReprVisitor : TyVisitor { +impl TyVisitor for ReprVisitor { fn visit_bot(&self) -> bool { self.writer.write_str("!"); true diff --git a/src/libcore/run.rs b/src/libcore/run.rs index 690486010ca4b..1761d7658386f 100644 --- a/src/libcore/run.rs +++ b/src/libcore/run.rs @@ -262,7 +262,7 @@ pub fn start_program(prog: &str, args: &[~str]) -> Program { } } - impl ProgRes: Program { + impl Program for ProgRes { fn get_id(&mut self) -> pid_t { return self.r.pid; } fn input(&mut self) -> io::Writer { io::fd_writer(self.r.in_fd, false) diff --git a/src/libcore/str.rs b/src/libcore/str.rs index b01f422c84a25..7e7a34f1bab0c 100644 --- a/src/libcore/str.rs +++ b/src/libcore/str.rs @@ -771,7 +771,7 @@ pure fn gt(a: &str, b: &str) -> bool { } #[cfg(notest)] -impl &str : Eq { +impl Eq for &str { #[inline(always)] pure fn eq(&self, other: & &self/str) -> bool { eq_slice((*self), (*other)) @@ -781,7 +781,7 @@ impl &str : Eq { } #[cfg(notest)] -impl ~str : Eq { +impl Eq for ~str { #[inline(always)] pure fn eq(&self, other: &~str) -> bool { eq_slice((*self), (*other)) @@ -791,7 +791,7 @@ impl ~str : Eq { } #[cfg(notest)] -impl @str : Eq { +impl Eq for @str { #[inline(always)] pure fn eq(&self, other: &@str) -> bool { eq_slice((*self), (*other)) @@ -801,7 +801,7 @@ impl @str : Eq { } #[cfg(notest)] -impl ~str : Ord { +impl Ord for ~str { #[inline(always)] pure fn lt(&self, other: &~str) -> bool { lt((*self), (*other)) } #[inline(always)] @@ -813,7 +813,7 @@ impl ~str : Ord { } #[cfg(notest)] -impl &str : Ord { +impl Ord for &str { #[inline(always)] pure fn lt(&self, other: & &self/str) -> bool { lt((*self), (*other)) } #[inline(always)] @@ -825,7 +825,7 @@ impl &str : Ord { } #[cfg(notest)] -impl @str : Ord { +impl Ord for @str { #[inline(always)] pure fn lt(&self, other: &@str) -> bool { lt((*self), (*other)) } #[inline(always)] @@ -2134,7 +2134,7 @@ pub trait Trimmable { } /// Extension methods for strings -impl ~str: Trimmable { +impl Trimmable for ~str { /// Returns a string with leading and trailing whitespace removed #[inline] pure fn trim() -> ~str { trim(self) } @@ -2151,7 +2151,7 @@ pub mod traits { use ops::Add; use str::append; - impl ~str : Add<&str,~str> { + impl Add<&str,~str> for ~str { #[inline(always)] pure fn add(&self, rhs: & &self/str) -> ~str { append(copy *self, (*rhs)) @@ -2195,7 +2195,7 @@ pub trait StrSlice { } /// Extension methods for strings -impl &str: StrSlice { +impl StrSlice for &str { /** * Return true if a predicate matches all characters or if the string * contains no characters diff --git a/src/libcore/task/local_data_priv.rs b/src/libcore/task/local_data_priv.rs index 05019c0df84c6..35bbc0347ee11 100644 --- a/src/libcore/task/local_data_priv.rs +++ b/src/libcore/task/local_data_priv.rs @@ -26,9 +26,9 @@ use rt::rust_task; type rust_task = libc::c_void; pub trait LocalData { } -impl @T: LocalData { } +impl LocalData for @T { } -impl LocalData: Eq { +impl Eq for LocalData { pure fn eq(&self, other: &@LocalData) -> bool { unsafe { let ptr_a: (uint, uint) = cast::reinterpret_cast(&(*self)); diff --git a/src/libcore/task/mod.rs b/src/libcore/task/mod.rs index 698463b214776..09c558e3be599 100644 --- a/src/libcore/task/mod.rs +++ b/src/libcore/task/mod.rs @@ -84,7 +84,7 @@ pub enum TaskResult { Failure, } -impl TaskResult : Eq { +impl Eq for TaskResult { pure fn eq(&self, other: &TaskResult) -> bool { match ((*self), (*other)) { (Success, Success) | (Failure, Failure) => true, diff --git a/src/libcore/to_bytes.rs b/src/libcore/to_bytes.rs index b4647d0c621a1..58ecf2560ace0 100644 --- a/src/libcore/to_bytes.rs +++ b/src/libcore/to_bytes.rs @@ -46,7 +46,7 @@ pub trait IterBytes { pure fn iter_bytes(&self, lsb0: bool, f: Cb); } -impl bool: IterBytes { +impl IterBytes for bool { #[inline(always)] pure fn iter_bytes(&self, _lsb0: bool, f: Cb) { f([ @@ -55,7 +55,7 @@ impl bool: IterBytes { } } -impl u8: IterBytes { +impl IterBytes for u8 { #[inline(always)] pure fn iter_bytes(&self, _lsb0: bool, f: Cb) { f([ @@ -64,7 +64,7 @@ impl u8: IterBytes { } } -impl u16: IterBytes { +impl IterBytes for u16 { #[inline(always)] pure fn iter_bytes(&self, lsb0: bool, f: Cb) { if lsb0 { @@ -81,7 +81,7 @@ impl u16: IterBytes { } } -impl u32: IterBytes { +impl IterBytes for u32 { #[inline(always)] pure fn iter_bytes(&self, lsb0: bool, f: Cb) { if lsb0 { @@ -102,7 +102,7 @@ impl u32: IterBytes { } } -impl u64: IterBytes { +impl IterBytes for u64 { #[inline(always)] pure fn iter_bytes(&self, lsb0: bool, f: Cb) { if lsb0 { @@ -131,35 +131,35 @@ impl u64: IterBytes { } } -impl i8: IterBytes { +impl IterBytes for i8 { #[inline(always)] pure fn iter_bytes(&self, lsb0: bool, f: Cb) { (*self as u8).iter_bytes(lsb0, f) } } -impl i16: IterBytes { +impl IterBytes for i16 { #[inline(always)] pure fn iter_bytes(&self, lsb0: bool, f: Cb) { (*self as u16).iter_bytes(lsb0, f) } } -impl i32: IterBytes { +impl IterBytes for i32 { #[inline(always)] pure fn iter_bytes(&self, lsb0: bool, f: Cb) { (*self as u32).iter_bytes(lsb0, f) } } -impl i64: IterBytes { +impl IterBytes for i64 { #[inline(always)] pure fn iter_bytes(&self, lsb0: bool, f: Cb) { (*self as u64).iter_bytes(lsb0, f) } } -impl char: IterBytes { +impl IterBytes for char { #[inline(always)] pure fn iter_bytes(&self, lsb0: bool, f: Cb) { (*self as u32).iter_bytes(lsb0, f) @@ -190,14 +190,14 @@ pub mod x64 { } } -impl int: IterBytes { +impl IterBytes for int { #[inline(always)] pure fn iter_bytes(&self, lsb0: bool, f: Cb) { (*self as uint).iter_bytes(lsb0, f) } } -impl &[A]: IterBytes { +impl IterBytes for &[A] { #[inline(always)] pure fn iter_bytes(&self, lsb0: bool, f: Cb) { for (*self).each |elt| { @@ -208,7 +208,7 @@ impl &[A]: IterBytes { } } -impl (A,B): IterBytes { +impl IterBytes for (A,B) { #[inline(always)] pure fn iter_bytes(&self, lsb0: bool, f: Cb) { match *self { @@ -219,7 +219,7 @@ impl (A,B): IterBytes { } } -impl (A,B,C): IterBytes { +impl IterBytes for (A,B,C) { #[inline(always)] pure fn iter_bytes(&self, lsb0: bool, f: Cb) { match *self { @@ -235,14 +235,14 @@ pure fn borrow(a: &x/[A]) -> &x/[A] { a } -impl ~[A]: IterBytes { +impl IterBytes for ~[A] { #[inline(always)] pure fn iter_bytes(&self, lsb0: bool, f: Cb) { borrow(*self).iter_bytes(lsb0, f) } } -impl @[A]: IterBytes { +impl IterBytes for @[A] { #[inline(always)] pure fn iter_bytes(&self, lsb0: bool, f: Cb) { borrow(*self).iter_bytes(lsb0, f) @@ -352,7 +352,7 @@ pub pure fn iter_bytes_7 Option: IterBytes { +impl IterBytes for Option { #[inline(always)] pure fn iter_bytes(&self, lsb0: bool, f: Cb) { match *self { @@ -389,21 +389,21 @@ impl Option: IterBytes { } } -impl &A: IterBytes { +impl IterBytes for &A { #[inline(always)] pure fn iter_bytes(&self, lsb0: bool, f: Cb) { (**self).iter_bytes(lsb0, f); } } -impl @A: IterBytes { +impl IterBytes for @A { #[inline(always)] pure fn iter_bytes(&self, lsb0: bool, f: Cb) { (**self).iter_bytes(lsb0, f); } } -impl ~A: IterBytes { +impl IterBytes for ~A { #[inline(always)] pure fn iter_bytes(&self, lsb0: bool, f: Cb) { (**self).iter_bytes(lsb0, f); @@ -412,7 +412,7 @@ impl ~A: IterBytes { // NB: raw-pointer IterBytes does _not_ dereference // to the target; it just gives you the pointer-bytes. -impl *const A: IterBytes { +impl IterBytes for *const A { #[inline(always)] pure fn iter_bytes(&self, lsb0: bool, f: Cb) { (*self as uint).iter_bytes(lsb0, f); @@ -424,7 +424,7 @@ trait ToBytes { fn to_bytes(&self, lsb0: bool) -> ~[u8]; } -impl A: ToBytes { +impl ToBytes for A { fn to_bytes(&self, lsb0: bool) -> ~[u8] { do io::with_bytes_writer |wr| { for self.iter_bytes(lsb0) |bytes| { diff --git a/src/libcore/to_str.rs b/src/libcore/to_str.rs index d98e341eab8a3..a1e77a494d5bd 100644 --- a/src/libcore/to_str.rs +++ b/src/libcore/to_str.rs @@ -22,28 +22,28 @@ pub trait ToStr { pure fn to_str(&self) -> ~str; } -impl bool: ToStr { +impl ToStr for bool { #[inline(always)] pure fn to_str(&self) -> ~str { ::bool::to_str(*self) } } -impl (): ToStr { +impl ToStr for () { #[inline(always)] pure fn to_str(&self) -> ~str { ~"()" } } -impl ~str: ToStr { +impl ToStr for ~str { #[inline(always)] pure fn to_str(&self) -> ~str { copy *self } } -impl &str: ToStr { +impl ToStr for &str { #[inline(always)] pure fn to_str(&self) -> ~str { ::str::from_slice(*self) } } -impl @str: ToStr { +impl ToStr for @str { #[inline(always)] pure fn to_str(&self) -> ~str { ::str::from_slice(*self) } } -impl (A, B): ToStr { +impl ToStr for (A, B) { #[inline(always)] pure fn to_str(&self) -> ~str { // FIXME(#4760): this causes an llvm assertion @@ -55,7 +55,7 @@ impl (A, B): ToStr { } } } -impl (A, B, C): ToStr { +impl ToStr for (A, B, C) { #[inline(always)] pure fn to_str(&self) -> ~str { // FIXME(#4760): this causes an llvm assertion @@ -72,7 +72,7 @@ impl (A, B, C): ToStr { } } -impl ~[A]: ToStr { +impl ToStr for ~[A] { #[inline(always)] pure fn to_str(&self) -> ~str { unsafe { @@ -92,11 +92,11 @@ impl ~[A]: ToStr { } } -impl @A: ToStr { +impl ToStr for @A { #[inline(always)] pure fn to_str(&self) -> ~str { ~"@" + (**self).to_str() } } -impl ~A: ToStr { +impl ToStr for ~A { #[inline(always)] pure fn to_str(&self) -> ~str { ~"~" + (**self).to_str() } } diff --git a/src/libcore/tuple.rs b/src/libcore/tuple.rs index 484fc1a5a2765..23235104e9fc6 100644 --- a/src/libcore/tuple.rs +++ b/src/libcore/tuple.rs @@ -20,7 +20,7 @@ pub trait CopyableTuple { pure fn swap() -> (U, T); } -impl (T, U): CopyableTuple { +impl CopyableTuple for (T, U) { /// Return the first element of self #[inline(always)] @@ -50,7 +50,7 @@ pub trait ImmutableTuple { pure fn second_ref(&self) -> &self/U; } -impl (T, U): ImmutableTuple { +impl ImmutableTuple for (T, U) { #[inline(always)] pure fn first_ref(&self) -> &self/T { match *self { @@ -70,7 +70,7 @@ pub trait ExtendedTupleOps { fn map(&self, f: &fn(a: &A, b: &B) -> C) -> ~[C]; } -impl (&[A], &[B]): ExtendedTupleOps { +impl ExtendedTupleOps for (&[A], &[B]) { #[inline(always)] fn zip(&self) -> ~[(A, B)] { match *self { @@ -90,7 +90,7 @@ impl (&[A], &[B]): ExtendedTupleOps { } } -impl (~[A], ~[B]): ExtendedTupleOps { +impl ExtendedTupleOps for (~[A], ~[B]) { #[inline(always)] fn zip(&self) -> ~[(A, B)] { @@ -112,7 +112,7 @@ impl (~[A], ~[B]): ExtendedTupleOps { } #[cfg(notest)] -impl (A, B) : Eq { +impl Eq for (A, B) { #[inline(always)] pure fn eq(&self, other: &(A, B)) -> bool { match (*self) { @@ -128,7 +128,7 @@ impl (A, B) : Eq { } #[cfg(notest)] -impl (A, B) : Ord { +impl Ord for (A, B) { #[inline(always)] pure fn lt(&self, other: &(A, B)) -> bool { match (*self) { @@ -153,7 +153,7 @@ impl (A, B) : Ord { } #[cfg(notest)] -impl (A, B, C) : Eq { +impl Eq for (A, B, C) { #[inline(always)] pure fn eq(&self, other: &(A, B, C)) -> bool { match (*self) { @@ -170,7 +170,7 @@ impl (A, B, C) : Eq { } #[cfg(notest)] -impl (A, B, C) : Ord { +impl Ord for (A, B, C) { #[inline(always)] pure fn lt(&self, other: &(A, B, C)) -> bool { match (*self) { diff --git a/src/libcore/vec.rs b/src/libcore/vec.rs index 966928125a98a..3808e13be1cbc 100644 --- a/src/libcore/vec.rs +++ b/src/libcore/vec.rs @@ -1559,7 +1559,7 @@ pure fn eq(a: &[T], b: &[T]) -> bool { } #[cfg(notest)] -impl &[T] : Eq { +impl Eq for &[T] { #[inline(always)] pure fn eq(&self, other: & &self/[T]) -> bool { eq((*self), (*other)) } #[inline(always)] @@ -1568,7 +1568,7 @@ impl &[T] : Eq { #[cfg(notest)] -impl ~[T] : Eq { +impl Eq for ~[T] { #[inline(always)] pure fn eq(&self, other: &~[T]) -> bool { eq((*self), (*other)) } #[inline(always)] @@ -1576,7 +1576,7 @@ impl ~[T] : Eq { } #[cfg(notest)] -impl @[T] : Eq { +impl Eq for @[T] { #[inline(always)] pure fn eq(&self, other: &@[T]) -> bool { eq((*self), (*other)) } #[inline(always)] @@ -1605,7 +1605,7 @@ pure fn ge(a: &[T], b: &[T]) -> bool { !lt(a, b) } pure fn gt(a: &[T], b: &[T]) -> bool { lt(b, a) } #[cfg(notest)] -impl &[T] : Ord { +impl Ord for &[T] { #[inline(always)] pure fn lt(&self, other: & &self/[T]) -> bool { lt((*self), (*other)) } #[inline(always)] @@ -1617,7 +1617,7 @@ impl &[T] : Ord { } #[cfg(notest)] -impl ~[T] : Ord { +impl Ord for ~[T] { #[inline(always)] pure fn lt(&self, other: &~[T]) -> bool { lt((*self), (*other)) } #[inline(always)] @@ -1629,7 +1629,7 @@ impl ~[T] : Ord { } #[cfg(notest)] -impl @[T] : Ord { +impl Ord for @[T] { #[inline(always)] pure fn lt(&self, other: &@[T]) -> bool { lt((*self), (*other)) } #[inline(always)] @@ -1646,7 +1646,7 @@ pub mod traits { use ops::Add; use vec::append; - impl ~[T] : Add<&[const T],~[T]> { + impl Add<&[const T],~[T]> for ~[T] { #[inline(always)] pure fn add(&self, rhs: & &self/[const T]) -> ~[T] { append(copy *self, (*rhs)) @@ -1654,7 +1654,7 @@ pub mod traits { } } -impl &[const T]: Container { +impl Container for &[const T] { /// Returns true if a vector contains no elements #[inline] pure fn is_empty(&self) -> bool { is_empty(*self) } @@ -1673,7 +1673,7 @@ pub trait CopyableVector { } /// Extension methods for vectors -impl &[const T]: CopyableVector { +impl CopyableVector for &[const T] { /// Returns the first element of a vector #[inline] pure fn head(&self) -> T { head(*self) } @@ -1709,7 +1709,7 @@ pub trait ImmutableVector { } /// Extension methods for vectors -impl &[T]: ImmutableVector { +impl ImmutableVector for &[T] { /// Return a slice that points into another slice. #[inline] pure fn view(&self, start: uint, end: uint) -> &self/[T] { @@ -1780,7 +1780,7 @@ pub trait ImmutableEqVector { pure fn rposition_elem(&self, t: &T) -> Option; } -impl &[T]: ImmutableEqVector { +impl ImmutableEqVector for &[T] { /** * Find the first index matching some predicate * @@ -1825,7 +1825,7 @@ pub trait ImmutableCopyableVector { } /// Extension methods for vectors -impl &[T]: ImmutableCopyableVector { +impl ImmutableCopyableVector for &[T] { /** * Construct a new vector from the elements of a vector for which some * predicate holds. @@ -1876,7 +1876,7 @@ pub trait OwnedVector { fn partition(self, f: pure fn(&T) -> bool) -> (~[T], ~[T]); } -impl ~[T]: OwnedVector { +impl OwnedVector for ~[T] { #[inline] fn push(&mut self, t: T) { push(self, t); @@ -1947,7 +1947,7 @@ impl ~[T]: OwnedVector { } } -impl ~[T]: Mutable { +impl Mutable for ~[T] { /// Clear the vector, removing all values. fn clear(&mut self) { self.truncate(0) } } @@ -1959,7 +1959,7 @@ pub trait OwnedCopyableVector { fn grow_set(&mut self, index: uint, initval: &T, val: T); } -impl ~[T]: OwnedCopyableVector { +impl OwnedCopyableVector for ~[T] { #[inline] fn push_all(&mut self, rhs: &[const T]) { push_all(self, rhs); @@ -1985,7 +1985,7 @@ trait OwnedEqVector { fn dedup(&mut self); } -impl ~[T]: OwnedEqVector { +impl OwnedEqVector for ~[T] { #[inline] fn dedup(&mut self) { dedup(self) @@ -2218,7 +2218,7 @@ pub mod bytes { // This cannot be used with iter-trait.rs because of the region pointer // required in the slice. -impl &[A]: iter::BaseIter { +impl iter::BaseIter for &[A] { pub pure fn each(&self, blk: fn(v: &A) -> bool) { // FIXME(#2263)---should be able to call each(self, blk) for each(*self) |e| { @@ -2231,7 +2231,7 @@ impl &[A]: iter::BaseIter { } // FIXME(#4148): This should be redundant -impl ~[A]: iter::BaseIter { +impl iter::BaseIter for ~[A] { pub pure fn each(&self, blk: fn(v: &A) -> bool) { // FIXME(#2263)---should be able to call each(self, blk) for each(*self) |e| { @@ -2244,7 +2244,7 @@ impl ~[A]: iter::BaseIter { } // FIXME(#4148): This should be redundant -impl @[A]: iter::BaseIter { +impl iter::BaseIter for @[A] { pub pure fn each(&self, blk: fn(v: &A) -> bool) { // FIXME(#2263)---should be able to call each(self, blk) for each(*self) |e| { @@ -2256,7 +2256,7 @@ impl @[A]: iter::BaseIter { pure fn size_hint(&self) -> Option { Some(len(*self)) } } -impl &[A]: iter::ExtendedIter { +impl iter::ExtendedIter for &[A] { pub pure fn eachi(&self, blk: fn(uint, v: &A) -> bool) { iter::eachi(self, blk) } @@ -2282,7 +2282,7 @@ impl &[A]: iter::ExtendedIter { } // FIXME(#4148): This should be redundant -impl ~[A]: iter::ExtendedIter { +impl iter::ExtendedIter for ~[A] { pub pure fn eachi(&self, blk: fn(uint, v: &A) -> bool) { iter::eachi(self, blk) } @@ -2308,7 +2308,7 @@ impl ~[A]: iter::ExtendedIter { } // FIXME(#4148): This should be redundant -impl @[A]: iter::ExtendedIter { +impl iter::ExtendedIter for @[A] { pub pure fn eachi(&self, blk: fn(uint, v: &A) -> bool) { iter::eachi(self, blk) } @@ -2333,24 +2333,24 @@ impl @[A]: iter::ExtendedIter { } } -impl &[A]: iter::EqIter { +impl iter::EqIter for &[A] { pub pure fn contains(&self, x: &A) -> bool { iter::contains(self, x) } pub pure fn count(&self, x: &A) -> uint { iter::count(self, x) } } // FIXME(#4148): This should be redundant -impl ~[A]: iter::EqIter { +impl iter::EqIter for ~[A] { pub pure fn contains(&self, x: &A) -> bool { iter::contains(self, x) } pub pure fn count(&self, x: &A) -> uint { iter::count(self, x) } } // FIXME(#4148): This should be redundant -impl @[A]: iter::EqIter { +impl iter::EqIter for @[A] { pub pure fn contains(&self, x: &A) -> bool { iter::contains(self, x) } pub pure fn count(&self, x: &A) -> uint { iter::count(self, x) } } -impl &[A]: iter::CopyableIter { +impl iter::CopyableIter for &[A] { pure fn filter_to_vec(&self, pred: fn(&A) -> bool) -> ~[A] { iter::filter_to_vec(self, pred) } @@ -2361,7 +2361,7 @@ impl &[A]: iter::CopyableIter { } // FIXME(#4148): This should be redundant -impl ~[A]: iter::CopyableIter { +impl iter::CopyableIter for ~[A] { pure fn filter_to_vec(&self, pred: fn(&A) -> bool) -> ~[A] { iter::filter_to_vec(self, pred) } @@ -2372,7 +2372,7 @@ impl ~[A]: iter::CopyableIter { } // FIXME(#4148): This should be redundant -impl @[A]: iter::CopyableIter { +impl iter::CopyableIter for @[A] { pure fn filter_to_vec(&self, pred: fn(&A) -> bool) -> ~[A] { iter::filter_to_vec(self, pred) } @@ -2382,24 +2382,24 @@ impl @[A]: iter::CopyableIter { } } -impl &[A]: iter::CopyableOrderedIter { +impl iter::CopyableOrderedIter for &[A] { pure fn min(&self) -> A { iter::min(self) } pure fn max(&self) -> A { iter::max(self) } } // FIXME(#4148): This should be redundant -impl ~[A]: iter::CopyableOrderedIter { +impl iter::CopyableOrderedIter for ~[A] { pure fn min(&self) -> A { iter::min(self) } pure fn max(&self) -> A { iter::max(self) } } // FIXME(#4148): This should be redundant -impl @[A]: iter::CopyableOrderedIter { +impl iter::CopyableOrderedIter for @[A] { pure fn min(&self) -> A { iter::min(self) } pure fn max(&self) -> A { iter::max(self) } } -impl &[A] : iter::CopyableNonstrictIter { +impl iter::CopyableNonstrictIter for &[A] { pure fn each_val(&const self, f: fn(A) -> bool) { let mut i = 0; while i < self.len() { @@ -2410,7 +2410,7 @@ impl &[A] : iter::CopyableNonstrictIter { } // FIXME(#4148): This should be redundant -impl ~[A] : iter::CopyableNonstrictIter { +impl iter::CopyableNonstrictIter for ~[A] { pure fn each_val(&const self, f: fn(A) -> bool) { let mut i = 0; while i < self.len() { @@ -2421,7 +2421,7 @@ impl ~[A] : iter::CopyableNonstrictIter { } // FIXME(#4148): This should be redundant -impl @[A] : iter::CopyableNonstrictIter { +impl iter::CopyableNonstrictIter for @[A] { pure fn each_val(&const self, f: fn(A) -> bool) { let mut i = 0; while i < self.len() { diff --git a/src/librustc/metadata/decoder.rs b/src/librustc/metadata/decoder.rs index cb56136f1c466..3564e10790d3a 100644 --- a/src/librustc/metadata/decoder.rs +++ b/src/librustc/metadata/decoder.rs @@ -120,7 +120,7 @@ enum Family { InheritedField // N } -impl Family : cmp::Eq { +impl cmp::Eq for Family { pure fn eq(&self, other: &Family) -> bool { ((*self) as uint) == ((*other) as uint) } diff --git a/src/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs index eac459ec703d0..ed4ea665aafcd 100644 --- a/src/librustc/metadata/filesearch.rs +++ b/src/librustc/metadata/filesearch.rs @@ -41,7 +41,7 @@ pub fn mk_filesearch(maybe_sysroot: Option, type filesearch_impl = {sysroot: Path, addl_lib_search_paths: ~[Path], target_triple: ~str}; - impl filesearch_impl: FileSearch { + impl FileSearch for filesearch_impl { fn sysroot() -> Path { /*bad*/copy self.sysroot } fn lib_search_paths() -> ~[Path] { let mut paths = /*bad*/copy self.addl_lib_search_paths; diff --git a/src/librustc/middle/astencode.rs b/src/librustc/middle/astencode.rs index af2465fe4d14d..3b84216b2e6db 100644 --- a/src/librustc/middle/astencode.rs +++ b/src/librustc/middle/astencode.rs @@ -224,19 +224,19 @@ impl extended_decode_ctxt { } } -impl ast::def_id: tr_intern { +impl tr_intern for ast::def_id { fn tr_intern(xcx: extended_decode_ctxt) -> ast::def_id { xcx.tr_intern_def_id(self) } } -impl ast::def_id: tr { +impl tr for ast::def_id { fn tr(xcx: extended_decode_ctxt) -> ast::def_id { xcx.tr_def_id(self) } } -impl span: tr { +impl tr for span { fn tr(xcx: extended_decode_ctxt) -> span { xcx.tr_span(self) } @@ -246,7 +246,7 @@ trait def_id_encoder_helpers { fn emit_def_id(did: ast::def_id); } -impl S: def_id_encoder_helpers { +impl def_id_encoder_helpers for S { fn emit_def_id(did: ast::def_id) { did.encode(&self) } @@ -256,7 +256,7 @@ trait def_id_decoder_helpers { fn read_def_id(xcx: extended_decode_ctxt) -> ast::def_id; } -impl D: def_id_decoder_helpers { +impl def_id_decoder_helpers for D { fn read_def_id(xcx: extended_decode_ctxt) -> ast::def_id { let did: ast::def_id = Decodable::decode(&self); @@ -402,7 +402,7 @@ fn decode_def(xcx: extended_decode_ctxt, doc: ebml::Doc) -> ast::def { def.tr(xcx) } -impl ast::def: tr { +impl tr for ast::def { fn tr(xcx: extended_decode_ctxt) -> ast::def { match self { ast::def_fn(did, p) => { ast::def_fn(did.tr(xcx), p) } @@ -447,7 +447,7 @@ impl ast::def: tr { // ______________________________________________________________________ // Encoding and decoding of adjustment information -impl ty::AutoAdjustment: tr { +impl tr for ty::AutoAdjustment { fn tr(xcx: extended_decode_ctxt) -> ty::AutoAdjustment { ty::AutoAdjustment { autoderefs: self.autoderefs, @@ -456,7 +456,7 @@ impl ty::AutoAdjustment: tr { } } -impl ty::AutoRef: tr { +impl tr for ty::AutoRef { fn tr(xcx: extended_decode_ctxt) -> ty::AutoRef { ty::AutoRef { kind: self.kind, @@ -466,7 +466,7 @@ impl ty::AutoRef: tr { } } -impl ty::Region: tr { +impl tr for ty::Region { fn tr(xcx: extended_decode_ctxt) -> ty::Region { match self { ty::re_bound(br) => ty::re_bound(br.tr(xcx)), @@ -477,7 +477,7 @@ impl ty::Region: tr { } } -impl ty::bound_region: tr { +impl tr for ty::bound_region { fn tr(xcx: extended_decode_ctxt) -> ty::bound_region { match self { ty::br_anon(_) | ty::br_named(_) | ty::br_self | @@ -499,14 +499,14 @@ trait ebml_decoder_helper { fn read_freevar_entry(xcx: extended_decode_ctxt) -> freevar_entry; } -impl reader::Decoder: ebml_decoder_helper { +impl ebml_decoder_helper for reader::Decoder { fn read_freevar_entry(xcx: extended_decode_ctxt) -> freevar_entry { let fv: freevar_entry = Decodable::decode(&self); fv.tr(xcx) } } -impl freevar_entry: tr { +impl tr for freevar_entry { fn tr(xcx: extended_decode_ctxt) -> freevar_entry { freevar_entry { def: self.def.tr(xcx), @@ -522,14 +522,14 @@ trait capture_var_helper { fn read_capture_var(xcx: extended_decode_ctxt) -> moves::CaptureVar; } -impl reader::Decoder : capture_var_helper { +impl capture_var_helper for reader::Decoder { fn read_capture_var(xcx: extended_decode_ctxt) -> moves::CaptureVar { let cvar: moves::CaptureVar = Decodable::decode(&self); cvar.tr(xcx) } } -impl moves::CaptureVar : tr { +impl tr for moves::CaptureVar { fn tr(xcx: extended_decode_ctxt) -> moves::CaptureVar { moves::CaptureVar { def: self.def.tr(xcx), @@ -562,7 +562,7 @@ fn encode_method_map_entry(ecx: @e::encode_ctxt, } } -impl reader::Decoder: read_method_map_entry_helper { +impl read_method_map_entry_helper for reader::Decoder { fn read_method_map_entry(xcx: extended_decode_ctxt) -> method_map_entry { do self.read_rec { method_map_entry { @@ -583,7 +583,7 @@ impl reader::Decoder: read_method_map_entry_helper { } } -impl method_origin: tr { +impl tr for method_origin { fn tr(xcx: extended_decode_ctxt) -> method_origin { match self { typeck::method_static(did) => { @@ -673,7 +673,7 @@ trait vtable_decoder_helpers { fn read_vtable_origin(xcx: extended_decode_ctxt) -> typeck::vtable_origin; } -impl reader::Decoder: vtable_decoder_helpers { +impl vtable_decoder_helpers for reader::Decoder { fn read_vtable_res(xcx: extended_decode_ctxt) -> typeck::vtable_res { @self.read_to_vec(|| self.read_vtable_origin(xcx) ) } @@ -731,7 +731,7 @@ trait get_ty_str_ctxt { fn ty_str_ctxt() -> @tyencode::ctxt; } -impl @e::encode_ctxt: get_ty_str_ctxt { +impl get_ty_str_ctxt for @e::encode_ctxt { fn ty_str_ctxt() -> @tyencode::ctxt { @tyencode::ctxt {diag: self.tcx.sess.diagnostic(), ds: e::def_to_str, @@ -750,7 +750,7 @@ trait ebml_writer_helpers { fn emit_tpbt(ecx: @e::encode_ctxt, tpbt: ty::ty_param_bounds_and_ty); } -impl writer::Encoder: ebml_writer_helpers { +impl ebml_writer_helpers for writer::Encoder { fn emit_ty(ecx: @e::encode_ctxt, ty: ty::t) { do self.emit_opaque { e::write_type(ecx, self, ty) @@ -803,7 +803,7 @@ trait write_tag_and_id { fn id(id: ast::node_id); } -impl writer::Encoder: write_tag_and_id { +impl write_tag_and_id for writer::Encoder { fn tag(tag_id: c::astencode_tag, f: fn()) { do self.wr_tag(tag_id as uint) { f() } } @@ -981,7 +981,7 @@ trait doc_decoder_helpers { fn opt_child(tag: c::astencode_tag) -> Option; } -impl ebml::Doc: doc_decoder_helpers { +impl doc_decoder_helpers for ebml::Doc { fn as_int() -> int { reader::doc_as_u64(self) as int } fn opt_child(tag: c::astencode_tag) -> Option { reader::maybe_get_doc(self, tag as uint) @@ -1000,7 +1000,7 @@ trait ebml_decoder_decoder_helpers { did: ast::def_id) -> ast::def_id; } -impl reader::Decoder: ebml_decoder_decoder_helpers { +impl ebml_decoder_decoder_helpers for reader::Decoder { fn read_arg(xcx: extended_decode_ctxt) -> ty::arg { do self.read_opaque |doc| { tydecode::parse_arg_data( @@ -1198,7 +1198,7 @@ trait fake_ext_ctxt { type fake_session = parse::parse_sess; #[cfg(test)] -impl fake_session: fake_ext_ctxt { +impl fake_ext_ctxt for fake_session { fn cfg() -> ast::crate_cfg { ~[] } fn parse_sess() -> parse::parse_sess { self } fn call_site() -> span { diff --git a/src/librustc/middle/lint.rs b/src/librustc/middle/lint.rs index da153778b9abb..6e5146818b0cc 100644 --- a/src/librustc/middle/lint.rs +++ b/src/librustc/middle/lint.rs @@ -106,7 +106,7 @@ pub enum level { allow, warn, deny, forbid } -impl level : cmp::Eq { +impl cmp::Eq for level { pure fn eq(&self, other: &level) -> bool { ((*self) as uint) == ((*other) as uint) } diff --git a/src/librustc/middle/liveness.rs b/src/librustc/middle/liveness.rs index 3d105ad551182..d65c4e0158055 100644 --- a/src/librustc/middle/liveness.rs +++ b/src/librustc/middle/liveness.rs @@ -141,12 +141,12 @@ pub type last_use_map = HashMap>; enum Variable = uint; enum LiveNode = uint; -impl Variable : cmp::Eq { +impl cmp::Eq for Variable { pure fn eq(&self, other: &Variable) -> bool { *(*self) == *(*other) } pure fn ne(&self, other: &Variable) -> bool { *(*self) != *(*other) } } -impl LiveNode : cmp::Eq { +impl cmp::Eq for LiveNode { pure fn eq(&self, other: &LiveNode) -> bool { *(*self) == *(*other) } pure fn ne(&self, other: &LiveNode) -> bool { *(*self) != *(*other) } } @@ -158,7 +158,7 @@ enum LiveNodeKind { ExitNode } -impl LiveNodeKind : cmp::Eq { +impl cmp::Eq for LiveNodeKind { pure fn eq(&self, other: &LiveNodeKind) -> bool { match (*self) { FreeVarNode(e0a) => { @@ -224,11 +224,11 @@ pub fn check_crate(tcx: ty::ctxt, return last_use_map; } -impl LiveNode: to_str::ToStr { +impl to_str::ToStr for LiveNode { pure fn to_str(&self) -> ~str { fmt!("ln(%u)", **self) } } -impl Variable: to_str::ToStr { +impl to_str::ToStr for Variable { pure fn to_str(&self) -> ~str { fmt!("v(%u)", **self) } } diff --git a/src/librustc/middle/trans/cabi.rs b/src/librustc/middle/trans/cabi.rs index 908c567761411..bc48519ffda4c 100644 --- a/src/librustc/middle/trans/cabi.rs +++ b/src/librustc/middle/trans/cabi.rs @@ -179,7 +179,7 @@ pub impl FnType { enum LLVM_ABIInfo { LLVM_ABIInfo } -impl LLVM_ABIInfo: ABIInfo { +impl ABIInfo for LLVM_ABIInfo { fn compute_info(&self, atys: &[TypeRef], rty: TypeRef, diff --git a/src/librustc/middle/trans/cabi_x86_64.rs b/src/librustc/middle/trans/cabi_x86_64.rs index bac91e17e0309..a3c5e094ea819 100644 --- a/src/librustc/middle/trans/cabi_x86_64.rs +++ b/src/librustc/middle/trans/cabi_x86_64.rs @@ -32,7 +32,7 @@ enum x86_64_reg_class { memory_class } -impl x86_64_reg_class : cmp::Eq { +impl cmp::Eq for x86_64_reg_class { pure fn eq(&self, other: &x86_64_reg_class) -> bool { ((*self) as uint) == ((*other) as uint) } @@ -402,7 +402,7 @@ fn x86_64_tys(atys: &[TypeRef], enum X86_64_ABIInfo { X86_64_ABIInfo } -impl X86_64_ABIInfo: ABIInfo { +impl ABIInfo for X86_64_ABIInfo { fn compute_info(&self, atys: &[TypeRef], rty: TypeRef, diff --git a/src/librustc/middle/trans/expr.rs b/src/librustc/middle/trans/expr.rs index 30ba0e7feeec8..6af6adbf68dca 100644 --- a/src/librustc/middle/trans/expr.rs +++ b/src/librustc/middle/trans/expr.rs @@ -165,7 +165,7 @@ impl Dest { } } -impl Dest : cmp::Eq { +impl cmp::Eq for Dest { pure fn eq(&self, other: &Dest) -> bool { match ((*self), (*other)) { (SaveIn(e0a), SaveIn(e0b)) => e0a == e0b, @@ -1516,7 +1516,7 @@ pub enum cast_kind { cast_other, } -impl cast_kind : cmp::Eq { +impl cmp::Eq for cast_kind { pure fn eq(&self, other: &cast_kind) -> bool { match ((*self), (*other)) { (cast_pointer, cast_pointer) => true, diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index 23c9f349cdbdf..f7fb5b771aa74 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -111,7 +111,7 @@ pub struct creader_cache_key { type creader_cache = HashMap; -impl creader_cache_key : to_bytes::IterBytes { +impl to_bytes::IterBytes for creader_cache_key { pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) { to_bytes::iter_bytes_3(&self.cnum, &self.pos, &self.len, lsb0, f); } @@ -125,7 +125,7 @@ struct intern_key { // NB: Do not replace this with #[deriving_eq]. The automatically-derived // implementation will not recurse through sty and you will get stack // exhaustion. -impl intern_key : cmp::Eq { +impl cmp::Eq for intern_key { pure fn eq(&self, other: &intern_key) -> bool { unsafe { *self.sty == *other.sty && self.o_def_id == other.o_def_id @@ -136,7 +136,7 @@ impl intern_key : cmp::Eq { } } -impl intern_key : to_bytes::IterBytes { +impl to_bytes::IterBytes for intern_key { pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) { unsafe { to_bytes::iter_bytes_2(&*self.sty, &self.o_def_id, lsb0, f); @@ -155,7 +155,7 @@ pub type opt_region_variance = Option; #[auto_decode] pub enum region_variance { rv_covariant, rv_invariant, rv_contravariant } -impl region_variance : cmp::Eq { +impl cmp::Eq for region_variance { pure fn eq(&self, other: ®ion_variance) -> bool { match ((*self), (*other)) { (rv_covariant, rv_covariant) => true, @@ -372,13 +372,13 @@ pub struct FnSig { output: t } -impl BareFnTy : to_bytes::IterBytes { +impl to_bytes::IterBytes for BareFnTy { pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) { to_bytes::iter_bytes_3(&self.purity, &self.abi, &self.sig, lsb0, f) } } -impl ClosureTy : to_bytes::IterBytes { +impl to_bytes::IterBytes for ClosureTy { pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) { to_bytes::iter_bytes_5(&self.purity, &self.sigil, &self.onceness, &self.region, &self.sig, lsb0, f) @@ -391,7 +391,7 @@ pub struct param_ty { def_id: def_id } -impl param_ty : to_bytes::IterBytes { +impl to_bytes::IterBytes for param_ty { pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) { to_bytes::iter_bytes_2(&self.idx, &self.def_id, lsb0, f) } @@ -597,7 +597,7 @@ pub enum InferTy { FloatVar(FloatVid) } -impl InferTy : to_bytes::IterBytes { +impl to_bytes::IterBytes for InferTy { pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) { match *self { TyVar(ref tv) => to_bytes::iter_bytes_2(&0u8, tv, lsb0, f), @@ -614,7 +614,7 @@ pub enum InferRegion { ReSkolemized(uint, bound_region) } -impl InferRegion : to_bytes::IterBytes { +impl to_bytes::IterBytes for InferRegion { pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) { match *self { ReVar(ref rv) => to_bytes::iter_bytes_2(&0u8, rv, lsb0, f), @@ -623,7 +623,7 @@ impl InferRegion : to_bytes::IterBytes { } } -impl InferRegion : cmp::Eq { +impl cmp::Eq for InferRegion { pure fn eq(&self, other: &InferRegion) -> bool { match ((*self), *other) { (ReVar(rva), ReVar(rvb)) => { @@ -640,7 +640,7 @@ impl InferRegion : cmp::Eq { } } -impl param_bound : to_bytes::IterBytes { +impl to_bytes::IterBytes for param_bound { pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) { match *self { bound_copy => 0u8.iter_bytes(lsb0, f), @@ -1817,19 +1817,19 @@ pub impl TypeContents { } } -impl TypeContents : ops::Add { +impl ops::Add for TypeContents { pure fn add(&self, other: &TypeContents) -> TypeContents { TypeContents {bits: self.bits | other.bits} } } -impl TypeContents : ops::Sub { +impl ops::Sub for TypeContents { pure fn sub(&self, other: &TypeContents) -> TypeContents { TypeContents {bits: self.bits & !other.bits} } } -impl TypeContents : ToStr { +impl ToStr for TypeContents { pure fn to_str(&self) -> ~str { fmt!("TypeContents(%s)", u32::to_str_radix(self.bits, 2)) } @@ -2586,7 +2586,7 @@ pub fn index_sty(cx: ctxt, sty: &sty) -> Option { } } -impl bound_region : to_bytes::IterBytes { +impl to_bytes::IterBytes for bound_region { pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) { match *self { ty::br_self => 0u8.iter_bytes(lsb0, f), @@ -2606,7 +2606,7 @@ impl bound_region : to_bytes::IterBytes { } } -impl Region : to_bytes::IterBytes { +impl to_bytes::IterBytes for Region { pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) { match *self { re_bound(ref br) => @@ -2626,7 +2626,7 @@ impl Region : to_bytes::IterBytes { } } -impl vstore : to_bytes::IterBytes { +impl to_bytes::IterBytes for vstore { pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) { match *self { vstore_fixed(ref u) => @@ -2641,7 +2641,7 @@ impl vstore : to_bytes::IterBytes { } } -impl substs : to_bytes::IterBytes { +impl to_bytes::IterBytes for substs { pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) { to_bytes::iter_bytes_3(&self.self_r, &self.self_ty, @@ -2649,28 +2649,28 @@ impl substs : to_bytes::IterBytes { } } -impl mt : to_bytes::IterBytes { +impl to_bytes::IterBytes for mt { pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) { to_bytes::iter_bytes_2(&self.ty, &self.mutbl, lsb0, f) } } -impl field : to_bytes::IterBytes { +impl to_bytes::IterBytes for field { pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) { to_bytes::iter_bytes_2(&self.ident, &self.mt, lsb0, f) } } -impl arg : to_bytes::IterBytes { +impl to_bytes::IterBytes for arg { pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) { to_bytes::iter_bytes_2(&self.mode, &self.ty, lsb0, f) } } -impl FnSig : to_bytes::IterBytes { +impl to_bytes::IterBytes for FnSig { pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) { to_bytes::iter_bytes_2(&self.inputs, &self.output, @@ -2678,7 +2678,7 @@ impl FnSig : to_bytes::IterBytes { } } -impl sty : to_bytes::IterBytes { +impl to_bytes::IterBytes for sty { pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) { match *self { ty_nil => 0u8.iter_bytes(lsb0, f), @@ -4383,14 +4383,14 @@ pub fn get_impl_id(tcx: ctxt, trait_id: def_id, self_ty: t) -> def_id { } } -impl mt : cmp::Eq { +impl cmp::Eq for mt { pure fn eq(&self, other: &mt) -> bool { (*self).ty == (*other).ty && (*self).mutbl == (*other).mutbl } pure fn ne(&self, other: &mt) -> bool { !(*self).eq(other) } } -impl vstore : cmp::Eq { +impl cmp::Eq for vstore { pure fn eq(&self, other: &vstore) -> bool { match (*self) { vstore_fixed(e0a) => { @@ -4422,7 +4422,7 @@ impl vstore : cmp::Eq { pure fn ne(&self, other: &vstore) -> bool { !(*self).eq(other) } } -impl Region : cmp::Eq { +impl cmp::Eq for Region { pure fn eq(&self, other: &Region) -> bool { match (*self) { re_bound(e0a) => { @@ -4460,7 +4460,7 @@ impl Region : cmp::Eq { pure fn ne(&self, other: &Region) -> bool { !(*self).eq(other) } } -impl bound_region : cmp::Eq { +impl cmp::Eq for bound_region { pure fn eq(&self, other: &bound_region) -> bool { match (*self) { br_self => { @@ -4498,7 +4498,7 @@ impl bound_region : cmp::Eq { pure fn ne(&self, other: &bound_region) -> bool { !(*self).eq(other) } } -impl param_bound : cmp::Eq { +impl cmp::Eq for param_bound { pure fn eq(&self, other: ¶m_bound) -> bool { match (*self) { bound_copy => { diff --git a/src/librustc/middle/typeck/infer/mod.rs b/src/librustc/middle/typeck/infer/mod.rs index fd967956b488f..f6af29c1a8df9 100644 --- a/src/librustc/middle/typeck/infer/mod.rs +++ b/src/librustc/middle/typeck/infer/mod.rs @@ -490,7 +490,7 @@ trait then { -> Result; } -impl ures: then { +impl then for ures { fn then(f: fn() -> Result) -> Result { self.chain(|_i| f()) @@ -501,7 +501,7 @@ trait ToUres { fn to_ures() -> ures; } -impl cres: ToUres { +impl ToUres for cres { fn to_ures() -> ures { match self { Ok(ref _v) => Ok(()), @@ -514,7 +514,7 @@ trait CresCompare { fn compare(t: T, f: fn() -> ty::type_err) -> cres; } -impl cres: CresCompare { +impl CresCompare for cres { fn compare(t: T, f: fn() -> ty::type_err) -> cres { do self.chain |s| { if s == t { diff --git a/src/librustc/middle/typeck/infer/region_inference.rs b/src/librustc/middle/typeck/infer/region_inference.rs index 230bfe693e093..c838a52a6892f 100644 --- a/src/librustc/middle/typeck/infer/region_inference.rs +++ b/src/librustc/middle/typeck/infer/region_inference.rs @@ -568,7 +568,7 @@ enum Constraint { ConstrainVarSubReg(RegionVid, Region) } -impl Constraint : cmp::Eq { +impl cmp::Eq for Constraint { pure fn eq(&self, other: &Constraint) -> bool { match ((*self), (*other)) { (ConstrainVarSubVar(v0a, v1a), ConstrainVarSubVar(v0b, v1b)) => { @@ -588,7 +588,7 @@ impl Constraint : cmp::Eq { pure fn ne(&self, other: &Constraint) -> bool { !(*self).eq(other) } } -impl Constraint : to_bytes::IterBytes { +impl to_bytes::IterBytes for Constraint { pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) { match *self { ConstrainVarSubVar(ref v0, ref v1) => @@ -608,14 +608,14 @@ struct TwoRegions { b: Region, } -impl TwoRegions : cmp::Eq { +impl cmp::Eq for TwoRegions { pure fn eq(&self, other: &TwoRegions) -> bool { (*self).a == (*other).a && (*self).b == (*other).b } pure fn ne(&self, other: &TwoRegions) -> bool { !(*self).eq(other) } } -impl TwoRegions : to_bytes::IterBytes { +impl to_bytes::IterBytes for TwoRegions { pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) { to_bytes::iter_bytes_2(&self.a, &self.b, lsb0, f) } diff --git a/src/librustc/middle/typeck/mod.rs b/src/librustc/middle/typeck/mod.rs index caa02da2858bc..fa02c14b6c906 100644 --- a/src/librustc/middle/typeck/mod.rs +++ b/src/librustc/middle/typeck/mod.rs @@ -279,7 +279,7 @@ trait get_and_find_region { fn find(br: ty::bound_region) -> Option; } -impl isr_alist: get_and_find_region { +impl get_and_find_region for isr_alist { fn get(br: ty::bound_region) -> ty::Region { self.find(br).get() } diff --git a/src/librustdoc/astsrv.rs b/src/librustdoc/astsrv.rs index 1d629467a42e9..f07701f05e799 100644 --- a/src/librustdoc/astsrv.rs +++ b/src/librustdoc/astsrv.rs @@ -59,7 +59,7 @@ pub struct Srv { ch: SharedChan } -impl Srv: Clone { +impl Clone for Srv { fn clone(&self) -> Srv { Srv { ch: self.ch.clone() diff --git a/src/librustdoc/config.rs b/src/librustdoc/config.rs index 90b18599620cb..f75f4b83a1d62 100644 --- a/src/librustdoc/config.rs +++ b/src/librustdoc/config.rs @@ -28,7 +28,7 @@ pub enum OutputFormat { pub PandocHtml } -impl OutputFormat : cmp::Eq { +impl cmp::Eq for OutputFormat { pure fn eq(&self, other: &OutputFormat) -> bool { ((*self) as uint) == ((*other) as uint) } @@ -43,7 +43,7 @@ pub enum OutputStyle { pub DocPerMod } -impl OutputStyle : cmp::Eq { +impl cmp::Eq for OutputStyle { pure fn eq(&self, other: &OutputStyle) -> bool { ((*self) as uint) == ((*other) as uint) } diff --git a/src/librustdoc/demo.rs b/src/librustdoc/demo.rs index ffc0d668aed77..3c45c4a6fa036 100644 --- a/src/librustdoc/demo.rs +++ b/src/librustdoc/demo.rs @@ -187,7 +187,7 @@ trait TheShunnedHouse { } /// Whatever -impl OmNomNomy: TheShunnedHouse { +impl TheShunnedHouse for OmNomNomy { fn dingy_house(&self, _unkempt_yard: int) { } diff --git a/src/librustdoc/doc.rs b/src/librustdoc/doc.rs index 2eb4ed9787132..40617e13b8d5e 100644 --- a/src/librustdoc/doc.rs +++ b/src/librustdoc/doc.rs @@ -284,7 +284,7 @@ pub trait PageUtils { fn types(&self) -> ~[TyDoc]; } -impl ~[Page]: PageUtils { +impl PageUtils for ~[Page] { fn mods(&self) -> ~[ModDoc] { do vec::filter_mapped(*self) |page| { @@ -363,7 +363,7 @@ pub trait Item { pure fn item(&self) -> ItemDoc; } -impl ItemTag: Item { +impl Item for ItemTag { pure fn item(&self) -> ItemDoc { match self { &doc::ModTag(ref doc) => copy doc.item, @@ -379,31 +379,31 @@ impl ItemTag: Item { } } -impl SimpleItemDoc: Item { +impl Item for SimpleItemDoc { pure fn item(&self) -> ItemDoc { copy self.item } } -impl ModDoc: Item { +impl Item for ModDoc { pure fn item(&self) -> ItemDoc { copy self.item } } -impl NmodDoc: Item { +impl Item for NmodDoc { pure fn item(&self) -> ItemDoc { copy self.item } } -impl EnumDoc: Item { +impl Item for EnumDoc { pure fn item(&self) -> ItemDoc { copy self.item } } -impl TraitDoc: Item { +impl Item for TraitDoc { pure fn item(&self) -> ItemDoc { copy self.item } } -impl ImplDoc: Item { +impl Item for ImplDoc { pure fn item(&self) -> ItemDoc { copy self.item } } -impl StructDoc: Item { +impl Item for StructDoc { pure fn item(&self) -> ItemDoc { copy self.item } } @@ -416,7 +416,7 @@ pub trait ItemUtils { pure fn sections(&self) -> ~[Section]; } -impl A: ItemUtils { +impl ItemUtils for A { pure fn id(&self) -> AstId { self.item().id } diff --git a/src/librustdoc/fold.rs b/src/librustdoc/fold.rs index e9b25b07de15b..b9e598dc19d66 100644 --- a/src/librustdoc/fold.rs +++ b/src/librustdoc/fold.rs @@ -35,7 +35,7 @@ pub struct Fold { fold_struct: FoldStruct } -impl Fold: Clone { +impl Clone for Fold { fn clone(&self) -> Fold { Fold { ctxt: self.ctxt.clone(), diff --git a/src/librustdoc/markdown_writer.rs b/src/librustdoc/markdown_writer.rs index 7577785d95422..f0d9effe6fc51 100644 --- a/src/librustdoc/markdown_writer.rs +++ b/src/librustdoc/markdown_writer.rs @@ -43,7 +43,7 @@ pub trait WriterUtils { fn write_done(&self); } -impl Writer: WriterUtils { +impl WriterUtils for Writer { fn write_str(&self, str: ~str) { (*self)(Write(str)); } diff --git a/src/librustdoc/path_pass.rs b/src/librustdoc/path_pass.rs index 165ab989a2f06..7dc8d0202cbf1 100644 --- a/src/librustdoc/path_pass.rs +++ b/src/librustdoc/path_pass.rs @@ -34,7 +34,7 @@ struct Ctxt { mut path: ~[~str] } -impl Ctxt: Clone { +impl Clone for Ctxt { fn clone(&self) -> Ctxt { Ctxt { srv: self.srv.clone(), diff --git a/src/librustdoc/util.rs b/src/librustdoc/util.rs index aa15c104540f6..3ec9d17c854be 100644 --- a/src/librustdoc/util.rs +++ b/src/librustdoc/util.rs @@ -17,6 +17,6 @@ pub struct NominalOp { op: T } -impl NominalOp: Clone { +impl Clone for NominalOp { fn clone(&self) -> NominalOp { copy *self } } diff --git a/src/libstd/arc.rs b/src/libstd/arc.rs index 0a51a7ef19145..59e278f17960f 100644 --- a/src/libstd/arc.rs +++ b/src/libstd/arc.rs @@ -117,7 +117,7 @@ pub fn unwrap(rc: ARC) -> T { unsafe { unwrap_shared_mutable_state(move x) } } -impl ARC: Clone { +impl Clone for ARC { fn clone(&self) -> ARC { clone(self) } @@ -148,7 +148,7 @@ pub fn mutex_arc_with_condvars(user_data: T, MutexARC { x: unsafe { shared_mutable_state(move data) } } } -impl MutexARC: Clone { +impl Clone for MutexARC { /// Duplicate a mutex-protected ARC, as arc::clone. fn clone(&self) -> MutexARC { // NB: Cloning the underlying mutex is not necessary. Its reference @@ -247,7 +247,7 @@ struct PoisonOnFail { failed: *mut bool, } -impl PoisonOnFail : Drop { +impl Drop for PoisonOnFail { fn finalize(&self) { unsafe { /* assert !*self.failed; diff --git a/src/libstd/arena.rs b/src/libstd/arena.rs index 9beb8e276ef98..177932aa072a1 100644 --- a/src/libstd/arena.rs +++ b/src/libstd/arena.rs @@ -81,7 +81,7 @@ pub struct Arena { priv mut chunks: @List, } -impl Arena : Drop { +impl Drop for Arena { fn finalize(&self) { unsafe { destroy_chunk(&self.head); diff --git a/src/libstd/base64.rs b/src/libstd/base64.rs index 10ea113f74e52..5065e15bb5e30 100644 --- a/src/libstd/base64.rs +++ b/src/libstd/base64.rs @@ -17,7 +17,7 @@ pub trait ToBase64 { pure fn to_base64() -> ~str; } -impl &[u8]: ToBase64 { +impl ToBase64 for &[u8] { pure fn to_base64() -> ~str { let chars = str::chars( ~"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" @@ -70,7 +70,7 @@ impl &[u8]: ToBase64 { } } -impl &str: ToBase64 { +impl ToBase64 for &str { pure fn to_base64() -> ~str { str::to_bytes(self).to_base64() } @@ -80,7 +80,7 @@ pub trait FromBase64 { pure fn from_base64() -> ~[u8]; } -impl ~[u8]: FromBase64 { +impl FromBase64 for ~[u8] { pure fn from_base64() -> ~[u8] { if self.len() % 4u != 0u { fail!(~"invalid base64 length"); } @@ -142,7 +142,7 @@ impl ~[u8]: FromBase64 { } } -impl ~str: FromBase64 { +impl FromBase64 for ~str { pure fn from_base64() -> ~[u8] { str::to_bytes(self).from_base64() } diff --git a/src/libstd/bigint.rs b/src/libstd/bigint.rs index 2c713e58e9a86..ab622438511bb 100644 --- a/src/libstd/bigint.rs +++ b/src/libstd/bigint.rs @@ -75,29 +75,29 @@ pub struct BigUint { priv data: ~[BigDigit] } -impl BigUint : Eq { +impl Eq for BigUint { pure fn eq(&self, other: &BigUint) -> bool { self.cmp(other) == 0 } pure fn ne(&self, other: &BigUint) -> bool { self.cmp(other) != 0 } } -impl BigUint : Ord { +impl Ord for BigUint { pure fn lt(&self, other: &BigUint) -> bool { self.cmp(other) < 0 } pure fn le(&self, other: &BigUint) -> bool { self.cmp(other) <= 0 } pure fn ge(&self, other: &BigUint) -> bool { self.cmp(other) >= 0 } pure fn gt(&self, other: &BigUint) -> bool { self.cmp(other) > 0 } } -impl BigUint : ToStr { +impl ToStr for BigUint { pure fn to_str(&self) -> ~str { self.to_str_radix(10) } } -impl BigUint : from_str::FromStr { +impl from_str::FromStr for BigUint { static pure fn from_str(s: &str) -> Option { BigUint::from_str_radix(s, 10) } } -impl BigUint : Shl { +impl Shl for BigUint { pure fn shl(&self, rhs: &uint) -> BigUint { let n_unit = *rhs / BigDigit::bits; let n_bits = *rhs % BigDigit::bits; @@ -105,7 +105,7 @@ impl BigUint : Shl { } } -impl BigUint : Shr { +impl Shr for BigUint { pure fn shr(&self, rhs: &uint) -> BigUint { let n_unit = *rhs / BigDigit::bits; let n_bits = *rhs % BigDigit::bits; @@ -113,15 +113,15 @@ impl BigUint : Shr { } } -impl BigUint : Zero { +impl Zero for BigUint { static pure fn zero() -> BigUint { BigUint::new(~[]) } } -impl BigUint : One { +impl One for BigUint { static pub pure fn one() -> BigUint { BigUint::new(~[1]) } } -impl BigUint : Add { +impl Add for BigUint { pure fn add(&self, other: &BigUint) -> BigUint { let new_len = uint::max(self.data.len(), other.data.len()); @@ -140,7 +140,7 @@ impl BigUint : Add { } } -impl BigUint : Sub { +impl Sub for BigUint { pure fn sub(&self, other: &BigUint) -> BigUint { let new_len = uint::max(self.data.len(), other.data.len()); @@ -165,7 +165,7 @@ impl BigUint : Sub { } } -impl BigUint : Mul { +impl Mul for BigUint { pure fn mul(&self, other: &BigUint) -> BigUint { if self.is_zero() || other.is_zero() { return Zero::zero(); } @@ -230,25 +230,25 @@ impl BigUint : Mul { } } -impl BigUint : Div { +impl Div for BigUint { pure fn div(&self, other: &BigUint) -> BigUint { let (d, _) = self.divmod(other); return d; } } -impl BigUint : Modulo { +impl Modulo for BigUint { pure fn modulo(&self, other: &BigUint) -> BigUint { let (_, m) = self.divmod(other); return m; } } -impl BigUint : Neg { +impl Neg for BigUint { pure fn neg(&self) -> BigUint { fail!() } } -impl BigUint : IntConvertible { +impl IntConvertible for BigUint { pure fn to_int(&self) -> int { uint::min(self.to_uint(), int::max_value as uint) as int } @@ -554,12 +554,12 @@ priv pure fn get_radix_base(radix: uint) -> (uint, uint) { /// A Sign is a BigInt's composing element. pub enum Sign { Minus, Zero, Plus } -impl Sign : Eq { +impl Eq for Sign { pure fn eq(&self, other: &Sign) -> bool { self.cmp(other) == 0 } pure fn ne(&self, other: &Sign) -> bool { self.cmp(other) != 0 } } -impl Sign : Ord { +impl Ord for Sign { pure fn lt(&self, other: &Sign) -> bool { self.cmp(other) < 0 } pure fn le(&self, other: &Sign) -> bool { self.cmp(other) <= 0 } pure fn ge(&self, other: &Sign) -> bool { self.cmp(other) >= 0 } @@ -592,53 +592,53 @@ pub struct BigInt { priv data: BigUint } -impl BigInt : Eq { +impl Eq for BigInt { pure fn eq(&self, other: &BigInt) -> bool { self.cmp(other) == 0 } pure fn ne(&self, other: &BigInt) -> bool { self.cmp(other) != 0 } } -impl BigInt : Ord { +impl Ord for BigInt { pure fn lt(&self, other: &BigInt) -> bool { self.cmp(other) < 0 } pure fn le(&self, other: &BigInt) -> bool { self.cmp(other) <= 0 } pure fn ge(&self, other: &BigInt) -> bool { self.cmp(other) >= 0 } pure fn gt(&self, other: &BigInt) -> bool { self.cmp(other) > 0 } } -impl BigInt : ToStr { +impl ToStr for BigInt { pure fn to_str(&self) -> ~str { self.to_str_radix(10) } } -impl BigInt : from_str::FromStr { +impl from_str::FromStr for BigInt { static pure fn from_str(s: &str) -> Option { BigInt::from_str_radix(s, 10) } } -impl BigInt : Shl { +impl Shl for BigInt { pure fn shl(&self, rhs: &uint) -> BigInt { BigInt::from_biguint(self.sign, self.data << *rhs) } } -impl BigInt : Shr { +impl Shr for BigInt { pure fn shr(&self, rhs: &uint) -> BigInt { BigInt::from_biguint(self.sign, self.data >> *rhs) } } -impl BigInt : Zero { +impl Zero for BigInt { static pub pure fn zero() -> BigInt { BigInt::from_biguint(Zero, Zero::zero()) } } -impl BigInt : One { +impl One for BigInt { static pub pure fn one() -> BigInt { BigInt::from_biguint(Plus, One::one()) } } -impl BigInt : Add { +impl Add for BigInt { pure fn add(&self, other: &BigInt) -> BigInt { match (self.sign, other.sign) { (Zero, _) => copy *other, @@ -652,7 +652,7 @@ impl BigInt : Add { } } -impl BigInt : Sub { +impl Sub for BigInt { pure fn sub(&self, other: &BigInt) -> BigInt { match (self.sign, other.sign) { (Zero, _) => -other, @@ -672,7 +672,7 @@ impl BigInt : Sub { } } -impl BigInt : Mul { +impl Mul for BigInt { pure fn mul(&self, other: &BigInt) -> BigInt { match (self.sign, other.sign) { (Zero, _) | (_, Zero) => Zero::zero(), @@ -686,27 +686,27 @@ impl BigInt : Mul { } } -impl BigInt : Div { +impl Div for BigInt { pure fn div(&self, other: &BigInt) -> BigInt { let (d, _) = self.divmod(other); return d; } } -impl BigInt : Modulo { +impl Modulo for BigInt { pure fn modulo(&self, other: &BigInt) -> BigInt { let (_, m) = self.divmod(other); return m; } } -impl BigInt : Neg { +impl Neg for BigInt { pure fn neg(&self) -> BigInt { BigInt::from_biguint(self.sign.neg(), copy self.data) } } -impl BigInt : IntConvertible { +impl IntConvertible for BigInt { pure fn to_int(&self) -> int { match self.sign { Plus => uint::min(self.to_uint(), int::max_value as uint) as int, diff --git a/src/libstd/bitv.rs b/src/libstd/bitv.rs index d62fb2e8f6ec3..e6557d163f9db 100644 --- a/src/libstd/bitv.rs +++ b/src/libstd/bitv.rs @@ -507,7 +507,7 @@ impl Bitv { } -impl Bitv: Clone { +impl Clone for Bitv { /// Makes a copy of a bitvector #[inline(always)] fn clone(&self) -> Bitv { @@ -568,7 +568,7 @@ pure fn difference(w0: uint, w1: uint) -> uint { return w0 & !w1; } pure fn right(_w0: uint, w1: uint) -> uint { return w1; } -impl Bitv: ops::Index { +impl ops::Index for Bitv { pure fn index(&self, i: uint) -> bool { self.get(i) } diff --git a/src/libstd/c_vec.rs b/src/libstd/c_vec.rs index 5ea5418d9882e..696b2753ea44b 100644 --- a/src/libstd/c_vec.rs +++ b/src/libstd/c_vec.rs @@ -56,7 +56,7 @@ struct DtorRes { dtor: Option, } -impl DtorRes : Drop { +impl Drop for DtorRes { fn finalize(&self) { match self.dtor { option::None => (), diff --git a/src/libstd/cmp.rs b/src/libstd/cmp.rs index 991953cccb7fa..a73b5f2a706d0 100644 --- a/src/libstd/cmp.rs +++ b/src/libstd/cmp.rs @@ -21,7 +21,7 @@ pub trait FuzzyEq { pure fn fuzzy_eq_eps(&self, other: &Self, epsilon: &Eps) -> bool; } -impl float: FuzzyEq { +impl FuzzyEq for float { pure fn fuzzy_eq(&self, other: &float) -> bool { self.fuzzy_eq_eps(other, &FUZZY_EPSILON) } @@ -31,7 +31,7 @@ impl float: FuzzyEq { } } -impl f32: FuzzyEq { +impl FuzzyEq for f32 { pure fn fuzzy_eq(&self, other: &f32) -> bool { self.fuzzy_eq_eps(other, &(FUZZY_EPSILON as f32)) } @@ -41,7 +41,7 @@ impl f32: FuzzyEq { } } -impl f64: FuzzyEq { +impl FuzzyEq for f64 { pure fn fuzzy_eq(&self, other: &f64) -> bool { self.fuzzy_eq_eps(other, &(FUZZY_EPSILON as f64)) } @@ -70,7 +70,7 @@ mod test_complex{ struct Complex { r: float, i: float } - impl Complex: FuzzyEq { + impl FuzzyEq for Complex { pure fn fuzzy_eq(&self, other: &Complex) -> bool { self.fuzzy_eq_eps(other, &FUZZY_EPSILON) } diff --git a/src/libstd/comm.rs b/src/libstd/comm.rs index 71eb29e26eba7..47f3c70352c3b 100644 --- a/src/libstd/comm.rs +++ b/src/libstd/comm.rs @@ -25,19 +25,19 @@ pub struct DuplexStream { priv port: Port, } -impl DuplexStream : GenericChan { +impl GenericChan for DuplexStream { fn send(x: T) { self.chan.send(move x) } } -impl DuplexStream : GenericSmartChan { +impl GenericSmartChan for DuplexStream { fn try_send(x: T) -> bool { self.chan.try_send(move x) } } -impl DuplexStream : GenericPort { +impl GenericPort for DuplexStream { fn recv() -> U { self.port.recv() } @@ -47,13 +47,13 @@ impl DuplexStream : GenericPort { } } -impl DuplexStream : Peekable { +impl Peekable for DuplexStream { pure fn peek() -> bool { self.port.peek() } } -impl DuplexStream : Selectable { +impl Selectable for DuplexStream { pure fn header() -> *pipes::PacketHeader { self.port.header() } diff --git a/src/libstd/deque.rs b/src/libstd/deque.rs index 7d819ba0b3f22..772cacf47a11b 100644 --- a/src/libstd/deque.rs +++ b/src/libstd/deque.rs @@ -67,7 +67,7 @@ pub fn create() -> Deque { elts: DVec>, } - impl Repr: Deque { + impl Deque for Repr { fn size() -> uint { return self.nelts; } fn add_front(t: T) { let oldlo: uint = self.lo; diff --git a/src/libstd/ebml.rs b/src/libstd/ebml.rs index c332c7656b4c4..f691dfe6a6273 100644 --- a/src/libstd/ebml.rs +++ b/src/libstd/ebml.rs @@ -74,7 +74,7 @@ pub mod reader { // ebml reading - impl Doc: ops::Index { + impl ops::Index for Doc { pure fn index(&self, tag: uint) -> Doc { unsafe { get_doc(*self, tag) @@ -285,7 +285,7 @@ pub mod reader { } } - impl Decoder: serialize::Decoder { + impl serialize::Decoder for Decoder { fn read_nil(&self) -> () { () } fn read_u64(&self) -> u64 { doc_as_u64(self.next_doc(EsU64)) } @@ -577,7 +577,7 @@ pub mod writer { } } - impl Encoder: ::serialize::Encoder { + impl ::serialize::Encoder for Encoder { fn emit_nil(&self) {} fn emit_uint(&self, v: uint) { diff --git a/src/libstd/flatpipes.rs b/src/libstd/flatpipes.rs index a7507a971c85f..dad761ac20d7c 100644 --- a/src/libstd/flatpipes.rs +++ b/src/libstd/flatpipes.rs @@ -303,7 +303,7 @@ pub impl,P:BytePort> FlatPort: GenericPort { } } -impl,C:ByteChan> FlatChan: GenericChan { +impl,C:ByteChan> GenericChan for FlatChan { fn send(val: T) { self.byte_chan.send(CONTINUE.to_vec()); let bytes = self.flattener.flatten(move val); @@ -474,7 +474,7 @@ pub mod flatteners { static fn from_writer(w: Writer) -> Self; } - impl json::Decoder: FromReader { + impl FromReader for json::Decoder { static fn from_reader(r: Reader) -> json::Decoder { match json::from_reader(r) { Ok(move json) => { @@ -485,13 +485,13 @@ pub mod flatteners { } } - impl json::Encoder: FromWriter { + impl FromWriter for json::Encoder { static fn from_writer(w: Writer) -> json::Encoder { json::Encoder(move w) } } - impl ebml::reader::Decoder: FromReader { + impl FromReader for ebml::reader::Decoder { static fn from_reader(r: Reader) -> ebml::reader::Decoder { let buf = @r.read_whole_stream(); let doc = ebml::reader::Doc(buf); @@ -499,7 +499,7 @@ pub mod flatteners { } } - impl ebml::writer::Encoder: FromWriter { + impl FromWriter for ebml::writer::Encoder { static fn from_writer(w: Writer) -> ebml::writer::Encoder { ebml::writer::Encoder(move w) } diff --git a/src/libstd/future.rs b/src/libstd/future.rs index ec71c30242cf2..8659e3cbb102c 100644 --- a/src/libstd/future.rs +++ b/src/libstd/future.rs @@ -36,7 +36,7 @@ pub struct Future { // FIXME(#2829) -- futures should not be copyable, because they close // over fn~'s that have pipes and so forth within! -impl Future : Drop { +impl Drop for Future { fn finalize(&self) {} } diff --git a/src/libstd/io_util.rs b/src/libstd/io_util.rs index 9a90b811e44c5..3cc28563e12eb 100644 --- a/src/libstd/io_util.rs +++ b/src/libstd/io_util.rs @@ -42,7 +42,7 @@ pub impl BufReader { } } -impl BufReader: Reader { +impl Reader for BufReader { fn read(&self, bytes: &mut [u8], len: uint) -> uint { self.as_bytes_reader(|r| r.read(bytes, len) ) } diff --git a/src/libstd/json.rs b/src/libstd/json.rs index 95f9130fa372f..fcdd2de5743a3 100644 --- a/src/libstd/json.rs +++ b/src/libstd/json.rs @@ -949,7 +949,7 @@ pub impl Decoder: serialize::Decoder { } } -impl Json : Eq { +impl Eq for Json { pure fn eq(&self, other: &Json) -> bool { match (self) { &Number(f0) => @@ -987,7 +987,7 @@ impl Json : Eq { } /// Test if two json values are less than one another -impl Json : Ord { +impl Ord for Json { pure fn lt(&self, other: &Json) -> bool { match (*self) { Number(f0) => { @@ -1063,7 +1063,7 @@ impl Json : Ord { pure fn gt(&self, other: &Json) -> bool { (*other).lt(&(*self)) } } -impl Error : Eq { +impl Eq for Error { pure fn eq(&self, other: &Error) -> bool { (*self).line == other.line && (*self).col == other.col && @@ -1074,83 +1074,83 @@ impl Error : Eq { trait ToJson { fn to_json() -> Json; } -impl Json: ToJson { +impl ToJson for Json { fn to_json() -> Json { copy self } } -impl @Json: ToJson { +impl ToJson for @Json { fn to_json() -> Json { (*self).to_json() } } -impl int: ToJson { +impl ToJson for int { fn to_json() -> Json { Number(self as float) } } -impl i8: ToJson { +impl ToJson for i8 { fn to_json() -> Json { Number(self as float) } } -impl i16: ToJson { +impl ToJson for i16 { fn to_json() -> Json { Number(self as float) } } -impl i32: ToJson { +impl ToJson for i32 { fn to_json() -> Json { Number(self as float) } } -impl i64: ToJson { +impl ToJson for i64 { fn to_json() -> Json { Number(self as float) } } -impl uint: ToJson { +impl ToJson for uint { fn to_json() -> Json { Number(self as float) } } -impl u8: ToJson { +impl ToJson for u8 { fn to_json() -> Json { Number(self as float) } } -impl u16: ToJson { +impl ToJson for u16 { fn to_json() -> Json { Number(self as float) } } -impl u32: ToJson { +impl ToJson for u32 { fn to_json() -> Json { Number(self as float) } } -impl u64: ToJson { +impl ToJson for u64 { fn to_json() -> Json { Number(self as float) } } -impl float: ToJson { +impl ToJson for float { fn to_json() -> Json { Number(self) } } -impl f32: ToJson { +impl ToJson for f32 { fn to_json() -> Json { Number(self as float) } } -impl f64: ToJson { +impl ToJson for f64 { fn to_json() -> Json { Number(self as float) } } -impl (): ToJson { +impl ToJson for () { fn to_json() -> Json { Null } } -impl bool: ToJson { +impl ToJson for bool { fn to_json() -> Json { Boolean(self) } } -impl ~str: ToJson { +impl ToJson for ~str { fn to_json() -> Json { String(copy self) } } -impl @~str: ToJson { +impl ToJson for @~str { fn to_json() -> Json { String(copy *self) } } -impl (A, B): ToJson { +impl ToJson for (A, B) { fn to_json() -> Json { match self { (ref a, ref b) => { @@ -1160,7 +1160,7 @@ impl (A, B): ToJson { } } -impl (A, B, C): ToJson { +impl ToJson for (A, B, C) { fn to_json() -> Json { match self { (ref a, ref b, ref c) => { @@ -1170,11 +1170,11 @@ impl (A, B, C): ToJson { } } -impl ~[A]: ToJson { +impl ToJson for ~[A] { fn to_json() -> Json { List(self.map(|elt| elt.to_json())) } } -impl LinearMap<~str, A>: ToJson { +impl ToJson for LinearMap<~str, A> { fn to_json() -> Json { let mut d = LinearMap::new(); for self.each |&(key, value)| { @@ -1184,7 +1184,7 @@ impl LinearMap<~str, A>: ToJson { } } -impl Option: ToJson { +impl ToJson for Option { fn to_json() -> Json { match self { None => Null, @@ -1193,11 +1193,11 @@ impl Option: ToJson { } } -impl Json: to_str::ToStr { +impl to_str::ToStr for Json { pure fn to_str(&self) -> ~str { to_str(self) } } -impl Error: to_str::ToStr { +impl to_str::ToStr for Error { pure fn to_str(&self) -> ~str { fmt!("%u:%u: %s", self.line, self.col, *self.msg) } diff --git a/src/libstd/net_ip.rs b/src/libstd/net_ip.rs index 2f423f4c8d426..88bacf53e636b 100644 --- a/src/libstd/net_ip.rs +++ b/src/libstd/net_ip.rs @@ -193,7 +193,7 @@ pub mod v4 { unsafe fn as_u32() -> u32; } - impl Ipv4Rep: AsUnsafeU32 { + impl AsUnsafeU32 for Ipv4Rep { // this is pretty dastardly, i know unsafe fn as_u32() -> u32 { *((ptr::addr_of(&self)) as *u32) diff --git a/src/libstd/net_tcp.rs b/src/libstd/net_tcp.rs index 8addea9c30bb1..4e0b5494883b0 100644 --- a/src/libstd/net_tcp.rs +++ b/src/libstd/net_tcp.rs @@ -51,7 +51,7 @@ pub struct TcpSocket { socket_data: @TcpSocketData, } -impl TcpSocket : Drop { +impl Drop for TcpSocket { fn finalize(&self) { unsafe { tear_down_socket_data(self.socket_data) @@ -863,7 +863,7 @@ impl TcpSocket { } /// Implementation of `io::reader` trait for a buffered `net::tcp::tcp_socket` -impl TcpSocketBuf: io::Reader { +impl io::Reader for TcpSocketBuf { fn read(&self, buf: &mut [u8], len: uint) -> uint { if len == 0 { return 0 } let mut count: uint = 0; @@ -963,7 +963,7 @@ impl TcpSocketBuf: io::Reader { } /// Implementation of `io::reader` trait for a buffered `net::tcp::tcp_socket` -impl TcpSocketBuf: io::Writer { +impl io::Writer for TcpSocketBuf { pub fn write(&self, data: &[const u8]) { unsafe { let socket_data_ptr = @@ -1264,7 +1264,7 @@ trait ToTcpErr { fn to_tcp_err() -> TcpErrData; } -impl uv::ll::uv_err_data: ToTcpErr { +impl ToTcpErr for uv::ll::uv_err_data { fn to_tcp_err() -> TcpErrData { TcpErrData { err_name: self.err_name, err_msg: self.err_msg } } diff --git a/src/libstd/net_url.rs b/src/libstd/net_url.rs index 1da3a64251405..7874899cb27ac 100644 --- a/src/libstd/net_url.rs +++ b/src/libstd/net_url.rs @@ -668,7 +668,7 @@ pub pure fn from_str(rawurl: &str) -> Result { Ok(Url::new(scheme, userinfo, host, port, path, query, fragment)) } -impl Url: FromStr { +impl FromStr for Url { static pure fn from_str(s: &str) -> Option { match from_str(s) { Ok(move url) => Some(url), @@ -718,13 +718,13 @@ pub pure fn to_str(url: &Url) -> ~str { fmt!("%s:%s%s%s%s", url.scheme, authority, url.path, query, fragment) } -impl Url: to_str::ToStr { +impl to_str::ToStr for Url { pub pure fn to_str(&self) -> ~str { to_str(self) } } -impl Url: to_bytes::IterBytes { +impl to_bytes::IterBytes for Url { pure fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) { self.to_str().iter_bytes(lsb0, f) } diff --git a/src/libstd/oldmap.rs b/src/libstd/oldmap.rs index 900b7068ce3d3..3ad45cf2d5b30 100644 --- a/src/libstd/oldmap.rs +++ b/src/libstd/oldmap.rs @@ -156,12 +156,12 @@ pub mod chained { } } - impl T: Container { + impl Container for T { pure fn len(&self) -> uint { self.count } pure fn is_empty(&self) -> bool { self.count == 0 } } - impl T: Mutable { + impl Mutable for T { fn clear(&mut self) { self.count = 0u; self.chains = chains(initial_capacity); @@ -347,7 +347,7 @@ pub mod chained { } } - impl T: ToStr { + impl ToStr for T { pure fn to_str(&self) -> ~str { unsafe { // Meh -- this should be safe @@ -356,7 +356,7 @@ pub mod chained { } } - impl T: ops::Index { + impl ops::Index for T { pure fn index(&self, k: K) -> V { self.get(&k) } diff --git a/src/libstd/oldsmallintmap.rs b/src/libstd/oldsmallintmap.rs index c9e739e3c8b83..5c3477660706e 100644 --- a/src/libstd/oldsmallintmap.rs +++ b/src/libstd/oldsmallintmap.rs @@ -78,7 +78,7 @@ pub pure fn contains_key(self: SmallIntMap, key: uint) -> bool { return !find(self, key).is_none(); } -impl SmallIntMap: Container { +impl Container for SmallIntMap { /// Return the number of elements in the map pure fn len(&self) -> uint { let mut sz = 0u; @@ -95,7 +95,7 @@ impl SmallIntMap: Container { pure fn is_empty(&self) -> bool { self.len() == 0 } } -impl SmallIntMap: Mutable { +impl Mutable for SmallIntMap { fn clear(&mut self) { self.v.set(~[]) } } @@ -162,7 +162,7 @@ impl SmallIntMap { } } -impl SmallIntMap: ops::Index { +impl ops::Index for SmallIntMap { pure fn index(&self, key: uint) -> V { unsafe { get(*self, key) diff --git a/src/libstd/priority_queue.rs b/src/libstd/priority_queue.rs index a64aa5e968742..a25a4196b4cab 100644 --- a/src/libstd/priority_queue.rs +++ b/src/libstd/priority_queue.rs @@ -27,7 +27,7 @@ pub struct PriorityQueue { priv data: ~[T], } -impl PriorityQueue: BaseIter { +impl BaseIter for PriorityQueue { /// Visit all values in the underlying vector. /// /// The values are **not** visited in order. @@ -35,7 +35,7 @@ impl PriorityQueue: BaseIter { pure fn size_hint(&self) -> Option { self.data.size_hint() } } -impl PriorityQueue: Container { +impl Container for PriorityQueue { /// Returns the length of the queue pure fn len(&self) -> uint { self.data.len() } @@ -43,7 +43,7 @@ impl PriorityQueue: Container { pure fn is_empty(&self) -> bool { self.data.is_empty() } } -impl PriorityQueue: Mutable { +impl Mutable for PriorityQueue { /// Drop all items from the queue fn clear(&mut self) { self.data.truncate(0) } } diff --git a/src/libstd/sha1.rs b/src/libstd/sha1.rs index e89f37878300c..1d91fafa4f962 100644 --- a/src/libstd/sha1.rs +++ b/src/libstd/sha1.rs @@ -228,7 +228,7 @@ pub fn sha1() -> Sha1 { process_msg_block(st); } - impl Sha1State: Sha1 { + impl Sha1 for Sha1State { fn reset(&mut self) { assert (vec::len(self.h) == digest_buf_len); self.len_low = 0u32; diff --git a/src/libstd/smallintmap.rs b/src/libstd/smallintmap.rs index 2e5cd8956cd9d..382cd658663dc 100644 --- a/src/libstd/smallintmap.rs +++ b/src/libstd/smallintmap.rs @@ -22,7 +22,7 @@ pub struct SmallIntMap { priv v: ~[Option], } -impl SmallIntMap: BaseIter<(uint, &V)> { +impl BaseIter<(uint, &V)> for SmallIntMap { /// Visit all key-value pairs in order pure fn each(&self, it: fn(&(uint, &self/V)) -> bool) { for uint::range(0, self.v.len()) |i| { @@ -36,7 +36,7 @@ impl SmallIntMap: BaseIter<(uint, &V)> { pure fn size_hint(&self) -> Option { Some(self.len()) } } -impl SmallIntMap: ReverseIter<(uint, &V)> { +impl ReverseIter<(uint, &V)> for SmallIntMap { /// Visit all key-value pairs in reverse order pure fn each_reverse(&self, it: fn(&(uint, &self/V)) -> bool) { for uint::range_rev(self.v.len(), 0) |i| { @@ -48,7 +48,7 @@ impl SmallIntMap: ReverseIter<(uint, &V)> { } } -impl SmallIntMap: Container { +impl Container for SmallIntMap { /// Return the number of elements in the map pure fn len(&self) -> uint { let mut sz = 0; @@ -64,12 +64,12 @@ impl SmallIntMap: Container { pure fn is_empty(&self) -> bool { self.len() == 0 } } -impl SmallIntMap: Mutable { +impl Mutable for SmallIntMap { /// Clear the map, removing all key-value pairs. fn clear(&mut self) { self.v.clear() } } -impl SmallIntMap: Map { +impl Map for SmallIntMap { /// Return true if the map contains a value for the specified key pure fn contains_key(&self, key: &uint) -> bool { self.find(key).is_some() diff --git a/src/libstd/sort.rs b/src/libstd/sort.rs index f8acbe8418086..98a451dc8abdd 100644 --- a/src/libstd/sort.rs +++ b/src/libstd/sort.rs @@ -169,7 +169,7 @@ pub trait Sort { fn qsort(self); } -impl &mut [T] : Sort { +impl Sort for &mut [T] { fn qsort(self) { quick_sort3(self); } } @@ -908,7 +908,7 @@ mod test_tim_sort { val: float, } - impl CVal: Ord { + impl Ord for CVal { pure fn lt(&self, other: &CVal) -> bool { unsafe { let rng = rand::Rng(); @@ -973,7 +973,7 @@ mod test_tim_sort { struct DVal { val: uint } - impl DVal: Ord { + impl Ord for DVal { pure fn lt(&self, _x: &DVal) -> bool { true } pure fn le(&self, _x: &DVal) -> bool { true } pure fn gt(&self, _x: &DVal) -> bool { true } @@ -1182,7 +1182,7 @@ mod big_tests { } - impl LVal : Drop { + impl Drop for LVal { fn finalize(&self) { let x = unsafe { task::local_data::local_data_get(self.key) }; match x { @@ -1196,7 +1196,7 @@ mod big_tests { } } - impl LVal: Ord { + impl Ord for LVal { pure fn lt(&self, other: &a/LVal/&self) -> bool { (*self).val < other.val } diff --git a/src/libstd/stats.rs b/src/libstd/stats.rs index 2048cb6c59f0d..fb6f80a650084 100644 --- a/src/libstd/stats.rs +++ b/src/libstd/stats.rs @@ -30,7 +30,7 @@ pub trait Stats { fn median_abs_dev_pct(self) -> f64; } -impl &[f64] : Stats { +impl Stats for &[f64] { fn sum(self) -> f64 { vec::foldl(0.0, self, |p,q| p + *q) } diff --git a/src/libstd/sync.rs b/src/libstd/sync.rs index 8a5741201c009..af773f5bf4e50 100644 --- a/src/libstd/sync.rs +++ b/src/libstd/sync.rs @@ -167,7 +167,7 @@ type SemRelease = SemReleaseGeneric<()>; type SemAndSignalRelease = SemReleaseGeneric<~[Waitqueue]>; struct SemReleaseGeneric { sem: &Sem } -impl SemReleaseGeneric : Drop { +impl Drop for SemReleaseGeneric { fn finalize(&self) { self.sem.release(); } @@ -189,7 +189,7 @@ fn SemAndSignalRelease(sem: &r/Sem<~[Waitqueue]>) /// A mechanism for atomic-unlock-and-deschedule blocking and signalling. pub struct Condvar { priv sem: &Sem<~[Waitqueue]> } -impl Condvar : Drop { fn finalize(&self) {} } +impl Drop for Condvar { fn finalize(&self) {} } impl &Condvar { /** @@ -260,7 +260,7 @@ impl &Condvar { sem: &Sem<~[Waitqueue]>, } - impl SemAndSignalReacquire : Drop { + impl Drop for SemAndSignalReacquire { fn finalize(&self) { unsafe { // Needs to succeed, instead of itself dying. @@ -362,7 +362,7 @@ pub fn semaphore(count: int) -> Semaphore { Semaphore { sem: new_sem(count, ()) } } -impl Semaphore: Clone { +impl Clone for Semaphore { /// Create a new handle to the semaphore. fn clone(&self) -> Semaphore { Semaphore { sem: Sem((*self.sem).clone()) } @@ -412,7 +412,7 @@ pub fn mutex_with_condvars(num_condvars: uint) -> Mutex { Mutex { sem: new_sem_and_signal(1, num_condvars) } } -impl Mutex: Clone { +impl Clone for Mutex { /// Create a new handle to the mutex. fn clone(&self) -> Mutex { Mutex { sem: Sem((*self.sem).clone()) } } } @@ -610,7 +610,7 @@ struct RWlockReleaseRead { lock: &RWlock, } -impl RWlockReleaseRead : Drop { +impl Drop for RWlockReleaseRead { fn finalize(&self) { unsafe { do task::unkillable { @@ -644,7 +644,7 @@ struct RWlockReleaseDowngrade { lock: &RWlock, } -impl RWlockReleaseDowngrade : Drop { +impl Drop for RWlockReleaseDowngrade { fn finalize(&self) { unsafe { do task::unkillable { @@ -682,10 +682,10 @@ fn RWlockReleaseDowngrade(lock: &r/RWlock) -> RWlockReleaseDowngrade/&r { /// The "write permission" token used for rwlock.write_downgrade(). pub struct RWlockWriteMode { priv lock: &RWlock } -impl RWlockWriteMode : Drop { fn finalize(&self) {} } +impl Drop for RWlockWriteMode { fn finalize(&self) {} } /// The "read permission" token used for rwlock.write_downgrade(). pub struct RWlockReadMode { priv lock: &RWlock } -impl RWlockReadMode : Drop { fn finalize(&self) {} } +impl Drop for RWlockReadMode { fn finalize(&self) {} } impl &RWlockWriteMode { /// Access the pre-downgrade rwlock in write mode. @@ -1007,7 +1007,7 @@ mod tests { c: pipes::Chan<()>, } - impl SendOnFailure : Drop { + impl Drop for SendOnFailure { fn finalize(&self) { self.c.send(()); } diff --git a/src/libstd/time.rs b/src/libstd/time.rs index 622e1ea65d8b5..77e7e3c3054d8 100644 --- a/src/libstd/time.rs +++ b/src/libstd/time.rs @@ -54,14 +54,14 @@ impl Timespec { } } -impl Timespec : Eq { +impl Eq for Timespec { pure fn eq(&self, other: &Timespec) -> bool { self.sec == other.sec && self.nsec == other.nsec } pure fn ne(&self, other: &Timespec) -> bool { !self.eq(other) } } -impl Timespec : Ord { +impl Ord for Timespec { pure fn lt(&self, other: &Timespec) -> bool { self.sec < other.sec || (self.sec == other.sec && self.nsec < other.nsec) @@ -129,7 +129,7 @@ pub struct Tm { tm_nsec: i32, // nanoseconds } -impl Tm : Eq { +impl Eq for Tm { pure fn eq(&self, other: &Tm) -> bool { self.tm_sec == (*other).tm_sec && self.tm_min == (*other).tm_min && diff --git a/src/libstd/treemap.rs b/src/libstd/treemap.rs index 2fdaeb545a286..282ecf086e4e8 100644 --- a/src/libstd/treemap.rs +++ b/src/libstd/treemap.rs @@ -39,7 +39,7 @@ pub struct TreeMap { priv length: uint } -impl TreeMap: Eq { +impl Eq for TreeMap { pure fn eq(&self, other: &TreeMap) -> bool { if self.len() != other.len() { false @@ -85,7 +85,7 @@ pure fn lt(a: &TreeMap, b: &TreeMap) -> bool { return a_len < b_len; } -impl TreeMap: Ord { +impl Ord for TreeMap { #[inline(always)] pure fn lt(&self, other: &TreeMap) -> bool { lt(self, other) @@ -104,7 +104,7 @@ impl TreeMap: Ord { } } -impl TreeMap: BaseIter<(&K, &V)> { +impl BaseIter<(&K, &V)> for TreeMap { /// Visit all key-value pairs in order pure fn each(&self, f: fn(&(&self/K, &self/V)) -> bool) { each(&self.root, f) @@ -112,14 +112,14 @@ impl TreeMap: BaseIter<(&K, &V)> { pure fn size_hint(&self) -> Option { Some(self.len()) } } -impl TreeMap: ReverseIter<(&K, &V)> { +impl ReverseIter<(&K, &V)> for TreeMap { /// Visit all key-value pairs in reverse order pure fn each_reverse(&self, f: fn(&(&self/K, &self/V)) -> bool) { each_reverse(&self.root, f); } } -impl TreeMap: Container { +impl Container for TreeMap { /// Return the number of elements in the map pure fn len(&self) -> uint { self.length } @@ -127,7 +127,7 @@ impl TreeMap: Container { pure fn is_empty(&self) -> bool { self.root.is_none() } } -impl TreeMap: Mutable { +impl Mutable for TreeMap { /// Clear the map, removing all key-value pairs. fn clear(&mut self) { self.root = None; @@ -135,7 +135,7 @@ impl TreeMap: Mutable { } } -impl TreeMap: Map { +impl Map for TreeMap { /// Return true if the map contains a value for the specified key pure fn contains_key(&self, key: &K) -> bool { self.find(key).is_some() @@ -246,25 +246,25 @@ pub struct TreeSet { priv map: TreeMap } -impl TreeSet: BaseIter { +impl BaseIter for TreeSet { /// Visit all values in order pure fn each(&self, f: fn(&T) -> bool) { self.map.each_key(f) } pure fn size_hint(&self) -> Option { Some(self.len()) } } -impl TreeSet: ReverseIter { +impl ReverseIter for TreeSet { /// Visit all values in reverse order pure fn each_reverse(&self, f: fn(&T) -> bool) { self.map.each_key_reverse(f) } } -impl TreeSet: Eq { +impl Eq for TreeSet { pure fn eq(&self, other: &TreeSet) -> bool { self.map == other.map } pure fn ne(&self, other: &TreeSet) -> bool { self.map != other.map } } -impl TreeSet: Ord { +impl Ord for TreeSet { #[inline(always)] pure fn lt(&self, other: &TreeSet) -> bool { self.map < other.map } #[inline(always)] @@ -275,7 +275,7 @@ impl TreeSet: Ord { pure fn gt(&self, other: &TreeSet) -> bool { self.map > other.map } } -impl TreeSet: Container { +impl Container for TreeSet { /// Return the number of elements in the set pure fn len(&self) -> uint { self.map.len() } @@ -283,12 +283,12 @@ impl TreeSet: Container { pure fn is_empty(&self) -> bool { self.map.is_empty() } } -impl TreeSet: Mutable { +impl Mutable for TreeSet { /// Clear the set, removing all values. fn clear(&mut self) { self.map.clear() } } -impl TreeSet: Set { +impl Set for TreeSet { /// Return true if the set contains a value pure fn contains(&self, value: &T) -> bool { self.map.contains_key(value) diff --git a/src/libstd/uv_global_loop.rs b/src/libstd/uv_global_loop.rs index 6621eef8b0b42..3152f0b540524 100644 --- a/src/libstd/uv_global_loop.rs +++ b/src/libstd/uv_global_loop.rs @@ -51,7 +51,7 @@ fn get_monitor_task_gl() -> IoTask { struct GlobalIoTask(IoTask); - impl GlobalIoTask: Clone { + impl Clone for GlobalIoTask { fn clone(&self) -> GlobalIoTask { GlobalIoTask((**self).clone()) } diff --git a/src/libstd/uv_iotask.rs b/src/libstd/uv_iotask.rs index ccb3175eef499..a93bdf86a6428 100644 --- a/src/libstd/uv_iotask.rs +++ b/src/libstd/uv_iotask.rs @@ -31,7 +31,7 @@ pub struct IoTask { op_chan: SharedChan } -impl IoTask: Clone { +impl Clone for IoTask { fn clone(&self) -> IoTask { IoTask{ async_handle: self.async_handle, diff --git a/src/libstd/workcache.rs b/src/libstd/workcache.rs index d78761b70e3ef..d652b18cfad47 100644 --- a/src/libstd/workcache.rs +++ b/src/libstd/workcache.rs @@ -104,7 +104,7 @@ struct WorkKey { name: ~str } -impl WorkKey: to_bytes::IterBytes { +impl to_bytes::IterBytes for WorkKey { #[inline(always)] pure fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) { let mut flag = true; @@ -114,7 +114,7 @@ impl WorkKey: to_bytes::IterBytes { } } -impl WorkKey: cmp::Ord { +impl cmp::Ord for WorkKey { pure fn lt(&self, other: &WorkKey) -> bool { self.kind < other.kind || (self.kind == other.kind && @@ -285,7 +285,7 @@ trait TPrep { Decodable>(&self, blk: ~fn(&Exec) -> T) -> Work; } -impl @Mut : TPrep { +impl TPrep for @Mut { fn declare_input(&self, kind:&str, name:&str, val:&str) { do self.borrow_mut |p| { p.declared_inputs.insert(WorkKey::new(kind, name), diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index 22f1e2d47533b..e3d1fb9781b2e 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -326,7 +326,7 @@ pub enum inline_attr { ia_never, } -impl inline_attr : cmp::Eq { +impl cmp::Eq for inline_attr { pure fn eq(&self, other: &inline_attr) -> bool { ((*self) as uint) == ((*other) as uint) } diff --git a/src/libsyntax/diagnostic.rs b/src/libsyntax/diagnostic.rs index e44ee4eef0a8c..2b24d03f8e9e5 100644 --- a/src/libsyntax/diagnostic.rs +++ b/src/libsyntax/diagnostic.rs @@ -63,7 +63,7 @@ struct CodemapT { cm: @codemap::CodeMap, } -impl CodemapT: span_handler { +impl span_handler for CodemapT { fn span_fatal(@mut self, sp: span, msg: &str) -> ! { self.handler.emit(Some((self.cm, sp)), msg, fatal); fail!(); @@ -89,7 +89,7 @@ impl CodemapT: span_handler { } } -impl HandlerT: handler { +impl handler for HandlerT { fn fatal(@mut self, msg: &str) -> ! { (self.emit)(None, msg, fatal); fail!(); diff --git a/src/libsyntax/ext/auto_encode.rs b/src/libsyntax/ext/auto_encode.rs index c854fca64248d..9c0550c987527 100644 --- a/src/libsyntax/ext/auto_encode.rs +++ b/src/libsyntax/ext/auto_encode.rs @@ -23,7 +23,7 @@ For example, a type like: would generate two implementations like: -impl Node: Encodable { +impl Encodable for Node { fn encode(&self, s: &S) { do s.emit_struct("Node", 1) { s.emit_field("id", 0, || s.emit_uint(self.id)) @@ -31,7 +31,7 @@ impl Node: Encodable { } } -impl node_id: Decodable { +impl Decodable for node_id { static fn decode(d: &D) -> Node { do d.read_struct("Node", 1) { Node { diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index c924acd577d32..951e350f8b290 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -197,7 +197,7 @@ pub fn mk_ctxt(parse_sess: parse::parse_sess, mod_path: ~[ast::ident], trace_mac: bool } - impl CtxtRepr: ext_ctxt { + impl ext_ctxt for CtxtRepr { fn codemap(@mut self) -> @CodeMap { self.parse_sess.cm } fn parse_sess(@mut self) -> parse::parse_sess { self.parse_sess } fn cfg(@mut self) -> ast::crate_cfg { self.cfg } diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs index 4522c7e0fd6c2..ffa6101d58fcc 100644 --- a/src/libsyntax/ext/quote.rs +++ b/src/libsyntax/ext/quote.rs @@ -53,7 +53,7 @@ pub mod rt { pub fn to_tokens(_cx: ext_ctxt) -> ~[token_tree]; } - impl ~[token_tree]: ToTokens { + impl ToTokens for ~[token_tree] { pub fn to_tokens(_cx: ext_ctxt) -> ~[token_tree] { copy self } @@ -78,43 +78,43 @@ pub mod rt { pub fn to_source(cx: ext_ctxt) -> ~str; } - impl ast::ident: ToSource { + impl ToSource for ast::ident { fn to_source(cx: ext_ctxt) -> ~str { copy *cx.parse_sess().interner.get(self) } } - impl @ast::item: ToSource { + impl ToSource for @ast::item { fn to_source(cx: ext_ctxt) -> ~str { item_to_str(self, cx.parse_sess().interner) } } - impl ~[@ast::item]: ToSource { + impl ToSource for ~[@ast::item] { fn to_source(cx: ext_ctxt) -> ~str { str::connect(self.map(|i| i.to_source(cx)), ~"\n\n") } } - impl @ast::Ty: ToSource { + impl ToSource for @ast::Ty { fn to_source(cx: ext_ctxt) -> ~str { ty_to_str(self, cx.parse_sess().interner) } } - impl ~[@ast::Ty]: ToSource { + impl ToSource for ~[@ast::Ty] { fn to_source(cx: ext_ctxt) -> ~str { str::connect(self.map(|i| i.to_source(cx)), ~", ") } } - impl ~[ast::ty_param]: ToSource { + impl ToSource for ~[ast::ty_param] { fn to_source(cx: ext_ctxt) -> ~str { pprust::typarams_to_str(self, cx.parse_sess().interner) } } - impl @ast::expr: ToSource { + impl ToSource for @ast::expr { fn to_source(cx: ext_ctxt) -> ~str { pprust::expr_to_str(self, cx.parse_sess().interner) } @@ -122,43 +122,43 @@ pub mod rt { // Alas ... we write these out instead. All redundant. - impl ast::ident: ToTokens { + impl ToTokens for ast::ident { fn to_tokens(cx: ext_ctxt) -> ~[token_tree] { cx.parse_tts(self.to_source(cx)) } } - impl @ast::item: ToTokens { + impl ToTokens for @ast::item { fn to_tokens(cx: ext_ctxt) -> ~[token_tree] { cx.parse_tts(self.to_source(cx)) } } - impl ~[@ast::item]: ToTokens { + impl ToTokens for ~[@ast::item] { fn to_tokens(cx: ext_ctxt) -> ~[token_tree] { cx.parse_tts(self.to_source(cx)) } } - impl @ast::Ty: ToTokens { + impl ToTokens for @ast::Ty { fn to_tokens(cx: ext_ctxt) -> ~[token_tree] { cx.parse_tts(self.to_source(cx)) } } - impl ~[@ast::Ty]: ToTokens { + impl ToTokens for ~[@ast::Ty] { fn to_tokens(cx: ext_ctxt) -> ~[token_tree] { cx.parse_tts(self.to_source(cx)) } } - impl ~[ast::ty_param]: ToTokens { + impl ToTokens for ~[ast::ty_param] { fn to_tokens(cx: ext_ctxt) -> ~[token_tree] { cx.parse_tts(self.to_source(cx)) } } - impl @ast::expr: ToTokens { + impl ToTokens for @ast::expr { fn to_tokens(cx: ext_ctxt) -> ~[token_tree] { cx.parse_tts(self.to_source(cx)) } @@ -171,7 +171,7 @@ pub mod rt { fn parse_tts(s: ~str) -> ~[ast::token_tree]; } - impl ext_ctxt: ExtParseUtils { + impl ExtParseUtils for ext_ctxt { fn parse_item(s: ~str) -> @ast::item { let res = parse::parse_item_from_source_str( diff --git a/src/libsyntax/parse/attr.rs b/src/libsyntax/parse/attr.rs index e6ba543cf790d..e297e33d825c6 100644 --- a/src/libsyntax/parse/attr.rs +++ b/src/libsyntax/parse/attr.rs @@ -30,7 +30,7 @@ pub trait parser_attr { fn parse_optional_meta() -> ~[@ast::meta_item]; } -impl Parser: parser_attr { +impl parser_attr for Parser { // Parse attributes that appear before an item fn parse_outer_attributes() -> ~[ast::attribute] { diff --git a/src/libsyntax/parse/comments.rs b/src/libsyntax/parse/comments.rs index 1e17cf3543dd6..2cadf195778a2 100644 --- a/src/libsyntax/parse/comments.rs +++ b/src/libsyntax/parse/comments.rs @@ -34,7 +34,7 @@ pub enum cmnt_style { blank_line, // Just a manual blank line "\n\n", for layout } -impl cmnt_style : cmp::Eq { +impl cmp::Eq for cmnt_style { pure fn eq(&self, other: &cmnt_style) -> bool { ((*self) as uint) == ((*other) as uint) } diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs index 48ba94bdc33b7..f5fbefdd89b4b 100644 --- a/src/libsyntax/parse/lexer.rs +++ b/src/libsyntax/parse/lexer.rs @@ -108,7 +108,7 @@ fn dup_string_reader(r: @mut StringReader) -> @mut StringReader { } } -impl StringReader: reader { +impl reader for StringReader { fn is_eof(@mut self) -> bool { is_eof(self) } // return the next token. EFFECT: advances the string_reader. fn next_token(@mut self) -> TokenAndSpan { diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 92d25d5d19378..3279c79e5af0d 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -520,7 +520,7 @@ pub fn reserved_keyword_table() -> HashMap<~str, ()> { } -impl Token : cmp::Eq { +impl cmp::Eq for Token { pure fn eq(&self, other: &Token) -> bool { match (*self) { EQ => { diff --git a/src/test/auxiliary/ambig_impl_2_lib.rs b/src/test/auxiliary/ambig_impl_2_lib.rs index ef195c9c32a0b..c6dfe7b79a9d0 100644 --- a/src/test/auxiliary/ambig_impl_2_lib.rs +++ b/src/test/auxiliary/ambig_impl_2_lib.rs @@ -11,4 +11,4 @@ trait me { fn me() -> uint; } -impl uint: me { fn me() -> uint { self } } +impl me for uint { fn me() -> uint { self } } diff --git a/src/test/auxiliary/cci_impl_lib.rs b/src/test/auxiliary/cci_impl_lib.rs index cd342c44407f6..ab744d60ac228 100644 --- a/src/test/auxiliary/cci_impl_lib.rs +++ b/src/test/auxiliary/cci_impl_lib.rs @@ -14,7 +14,7 @@ trait uint_helpers { fn to(v: uint, f: fn(uint)); } -impl uint: uint_helpers { +impl uint_helpers for uint { #[inline] fn to(v: uint, f: fn(uint)) { let mut i = self; diff --git a/src/test/auxiliary/explicit_self_xcrate.rs b/src/test/auxiliary/explicit_self_xcrate.rs index 355cd935ce2b4..c790252244f6b 100644 --- a/src/test/auxiliary/explicit_self_xcrate.rs +++ b/src/test/auxiliary/explicit_self_xcrate.rs @@ -17,7 +17,7 @@ pub struct Bar { x: ~str } -impl Bar : Foo { +impl Foo for Bar { #[inline(always)] fn f(&self) { io::println((*self).x); diff --git a/src/test/auxiliary/impl_privacy_xc_2.rs b/src/test/auxiliary/impl_privacy_xc_2.rs index 009e132f5985d..d8c2a9ede5cff 100644 --- a/src/test/auxiliary/impl_privacy_xc_2.rs +++ b/src/test/auxiliary/impl_privacy_xc_2.rs @@ -6,7 +6,7 @@ pub struct Fish { mod unexported { use super::Fish; - impl Fish : Eq { + impl Eq for Fish { pure fn eq(&self, _: &Fish) -> bool { true } pure fn ne(&self, _: &Fish) -> bool { false } } diff --git a/src/test/auxiliary/issue-2380.rs b/src/test/auxiliary/issue-2380.rs index c0b824618a47c..7cc8dcb22c995 100644 --- a/src/test/auxiliary/issue-2380.rs +++ b/src/test/auxiliary/issue-2380.rs @@ -14,7 +14,7 @@ pub trait i { } pub fn f() -> i { - impl (): i { } + impl i for () { } () as i:: } diff --git a/src/test/auxiliary/issue-2414-a.rs b/src/test/auxiliary/issue-2414-a.rs index 2c691d6d58e43..fb97adf51a534 100644 --- a/src/test/auxiliary/issue-2414-a.rs +++ b/src/test/auxiliary/issue-2414-a.rs @@ -17,7 +17,7 @@ trait foo { fn foo(); } -impl ~str: foo { +impl foo for ~str { fn foo() {} } diff --git a/src/test/auxiliary/issue-2526.rs b/src/test/auxiliary/issue-2526.rs index 4e07de771e5ba..f9d08713852e4 100644 --- a/src/test/auxiliary/issue-2526.rs +++ b/src/test/auxiliary/issue-2526.rs @@ -19,7 +19,7 @@ struct arc_destruct { _data: int, } -impl arc_destruct : Drop { +impl Drop for arc_destruct { fn finalize(&self) {} } @@ -43,7 +43,7 @@ struct context_res { ctx : int, } -impl context_res : Drop { +impl Drop for context_res { fn finalize(&self) {} } diff --git a/src/test/auxiliary/issue2378a.rs b/src/test/auxiliary/issue2378a.rs index 6007b1f3d175e..ead338c4bc803 100644 --- a/src/test/auxiliary/issue2378a.rs +++ b/src/test/auxiliary/issue2378a.rs @@ -10,7 +10,7 @@ enum maybe { just(T), nothing } -impl methods for maybe { +impl copy> for maybe for methods T { match self { just(t) { t } diff --git a/src/test/auxiliary/issue2378b.rs b/src/test/auxiliary/issue2378b.rs index ff056b8028d06..9037417ef6224 100644 --- a/src/test/auxiliary/issue2378b.rs +++ b/src/test/auxiliary/issue2378b.rs @@ -15,8 +15,8 @@ use issue2378a::methods; type two_maybes = {a: maybe, b: maybe}; -impl methods for two_maybes { +impl copy> for two_maybes for methods (T, T) { (self.a[idx], self.b[idx]) } -} \ No newline at end of file +} diff --git a/src/test/auxiliary/issue4516_ty_param_lib.rs b/src/test/auxiliary/issue4516_ty_param_lib.rs index 3f93540e64f62..2e3c7eedfcc38 100644 --- a/src/test/auxiliary/issue4516_ty_param_lib.rs +++ b/src/test/auxiliary/issue4516_ty_param_lib.rs @@ -10,4 +10,4 @@ pub fn to_closure(x: A) -> @fn() -> A { fn@() -> A { copy x } -} \ No newline at end of file +} diff --git a/src/test/auxiliary/issue_2242_a.rs b/src/test/auxiliary/issue_2242_a.rs index 6f3813a94c0a9..c2caf1e77ee9d 100644 --- a/src/test/auxiliary/issue_2242_a.rs +++ b/src/test/auxiliary/issue_2242_a.rs @@ -15,6 +15,6 @@ trait to_strz { fn to_strz() -> ~str; } -impl ~str: to_strz { +impl to_strz for ~str { fn to_strz() -> ~str { copy self } } diff --git a/src/test/auxiliary/issue_2242_c.rs b/src/test/auxiliary/issue_2242_c.rs index 32e131fac262f..40a2bcc114a53 100644 --- a/src/test/auxiliary/issue_2242_c.rs +++ b/src/test/auxiliary/issue_2242_c.rs @@ -15,6 +15,6 @@ extern mod a; use a::to_strz; -impl bool: to_strz { +impl to_strz for bool { fn to_strz() -> ~str { fmt!("%b", self) } } diff --git a/src/test/auxiliary/issue_2472_b.rs b/src/test/auxiliary/issue_2472_b.rs index 0c7c827e0299b..e1be3adcd4a02 100644 --- a/src/test/auxiliary/issue_2472_b.rs +++ b/src/test/auxiliary/issue_2472_b.rs @@ -19,6 +19,6 @@ trait T { fn bar(); } -impl S: T { +impl T for S { fn bar() { } } diff --git a/src/test/auxiliary/issue_3136_a.rs b/src/test/auxiliary/issue_3136_a.rs index a0c056d1f9931..4de0b900dd3ea 100644 --- a/src/test/auxiliary/issue_3136_a.rs +++ b/src/test/auxiliary/issue_3136_a.rs @@ -12,7 +12,7 @@ trait x { fn use_x(); } enum y = (); -impl y:x { +impl x for y { fn use_x() { struct foo { //~ ERROR quux i: () diff --git a/src/test/auxiliary/private_variant_1.rs b/src/test/auxiliary/private_variant_1.rs index 248223e5c5dc2..606a662315a0d 100644 --- a/src/test/auxiliary/private_variant_1.rs +++ b/src/test/auxiliary/private_variant_1.rs @@ -12,4 +12,4 @@ mod super_sekrit { pub enum sooper_sekrit { pub quux, priv baz } -} \ No newline at end of file +} diff --git a/src/test/auxiliary/static-methods-crate.rs b/src/test/auxiliary/static-methods-crate.rs index 37be325f15bc6..f06f2e31b710f 100644 --- a/src/test/auxiliary/static-methods-crate.rs +++ b/src/test/auxiliary/static-methods-crate.rs @@ -17,13 +17,13 @@ pub trait read { static fn readMaybe(s: ~str) -> Option; } -impl int: read { +impl read for int { static fn readMaybe(s: ~str) -> Option { int::from_str(s) } } -impl bool: read { +impl read for bool { static fn readMaybe(s: ~str) -> Option { match s { ~"true" => Some(true), diff --git a/src/test/auxiliary/static_fn_inline_xc_aux.rs b/src/test/auxiliary/static_fn_inline_xc_aux.rs index 78e3dcca39db0..f595529b7f6d7 100644 --- a/src/test/auxiliary/static_fn_inline_xc_aux.rs +++ b/src/test/auxiliary/static_fn_inline_xc_aux.rs @@ -16,7 +16,7 @@ pub mod num { } pub mod float { - impl float: ::num::Num2 { + impl ::num::Num2 for float { #[inline] static pure fn from_int2(n: int) -> float { return n as float; } } diff --git a/src/test/auxiliary/static_fn_trait_xc_aux.rs b/src/test/auxiliary/static_fn_trait_xc_aux.rs index d28d6ce187a95..80734b8336b87 100644 --- a/src/test/auxiliary/static_fn_trait_xc_aux.rs +++ b/src/test/auxiliary/static_fn_trait_xc_aux.rs @@ -5,7 +5,7 @@ pub mod num { } pub mod float { - impl float: ::num::Num2 { + impl ::num::Num2 for float { static pure fn from_int2(n: int) -> float { return n as float; } } } diff --git a/src/test/auxiliary/trait_inheritance_auto_xc_2_aux.rs b/src/test/auxiliary/trait_inheritance_auto_xc_2_aux.rs index 0b434ad0f4f8d..11d4b28c21521 100644 --- a/src/test/auxiliary/trait_inheritance_auto_xc_2_aux.rs +++ b/src/test/auxiliary/trait_inheritance_auto_xc_2_aux.rs @@ -14,8 +14,8 @@ pub trait Baz { fn h() -> int; } pub struct A { x: int } -impl A : Foo { fn f() -> int { 10 } } -impl A : Bar { fn g() -> int { 20 } } -impl A : Baz { fn h() -> int { 30 } } +impl Foo for A { fn f() -> int { 10 } } +impl Bar for A { fn g() -> int { 20 } } +impl Baz for A { fn h() -> int { 30 } } diff --git a/src/test/auxiliary/trait_inheritance_auto_xc_aux.rs b/src/test/auxiliary/trait_inheritance_auto_xc_aux.rs index 6bbf9bd59946f..97a363f6b0c45 100644 --- a/src/test/auxiliary/trait_inheritance_auto_xc_aux.rs +++ b/src/test/auxiliary/trait_inheritance_auto_xc_aux.rs @@ -14,4 +14,4 @@ trait Baz { fn h() -> int; } trait Quux: Foo Bar Baz { } -impl T: Quux { } +impl Quux for T { } diff --git a/src/test/auxiliary/trait_inheritance_cross_trait_call_xc_aux.rs b/src/test/auxiliary/trait_inheritance_cross_trait_call_xc_aux.rs index ca4d8edc2c74e..724860d685544 100644 --- a/src/test/auxiliary/trait_inheritance_cross_trait_call_xc_aux.rs +++ b/src/test/auxiliary/trait_inheritance_cross_trait_call_xc_aux.rs @@ -17,6 +17,6 @@ pub struct A { x: int } -impl A : Foo { +impl Foo for A { fn f() -> int { 10 } } diff --git a/src/test/bench/shootout-mandelbrot.rs b/src/test/bench/shootout-mandelbrot.rs index b19454ec230c2..76a7688777218 100644 --- a/src/test/bench/shootout-mandelbrot.rs +++ b/src/test/bench/shootout-mandelbrot.rs @@ -29,7 +29,7 @@ struct cmplx { im: f64 } -impl cmplx : ops::Mul { +impl ops::Mul for cmplx { pure fn mul(&self, x: &cmplx) -> cmplx { cmplx { re: self.re*(*x).re - self.im*(*x).im, @@ -38,7 +38,7 @@ impl cmplx : ops::Mul { } } -impl cmplx : ops::Add { +impl ops::Add for cmplx { pure fn add(&self, x: &cmplx) -> cmplx { cmplx { re: self.re + (*x).re, @@ -98,7 +98,7 @@ fn chanmb(i: uint, size: uint) -> Line struct Devnull(); -impl Devnull: io::Writer { +impl io::Writer for Devnull { fn write(&self, _b: &[const u8]) {} fn seek(&self, _i: int, _s: io::SeekStyle) {} fn tell(&self) -> uint {0_u} diff --git a/src/test/bench/task-perf-alloc-unwind.rs b/src/test/bench/task-perf-alloc-unwind.rs index c67305bab8f31..5f0530871fc83 100644 --- a/src/test/bench/task-perf-alloc-unwind.rs +++ b/src/test/bench/task-perf-alloc-unwind.rs @@ -56,7 +56,7 @@ struct r { _l: @nillist, } -impl r : Drop { +impl Drop for r { fn finalize(&self) {} } diff --git a/src/test/compile-fail/alt-arrows-block-then-binop.rs b/src/test/compile-fail/alt-arrows-block-then-binop.rs index 490a8a8b67b43..b6b2313aa09c3 100644 --- a/src/test/compile-fail/alt-arrows-block-then-binop.rs +++ b/src/test/compile-fail/alt-arrows-block-then-binop.rs @@ -14,4 +14,4 @@ fn main() { 0 => { } + 5 //~ ERROR unexpected token: `+` } -} \ No newline at end of file +} diff --git a/src/test/compile-fail/alt-range-fail-dominate.rs b/src/test/compile-fail/alt-range-fail-dominate.rs index c5354a8f7f135..3f484511859f3 100644 --- a/src/test/compile-fail/alt-range-fail-dominate.rs +++ b/src/test/compile-fail/alt-range-fail-dominate.rs @@ -44,4 +44,4 @@ fn main() { 0.02 => {} _ => {} }; -} \ No newline at end of file +} diff --git a/src/test/compile-fail/ambig_impl_2_exe.rs b/src/test/compile-fail/ambig_impl_2_exe.rs index f73fb95c5bc17..ed18abe9bf0ab 100644 --- a/src/test/compile-fail/ambig_impl_2_exe.rs +++ b/src/test/compile-fail/ambig_impl_2_exe.rs @@ -15,6 +15,6 @@ use ambig_impl_2_lib::me; trait me { fn me() -> uint; } -impl uint: me { fn me() -> uint { self } } //~ NOTE is `__extensions__::me` +impl me for uint { fn me() -> uint { self } } //~ NOTE is `__extensions__::me` fn main() { 1u.me(); } //~ ERROR multiple applicable methods in scope //~^ NOTE is `ambig_impl_2_lib::__extensions__::me` diff --git a/src/test/compile-fail/ambig_impl_bounds.rs b/src/test/compile-fail/ambig_impl_bounds.rs index 10629ef2344ea..d4fe51835aee5 100644 --- a/src/test/compile-fail/ambig_impl_bounds.rs +++ b/src/test/compile-fail/ambig_impl_bounds.rs @@ -17,4 +17,4 @@ fn foo(t: T) { //~^^ NOTE candidate #2 derives from the bound `B` } -fn main() {} \ No newline at end of file +fn main() {} diff --git a/src/test/compile-fail/ambig_impl_unify.rs b/src/test/compile-fail/ambig_impl_unify.rs index 4d2a8004986bf..7e27a51ccdd89 100644 --- a/src/test/compile-fail/ambig_impl_unify.rs +++ b/src/test/compile-fail/ambig_impl_unify.rs @@ -12,11 +12,11 @@ trait foo { fn foo() -> int; } -impl ~[uint]: foo { +impl foo for ~[uint] { fn foo() -> int {1} //~ NOTE candidate #1 is `__extensions__::foo` } -impl ~[int]: foo { +impl foo for ~[int] { fn foo() -> int {2} //~ NOTE candidate #2 is `__extensions__::foo` } diff --git a/src/test/compile-fail/assign-super.rs b/src/test/compile-fail/assign-super.rs index a728a64f53b65..17c7ff1bb6037 100644 --- a/src/test/compile-fail/assign-super.rs +++ b/src/test/compile-fail/assign-super.rs @@ -12,4 +12,4 @@ fn main() { let mut x: ~[mut int] = ~[mut 3]; let y: ~[int] = ~[3]; x = y; //~ ERROR values differ in mutability -} \ No newline at end of file +} diff --git a/src/test/compile-fail/attempted-access-non-fatal.rs b/src/test/compile-fail/attempted-access-non-fatal.rs index e55efd7938fe0..06dd154c27905 100644 --- a/src/test/compile-fail/attempted-access-non-fatal.rs +++ b/src/test/compile-fail/attempted-access-non-fatal.rs @@ -13,4 +13,4 @@ fn main() { let x = 0; log(debug, x.foo); //~ ERROR attempted access of field log(debug, x.bar); //~ ERROR attempted access of field -} \ No newline at end of file +} diff --git a/src/test/compile-fail/attr-before-ext.rs b/src/test/compile-fail/attr-before-ext.rs index 764f8fc7d37ab..2675b865e9017 100644 --- a/src/test/compile-fail/attr-before-ext.rs +++ b/src/test/compile-fail/attr-before-ext.rs @@ -11,4 +11,4 @@ fn main() { #[attr] debug!("hi"); //~ ERROR expected item after attrs -} \ No newline at end of file +} diff --git a/src/test/compile-fail/attr-before-let.rs b/src/test/compile-fail/attr-before-let.rs index ad757d16eb379..51ee903b1b1db 100644 --- a/src/test/compile-fail/attr-before-let.rs +++ b/src/test/compile-fail/attr-before-let.rs @@ -11,4 +11,4 @@ fn main() { #[attr] let _i = 0; //~ ERROR expected item -} \ No newline at end of file +} diff --git a/src/test/compile-fail/auto-ref-borrowck-failure.rs b/src/test/compile-fail/auto-ref-borrowck-failure.rs index 5e6ceac9031c6..f5dbef3c061bf 100644 --- a/src/test/compile-fail/auto-ref-borrowck-failure.rs +++ b/src/test/compile-fail/auto-ref-borrowck-failure.rs @@ -18,7 +18,7 @@ trait Stuff { fn printme(); } -impl &mut Foo : Stuff { +impl Stuff for &mut Foo { fn printme() { io::println(fmt!("%d", self.x)); } diff --git a/src/test/compile-fail/auto-ref-slice-plus-ref.rs b/src/test/compile-fail/auto-ref-slice-plus-ref.rs index f80112834eaee..db89dcfea02b2 100644 --- a/src/test/compile-fail/auto-ref-slice-plus-ref.rs +++ b/src/test/compile-fail/auto-ref-slice-plus-ref.rs @@ -23,6 +23,6 @@ trait MyIter { pure fn test_mut(&mut self); } -impl &[int]: MyIter { +impl MyIter for &[int] { pure fn test_mut(&mut self) { } } diff --git a/src/test/compile-fail/bad-method-typaram-kind.rs b/src/test/compile-fail/bad-method-typaram-kind.rs index 112423a073e9e..7032a3a0b22e7 100644 --- a/src/test/compile-fail/bad-method-typaram-kind.rs +++ b/src/test/compile-fail/bad-method-typaram-kind.rs @@ -16,7 +16,7 @@ trait bar { fn bar(); } -impl uint: bar { +impl bar for uint { fn bar() { } } diff --git a/src/test/compile-fail/bad-value-ident-false.rs b/src/test/compile-fail/bad-value-ident-false.rs index 79a247d827d34..17157623863ad 100644 --- a/src/test/compile-fail/bad-value-ident-false.rs +++ b/src/test/compile-fail/bad-value-ident-false.rs @@ -9,4 +9,4 @@ // except according to those terms. fn false() { } //~ ERROR found `false` in ident position -fn main() { } \ No newline at end of file +fn main() { } diff --git a/src/test/compile-fail/bad-value-ident-true.rs b/src/test/compile-fail/bad-value-ident-true.rs index 317a9a32931a2..5160471e95c80 100644 --- a/src/test/compile-fail/bad-value-ident-true.rs +++ b/src/test/compile-fail/bad-value-ident-true.rs @@ -9,4 +9,4 @@ // except according to those terms. fn true() { } //~ ERROR found `true` in ident position -fn main() { } \ No newline at end of file +fn main() { } diff --git a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-1.rs b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-1.rs index 1bffb0739e93f..298e5d53c9401 100644 --- a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-1.rs +++ b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-1.rs @@ -10,7 +10,7 @@ struct X { x: () } -impl X : Drop { +impl Drop for X { fn finalize(&self) { error!("destructor runs"); } diff --git a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-2.rs b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-2.rs index cbf4855990915..162a10a370b78 100644 --- a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-2.rs +++ b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-2.rs @@ -10,7 +10,7 @@ struct X { x: (), } -impl X : Drop { +impl Drop for X { fn finalize(&self) { error!("destructor runs"); } diff --git a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-3.rs b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-3.rs index 9c14a53eba169..1aed491bbf069 100644 --- a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-3.rs +++ b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-3.rs @@ -10,7 +10,7 @@ struct X { x: (), } -impl X : Drop { +impl Drop for X { fn finalize(&self) { error!("destructor runs"); } diff --git a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-4.rs b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-4.rs index 1d492fdd0f1f2..9c879e297090f 100644 --- a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-4.rs +++ b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-4.rs @@ -10,7 +10,7 @@ struct X { x: (), } -impl X : Drop { +impl Drop for X { fn finalize(&self) { error!("destructor runs"); } diff --git a/src/test/compile-fail/bind-by-move-no-lvalues-1.rs b/src/test/compile-fail/bind-by-move-no-lvalues-1.rs index e4e8cba4e9ce1..586285d956691 100644 --- a/src/test/compile-fail/bind-by-move-no-lvalues-1.rs +++ b/src/test/compile-fail/bind-by-move-no-lvalues-1.rs @@ -12,7 +12,7 @@ struct X { x: (), } -impl X : Drop { +impl Drop for X { fn finalize(&self) { error!("destructor runs"); } diff --git a/src/test/compile-fail/bind-by-move-no-lvalues-2.rs b/src/test/compile-fail/bind-by-move-no-lvalues-2.rs index 45f9415db9b75..9ed48fe33e319 100644 --- a/src/test/compile-fail/bind-by-move-no-lvalues-2.rs +++ b/src/test/compile-fail/bind-by-move-no-lvalues-2.rs @@ -12,7 +12,7 @@ struct X { x: (), } -impl X : Drop { +impl Drop for X { fn finalize(&self) { error!("destructor runs"); } diff --git a/src/test/compile-fail/bind-by-move-no-sub-bindings.rs b/src/test/compile-fail/bind-by-move-no-sub-bindings.rs index 0d845983c6e0d..d60ef84f04024 100644 --- a/src/test/compile-fail/bind-by-move-no-sub-bindings.rs +++ b/src/test/compile-fail/bind-by-move-no-sub-bindings.rs @@ -10,7 +10,7 @@ struct X { x: (), } -impl X : Drop { +impl Drop for X { fn finalize(&self) { error!("destructor runs"); } diff --git a/src/test/compile-fail/binop-add-ptr.rs b/src/test/compile-fail/binop-add-ptr.rs index 605e2179f2119..679deceb7bca3 100644 --- a/src/test/compile-fail/binop-add-ptr.rs +++ b/src/test/compile-fail/binop-add-ptr.rs @@ -11,4 +11,4 @@ // error-pattern:binary operation + cannot be applied to type `*int` fn die() -> *int { (0 as *int) + (0 as *int) } -fn main() { } \ No newline at end of file +fn main() { } diff --git a/src/test/compile-fail/block-must-not-have-result-do.rs b/src/test/compile-fail/block-must-not-have-result-do.rs index 1c2a3b5627cc3..abeefa4aac810 100644 --- a/src/test/compile-fail/block-must-not-have-result-do.rs +++ b/src/test/compile-fail/block-must-not-have-result-do.rs @@ -14,4 +14,4 @@ fn main() { loop { true } -} \ No newline at end of file +} diff --git a/src/test/compile-fail/block-must-not-have-result-for.rs b/src/test/compile-fail/block-must-not-have-result-for.rs index b3f1755dc66b7..d1e001f722c3f 100644 --- a/src/test/compile-fail/block-must-not-have-result-for.rs +++ b/src/test/compile-fail/block-must-not-have-result-for.rs @@ -12,4 +12,4 @@ fn main() { for vec::each(~[0]) |_i| { //~ ERROR A for-loop body must return (), but true } -} \ No newline at end of file +} diff --git a/src/test/compile-fail/block-must-not-have-result-res.rs b/src/test/compile-fail/block-must-not-have-result-res.rs index 25108d2a13b52..6095d645f483d 100644 --- a/src/test/compile-fail/block-must-not-have-result-res.rs +++ b/src/test/compile-fail/block-must-not-have-result-res.rs @@ -12,7 +12,7 @@ struct r {} -impl r : Drop { +impl Drop for r { fn finalize(&self) { true } diff --git a/src/test/compile-fail/block-must-not-have-result-while.rs b/src/test/compile-fail/block-must-not-have-result-while.rs index 7caf5bd129d5d..e4aceabf0c8fb 100644 --- a/src/test/compile-fail/block-must-not-have-result-while.rs +++ b/src/test/compile-fail/block-must-not-have-result-while.rs @@ -14,4 +14,4 @@ fn main() { while true { true } -} \ No newline at end of file +} diff --git a/src/test/compile-fail/borrowck-addr-of-upvar.rs b/src/test/compile-fail/borrowck-addr-of-upvar.rs index b9e3960fcce79..8bd3832d70ceb 100644 --- a/src/test/compile-fail/borrowck-addr-of-upvar.rs +++ b/src/test/compile-fail/borrowck-addr-of-upvar.rs @@ -21,4 +21,4 @@ fn zed(x: @int) -> fn@() -> int { } fn main() { -} \ No newline at end of file +} diff --git a/src/test/compile-fail/borrowck-assign-to-constants.rs b/src/test/compile-fail/borrowck-assign-to-constants.rs index c89c22db3dc17..78a95cb33c0c3 100644 --- a/src/test/compile-fail/borrowck-assign-to-constants.rs +++ b/src/test/compile-fail/borrowck-assign-to-constants.rs @@ -14,4 +14,4 @@ fn main() { // assigning to various global constants None = Some(3); //~ ERROR assigning to static item foo = 6; //~ ERROR assigning to static item -} \ No newline at end of file +} diff --git a/src/test/compile-fail/borrowck-assign-to-enum.rs b/src/test/compile-fail/borrowck-assign-to-enum.rs index adc923ce22f04..25a320061d451 100644 --- a/src/test/compile-fail/borrowck-assign-to-enum.rs +++ b/src/test/compile-fail/borrowck-assign-to-enum.rs @@ -13,4 +13,4 @@ enum foo = int; fn main() { let x = foo(3); *x = 4; //~ ERROR assigning to enum content -} \ No newline at end of file +} diff --git a/src/test/compile-fail/borrowck-assign-to-subfield.rs b/src/test/compile-fail/borrowck-assign-to-subfield.rs index 397525b94738b..9e90995c33abf 100644 --- a/src/test/compile-fail/borrowck-assign-to-subfield.rs +++ b/src/test/compile-fail/borrowck-assign-to-subfield.rs @@ -27,4 +27,4 @@ fn main() { p.x.a = 2; //~ ERROR assigning to immutable field p.y.a = 2; //~ ERROR assigning to const field p.z.a = 2; -} \ No newline at end of file +} diff --git a/src/test/compile-fail/borrowck-borrowed-uniq-rvalue-2.rs b/src/test/compile-fail/borrowck-borrowed-uniq-rvalue-2.rs index e899e214248b1..404644e78e2e5 100644 --- a/src/test/compile-fail/borrowck-borrowed-uniq-rvalue-2.rs +++ b/src/test/compile-fail/borrowck-borrowed-uniq-rvalue-2.rs @@ -12,7 +12,7 @@ struct defer { x: &[&str], } -impl defer : Drop { +impl Drop for defer { fn finalize(&self) { error!("%?", self.x); } diff --git a/src/test/compile-fail/borrowck-insert-during-each.rs b/src/test/compile-fail/borrowck-insert-during-each.rs index 1dcf8268440eb..e0fca586b6b7b 100644 --- a/src/test/compile-fail/borrowck-insert-during-each.rs +++ b/src/test/compile-fail/borrowck-insert-during-each.rs @@ -31,4 +31,4 @@ fn bar(f: &mut Foo) { fn main() { let mut f = Foo { n: LinearSet::new() }; bar(&mut f); -} \ No newline at end of file +} diff --git a/src/test/compile-fail/borrowck-loan-in-overloaded-op.rs b/src/test/compile-fail/borrowck-loan-in-overloaded-op.rs index fb72dc0271404..0b9375bc543a1 100644 --- a/src/test/compile-fail/borrowck-loan-in-overloaded-op.rs +++ b/src/test/compile-fail/borrowck-loan-in-overloaded-op.rs @@ -12,7 +12,7 @@ enum foo = ~uint; -impl foo : Add { +impl Add for foo { pure fn add(f: &foo) -> foo { foo(~(**self + **(*f))) } diff --git a/src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs b/src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs index c2649801cbc80..e15edd8cf199c 100644 --- a/src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs +++ b/src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs @@ -13,7 +13,7 @@ struct Point { y: int, } -impl Point : ops::Add { +impl ops::Add for Point { pure fn add(&self, z: &int) -> int { self.x + self.y + (*z) } diff --git a/src/test/compile-fail/borrowck-loan-rcvr.rs b/src/test/compile-fail/borrowck-loan-rcvr.rs index f558280f0e107..97b46c714921f 100644 --- a/src/test/compile-fail/borrowck-loan-rcvr.rs +++ b/src/test/compile-fail/borrowck-loan-rcvr.rs @@ -16,7 +16,7 @@ trait methods { pure fn purem(); } -impl point: methods { +impl methods for point { fn impurem() { } diff --git a/src/test/compile-fail/borrowck-loan-vec-content.rs b/src/test/compile-fail/borrowck-loan-vec-content.rs index 1423eac4ab875..b0b22dcfe61d0 100644 --- a/src/test/compile-fail/borrowck-loan-vec-content.rs +++ b/src/test/compile-fail/borrowck-loan-vec-content.rs @@ -41,4 +41,4 @@ fn has_mut_vec_and_tries_to_change_it() { } fn main() { -} \ No newline at end of file +} diff --git a/src/test/compile-fail/borrowck-move-from-unsafe-ptr.rs b/src/test/compile-fail/borrowck-move-from-unsafe-ptr.rs index 32fe696dbb9bf..7154683565960 100644 --- a/src/test/compile-fail/borrowck-move-from-unsafe-ptr.rs +++ b/src/test/compile-fail/borrowck-move-from-unsafe-ptr.rs @@ -14,4 +14,4 @@ fn foo(x: *~int) -> ~int { } fn main() { -} \ No newline at end of file +} diff --git a/src/test/compile-fail/borrowck-mut-deref-comp.rs b/src/test/compile-fail/borrowck-mut-deref-comp.rs index 3ffe71e2325e0..3c67b6d5caf8d 100644 --- a/src/test/compile-fail/borrowck-mut-deref-comp.rs +++ b/src/test/compile-fail/borrowck-mut-deref-comp.rs @@ -16,4 +16,4 @@ fn borrow(x: @mut foo) { } fn main() { -} \ No newline at end of file +} diff --git a/src/test/compile-fail/borrowck-mut-field-imm-base.rs b/src/test/compile-fail/borrowck-mut-field-imm-base.rs index 2d57419f4946c..685efcacf0c58 100644 --- a/src/test/compile-fail/borrowck-mut-field-imm-base.rs +++ b/src/test/compile-fail/borrowck-mut-field-imm-base.rs @@ -27,4 +27,4 @@ fn main() { *q += 1; io::println(fmt!("*r = %u", *r)); io::println(fmt!("*r = %u", *s)); -} \ No newline at end of file +} diff --git a/src/test/compile-fail/borrowck-mut-vec-as-imm-slice-bad.rs b/src/test/compile-fail/borrowck-mut-vec-as-imm-slice-bad.rs index 88263df954b22..43feb65c8b96b 100644 --- a/src/test/compile-fail/borrowck-mut-vec-as-imm-slice-bad.rs +++ b/src/test/compile-fail/borrowck-mut-vec-as-imm-slice-bad.rs @@ -21,4 +21,4 @@ fn has_mut_vec(+v: @~[mut int]) -> int { fn main() { assert has_mut_vec(@~[mut 1, 2, 3]) == 6; -} \ No newline at end of file +} diff --git a/src/test/compile-fail/borrowck-pure-scope-in-call.rs b/src/test/compile-fail/borrowck-pure-scope-in-call.rs index 0d652585fdb5e..7ff13739ba7e6 100644 --- a/src/test/compile-fail/borrowck-pure-scope-in-call.rs +++ b/src/test/compile-fail/borrowck-pure-scope-in-call.rs @@ -30,4 +30,4 @@ fn test2() { } fn main() { -} \ No newline at end of file +} diff --git a/src/test/compile-fail/borrowck-unary-move-2.rs b/src/test/compile-fail/borrowck-unary-move-2.rs index 9a70449f37260..a25fc8327bd10 100644 --- a/src/test/compile-fail/borrowck-unary-move-2.rs +++ b/src/test/compile-fail/borrowck-unary-move-2.rs @@ -12,7 +12,7 @@ struct noncopyable { i: (), } -impl noncopyable : Drop { +impl Drop for noncopyable { fn finalize(&self) { error!("dropped"); } diff --git a/src/test/compile-fail/cast-from-nil.rs b/src/test/compile-fail/cast-from-nil.rs index 8cf2b82a36bb7..262bf1030bcbe 100644 --- a/src/test/compile-fail/cast-from-nil.rs +++ b/src/test/compile-fail/cast-from-nil.rs @@ -9,4 +9,4 @@ // except according to those terms. // error-pattern: cast from nil: `()` as `u32` -fn main() { let u = (assert true) as u32; } \ No newline at end of file +fn main() { let u = (assert true) as u32; } diff --git a/src/test/compile-fail/cast-to-nil.rs b/src/test/compile-fail/cast-to-nil.rs index a5b179284d39c..1a5c0744f70a2 100644 --- a/src/test/compile-fail/cast-to-nil.rs +++ b/src/test/compile-fail/cast-to-nil.rs @@ -9,4 +9,4 @@ // except according to those terms. // error-pattern: cast to nil: `u32` as `()` -fn main() { let u = 0u32 as (); } \ No newline at end of file +fn main() { let u = 0u32 as (); } diff --git a/src/test/compile-fail/class-cast-to-trait.rs b/src/test/compile-fail/class-cast-to-trait.rs index 5facc3cc5f7f7..671298040a90b 100644 --- a/src/test/compile-fail/class-cast-to-trait.rs +++ b/src/test/compile-fail/class-cast-to-trait.rs @@ -34,7 +34,7 @@ impl cat { } } -impl cat : noisy { +impl noisy for cat { fn speak() { self.meow(); } } diff --git a/src/test/compile-fail/class-method-missing.rs b/src/test/compile-fail/class-method-missing.rs index bdde101b0c837..2a7e2cea6fa98 100644 --- a/src/test/compile-fail/class-method-missing.rs +++ b/src/test/compile-fail/class-method-missing.rs @@ -17,7 +17,7 @@ struct cat { meows: uint, } -impl cat : animal { +impl animal for cat { } fn cat(in_x : uint) -> cat { @@ -28,4 +28,4 @@ fn cat(in_x : uint) -> cat { fn main() { let nyan = cat(0u); -} \ No newline at end of file +} diff --git a/src/test/compile-fail/class-missing-self.rs b/src/test/compile-fail/class-missing-self.rs index bbab4c7d4240c..9d3eb6446565f 100644 --- a/src/test/compile-fail/class-missing-self.rs +++ b/src/test/compile-fail/class-missing-self.rs @@ -23,4 +23,4 @@ priv impl cat { } - fn main() { } \ No newline at end of file + fn main() { } diff --git a/src/test/compile-fail/coerce-bad-variance.rs b/src/test/compile-fail/coerce-bad-variance.rs index c4cdbcb67e2be..6ce969c7eaf3c 100644 --- a/src/test/compile-fail/coerce-bad-variance.rs +++ b/src/test/compile-fail/coerce-bad-variance.rs @@ -14,4 +14,4 @@ fn give_away3(y: @mut @int) { mutate(y); //~ ERROR values differ in mutability } -fn main() {} \ No newline at end of file +fn main() {} diff --git a/src/test/compile-fail/const-recursive.rs b/src/test/compile-fail/const-recursive.rs index 43eceab2c1f16..f565a44c97f97 100644 --- a/src/test/compile-fail/const-recursive.rs +++ b/src/test/compile-fail/const-recursive.rs @@ -13,4 +13,4 @@ const a: int = b; const b: int = a; fn main() { -} \ No newline at end of file +} diff --git a/src/test/compile-fail/copy-a-resource.rs b/src/test/compile-fail/copy-a-resource.rs index eb135e1889363..95fd9b938f07b 100644 --- a/src/test/compile-fail/copy-a-resource.rs +++ b/src/test/compile-fail/copy-a-resource.rs @@ -12,7 +12,7 @@ struct foo { i: int, } -impl foo : Drop { +impl Drop for foo { fn finalize(&self) {} } diff --git a/src/test/compile-fail/disallowed-deconstructing-destructing-struct.rs b/src/test/compile-fail/disallowed-deconstructing-destructing-struct.rs index e4448f17a997d..9019d338d0903 100644 --- a/src/test/compile-fail/disallowed-deconstructing-destructing-struct.rs +++ b/src/test/compile-fail/disallowed-deconstructing-destructing-struct.rs @@ -12,7 +12,7 @@ struct X { x: ~str, } -impl X : Drop { +impl Drop for X { fn finalize(&self) { error!("value: %s", self.x); } diff --git a/src/test/compile-fail/drop-on-non-struct.rs b/src/test/compile-fail/drop-on-non-struct.rs index 6988027235074..4e5b64c8f3db4 100644 --- a/src/test/compile-fail/drop-on-non-struct.rs +++ b/src/test/compile-fail/drop-on-non-struct.rs @@ -10,7 +10,7 @@ type Foo = @[u8]; -impl Foo : Drop { //~ ERROR the Drop trait may only be implemented +impl Drop for Foo { //~ ERROR the Drop trait may only be implemented //~^ ERROR cannot provide an extension implementation fn finalize(&self) { io::println("kaboom"); diff --git a/src/test/compile-fail/elided-test.rs b/src/test/compile-fail/elided-test.rs index 13c2caf2c42ae..b62214b12f9a0 100644 --- a/src/test/compile-fail/elided-test.rs +++ b/src/test/compile-fail/elided-test.rs @@ -14,4 +14,4 @@ // and the build will fail because main doesn't exist #[test] fn main() { -} \ No newline at end of file +} diff --git a/src/test/compile-fail/empty-record-type.rs b/src/test/compile-fail/empty-record-type.rs index 16eaea638c8d9..74ac36f369454 100644 --- a/src/test/compile-fail/empty-record-type.rs +++ b/src/test/compile-fail/empty-record-type.rs @@ -14,4 +14,4 @@ type t = {}; fn main() { -} \ No newline at end of file +} diff --git a/src/test/compile-fail/explicit-call-to-dtor.rs b/src/test/compile-fail/explicit-call-to-dtor.rs index 0f124158410e8..71674186b6125 100644 --- a/src/test/compile-fail/explicit-call-to-dtor.rs +++ b/src/test/compile-fail/explicit-call-to-dtor.rs @@ -12,7 +12,7 @@ struct Foo { x: int } -impl Foo : Drop { +impl Drop for Foo { fn finalize(&self) { io::println("kaboom"); } diff --git a/src/test/compile-fail/explicit-call-to-supertrait-dtor.rs b/src/test/compile-fail/explicit-call-to-supertrait-dtor.rs index f16053a9a44c5..3b1dda19448cc 100644 --- a/src/test/compile-fail/explicit-call-to-supertrait-dtor.rs +++ b/src/test/compile-fail/explicit-call-to-supertrait-dtor.rs @@ -16,13 +16,13 @@ trait Bar : Drop { fn blah(); } -impl Foo : Drop { +impl Drop for Foo { fn finalize(&self) { io::println("kaboom"); } } -impl Foo : Bar { +impl Bar for Foo { fn blah() { self.finalize(); //~ ERROR explicit call to destructor } diff --git a/src/test/compile-fail/ext-after-attrib.rs b/src/test/compile-fail/ext-after-attrib.rs index 256ef33cedefe..eacad50b92f07 100644 --- a/src/test/compile-fail/ext-after-attrib.rs +++ b/src/test/compile-fail/ext-after-attrib.rs @@ -14,4 +14,4 @@ // item attribute. Probably could use a better error message. #[foo = "bar"] fmt!("baz") -fn main() { } \ No newline at end of file +fn main() { } diff --git a/src/test/compile-fail/extern-no-call.rs b/src/test/compile-fail/extern-no-call.rs index 5a4474c7ccc3d..8c6deb3481674 100644 --- a/src/test/compile-fail/extern-no-call.rs +++ b/src/test/compile-fail/extern-no-call.rs @@ -14,4 +14,4 @@ extern fn f() { fn main() { f(); -} \ No newline at end of file +} diff --git a/src/test/compile-fail/if-without-else-result.rs b/src/test/compile-fail/if-without-else-result.rs index b95c853aa7b5b..58e78953d5a78 100644 --- a/src/test/compile-fail/if-without-else-result.rs +++ b/src/test/compile-fail/if-without-else-result.rs @@ -13,4 +13,4 @@ fn main() { let a = if true { true }; log(debug, a); -} \ No newline at end of file +} diff --git a/src/test/compile-fail/immut-function-arguments.rs b/src/test/compile-fail/immut-function-arguments.rs index 814ec64b5c0ea..e557eaba83474 100644 --- a/src/test/compile-fail/immut-function-arguments.rs +++ b/src/test/compile-fail/immut-function-arguments.rs @@ -17,4 +17,4 @@ fn g() { } -fn main() {} \ No newline at end of file +fn main() {} diff --git a/src/test/compile-fail/import-from-path.rs b/src/test/compile-fail/import-from-path.rs index 480491067cd9d..ce91de7e9d97a 100644 --- a/src/test/compile-fail/import-from-path.rs +++ b/src/test/compile-fail/import-from-path.rs @@ -9,4 +9,4 @@ // except according to those terms. // error-pattern:expected -use foo::{bar}::baz \ No newline at end of file +use foo::{bar}::baz diff --git a/src/test/compile-fail/import-glob-path.rs b/src/test/compile-fail/import-glob-path.rs index bf60f951e7f36..b6bc53fad945f 100644 --- a/src/test/compile-fail/import-glob-path.rs +++ b/src/test/compile-fail/import-glob-path.rs @@ -9,4 +9,4 @@ // except according to those terms. // error-pattern:expected -use foo::*::bar \ No newline at end of file +use foo::*::bar diff --git a/src/test/compile-fail/infinite-instantiation.rs b/src/test/compile-fail/infinite-instantiation.rs index 8b068f47c8f79..21f49b11f66a1 100644 --- a/src/test/compile-fail/infinite-instantiation.rs +++ b/src/test/compile-fail/infinite-instantiation.rs @@ -15,13 +15,13 @@ trait to_opt { fn to_option() -> Option; } -impl uint: to_opt { +impl to_opt for uint { fn to_option() -> Option { Some(self) } } -impl Option: to_opt { +impl to_opt for Option { fn to_option() -> Option> { Some(self) } diff --git a/src/test/compile-fail/infinite-tag-type-recursion.rs b/src/test/compile-fail/infinite-tag-type-recursion.rs index 84ffffcd3d63a..0974668f19d31 100644 --- a/src/test/compile-fail/infinite-tag-type-recursion.rs +++ b/src/test/compile-fail/infinite-tag-type-recursion.rs @@ -14,4 +14,4 @@ enum mlist { cons(int, mlist), nil, } -fn main() { let a = cons(10, cons(11, nil)); } \ No newline at end of file +fn main() { let a = cons(10, cons(11, nil)); } diff --git a/src/test/compile-fail/issue-1802-1.rs b/src/test/compile-fail/issue-1802-1.rs index d75a66de0f6cd..8ce99f517c48a 100644 --- a/src/test/compile-fail/issue-1802-1.rs +++ b/src/test/compile-fail/issue-1802-1.rs @@ -11,4 +11,4 @@ // error-pattern:no valid digits found for number fn main() { log(error, 0b42); -} \ No newline at end of file +} diff --git a/src/test/compile-fail/issue-1802-2.rs b/src/test/compile-fail/issue-1802-2.rs index a8d3e386187bd..c7aacdfc68aac 100644 --- a/src/test/compile-fail/issue-1802-2.rs +++ b/src/test/compile-fail/issue-1802-2.rs @@ -11,4 +11,4 @@ // error-pattern:no valid digits found for number fn main() { log(error, 0bu); -} \ No newline at end of file +} diff --git a/src/test/compile-fail/issue-1896-1.rs b/src/test/compile-fail/issue-1896-1.rs index ff1afcebf9a1a..5def792558aac 100644 --- a/src/test/compile-fail/issue-1896-1.rs +++ b/src/test/compile-fail/issue-1896-1.rs @@ -20,4 +20,4 @@ fn main () { let myInt: uint = (aFn.theFn)(); assert myInt == 10; -} \ No newline at end of file +} diff --git a/src/test/compile-fail/issue-1900.rs b/src/test/compile-fail/issue-1900.rs index a5ec5c5e79493..ae46ab8116f15 100644 --- a/src/test/compile-fail/issue-1900.rs +++ b/src/test/compile-fail/issue-1900.rs @@ -9,4 +9,4 @@ // except according to those terms. // error-pattern: main function is not allowed to have type parameters -fn main() { } \ No newline at end of file +fn main() { } diff --git a/src/test/compile-fail/issue-2063.rs b/src/test/compile-fail/issue-2063.rs index 7837fa2f8c79d..8f344f4260664 100644 --- a/src/test/compile-fail/issue-2063.rs +++ b/src/test/compile-fail/issue-2063.rs @@ -20,7 +20,7 @@ trait to_str_2 { // I use an impl here because it will cause // the compiler to attempt autoderef and then // try to resolve the method. -impl t: to_str_2 { +impl to_str_2 for t { fn to_str() -> ~str { ~"t" } } diff --git a/src/test/compile-fail/issue-2111.rs b/src/test/compile-fail/issue-2111.rs index 124c25d681f81..40010b203aa9b 100644 --- a/src/test/compile-fail/issue-2111.rs +++ b/src/test/compile-fail/issue-2111.rs @@ -18,4 +18,4 @@ fn foo(a: Option, b: Option) { fn main() { foo(None, None); -} \ No newline at end of file +} diff --git a/src/test/compile-fail/issue-2149.rs b/src/test/compile-fail/issue-2149.rs index abc6fe50fab8e..7e3ffb92950ad 100644 --- a/src/test/compile-fail/issue-2149.rs +++ b/src/test/compile-fail/issue-2149.rs @@ -12,7 +12,7 @@ trait vec_monad { fn bind(f: fn(A) -> ~[B]); } -impl ~[A]: vec_monad { +impl vec_monad for ~[A] { fn bind(f: fn(A) -> ~[B]) { let mut r = fail!(); for self.each |elt| { r += f(*elt); } diff --git a/src/test/compile-fail/issue-2330.rs b/src/test/compile-fail/issue-2330.rs index 9ff9676b675fb..e255d46633a62 100644 --- a/src/test/compile-fail/issue-2330.rs +++ b/src/test/compile-fail/issue-2330.rs @@ -15,7 +15,7 @@ trait channel { } // `chan` is not a trait, it's an enum -impl int: chan { //~ ERROR can only implement trait types +impl chan for int { //~ ERROR can only implement trait types fn send(v: int) { fail!() } } diff --git a/src/test/compile-fail/issue-2548.rs b/src/test/compile-fail/issue-2548.rs index 1b85bd9646e75..abc734697191f 100644 --- a/src/test/compile-fail/issue-2548.rs +++ b/src/test/compile-fail/issue-2548.rs @@ -16,7 +16,7 @@ struct foo { } -impl foo : Drop { +impl Drop for foo { fn finalize(&self) { io::println("Goodbye, World!"); *self.x += 1; diff --git a/src/test/compile-fail/issue-2590.rs b/src/test/compile-fail/issue-2590.rs index ac8132555d6da..22ae941350b4c 100644 --- a/src/test/compile-fail/issue-2590.rs +++ b/src/test/compile-fail/issue-2590.rs @@ -18,7 +18,7 @@ trait parse { fn parse() -> ~[int]; } -impl parser: parse { +impl parse for parser { fn parse() -> ~[int] { dvec::unwrap(self.tokens) //~ ERROR moving out of immutable field } diff --git a/src/test/compile-fail/issue-2611-3.rs b/src/test/compile-fail/issue-2611-3.rs index 4bcdf9b299f4d..5da3d08e34c56 100644 --- a/src/test/compile-fail/issue-2611-3.rs +++ b/src/test/compile-fail/issue-2611-3.rs @@ -23,7 +23,7 @@ struct E { f: int } -impl E: A { +impl A for E { fn b(_x: F) -> F { fail!() } //~ ERROR in method `b`, type parameter 0 has 1 bound, but } diff --git a/src/test/compile-fail/issue-2611-4.rs b/src/test/compile-fail/issue-2611-4.rs index a20a182d85ec3..c8f3f9a4a5a3d 100644 --- a/src/test/compile-fail/issue-2611-4.rs +++ b/src/test/compile-fail/issue-2611-4.rs @@ -20,7 +20,7 @@ struct E { f: int } -impl E: A { +impl A for E { fn b(_x: F) -> F { fail!() } //~ ERROR in method `b`, type parameter 0 has 2 bounds, but } diff --git a/src/test/compile-fail/issue-2611-5.rs b/src/test/compile-fail/issue-2611-5.rs index f55feb80c32c6..f8f7704bcd9d0 100644 --- a/src/test/compile-fail/issue-2611-5.rs +++ b/src/test/compile-fail/issue-2611-5.rs @@ -20,7 +20,7 @@ struct E { f: int } -impl E: A { +impl A for E { // n.b. The error message is awful -- see #3404 fn b(_x: G) -> G { fail!() } //~ ERROR method `b` has an incompatible type } diff --git a/src/test/compile-fail/issue-2817-2.rs b/src/test/compile-fail/issue-2817-2.rs index 05adfaa03ecd9..890b984e42ef2 100644 --- a/src/test/compile-fail/issue-2817-2.rs +++ b/src/test/compile-fail/issue-2817-2.rs @@ -24,4 +24,4 @@ fn main() { for not_bool() |_i| { //~^ ERROR A `for` loop iterator should expect a closure that returns `bool` }; -} \ No newline at end of file +} diff --git a/src/test/compile-fail/issue-2823.rs b/src/test/compile-fail/issue-2823.rs index f2ea4faf48212..b29b19b406f03 100644 --- a/src/test/compile-fail/issue-2823.rs +++ b/src/test/compile-fail/issue-2823.rs @@ -12,7 +12,7 @@ struct C { x: int, } -impl C : Drop { +impl Drop for C { fn finalize(&self) { error!("dropping: %?", self.x); } diff --git a/src/test/compile-fail/issue-2951.rs b/src/test/compile-fail/issue-2951.rs index f31c4c8c6794f..3874d9b13f5ca 100644 --- a/src/test/compile-fail/issue-2951.rs +++ b/src/test/compile-fail/issue-2951.rs @@ -16,4 +16,4 @@ fn foo(x: T, y: U) { fn main() { -} \ No newline at end of file +} diff --git a/src/test/compile-fail/issue-2995.rs b/src/test/compile-fail/issue-2995.rs index dd146b98af20a..5c48416667fe1 100644 --- a/src/test/compile-fail/issue-2995.rs +++ b/src/test/compile-fail/issue-2995.rs @@ -10,4 +10,4 @@ fn bad (p: *int) { let _q: &int = p as ∫ //~ ERROR non-scalar cast -} \ No newline at end of file +} diff --git a/src/test/compile-fail/issue-3021-d.rs b/src/test/compile-fail/issue-3021-d.rs index 6779829e70c64..38bd007f1891e 100644 --- a/src/test/compile-fail/issue-3021-d.rs +++ b/src/test/compile-fail/issue-3021-d.rs @@ -28,7 +28,7 @@ fn siphash(k0 : u64, k1 : u64) -> siphash { return v0 ^ v1; } - impl sipstate: siphash { + impl siphash for sipstate { fn reset() { self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR attempted dynamic environment-capture //~^ ERROR unresolved name: k0 diff --git a/src/test/compile-fail/issue-3021.rs b/src/test/compile-fail/issue-3021.rs index fa9c4eb52170c..fdfd256217508 100644 --- a/src/test/compile-fail/issue-3021.rs +++ b/src/test/compile-fail/issue-3021.rs @@ -20,7 +20,7 @@ fn siphash(k0 : u64) -> siphash { }; - impl sipstate: siphash { + impl siphash for sipstate { fn reset() { self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR attempted dynamic environment-capture //~^ ERROR unresolved name: k0 diff --git a/src/test/compile-fail/issue-3154.rs b/src/test/compile-fail/issue-3154.rs index bdb9d6ee16af5..8f638713742e5 100644 --- a/src/test/compile-fail/issue-3154.rs +++ b/src/test/compile-fail/issue-3154.rs @@ -18,4 +18,4 @@ fn thing(x: &Q) -> thing { fn main() { thing(&()); -} \ No newline at end of file +} diff --git a/src/test/compile-fail/issue-3214.rs b/src/test/compile-fail/issue-3214.rs index ca36a6260148b..ff19551896b86 100644 --- a/src/test/compile-fail/issue-3214.rs +++ b/src/test/compile-fail/issue-3214.rs @@ -14,7 +14,7 @@ fn foo() { //~^ ERROR use of undeclared type name } - impl foo : Drop { + impl Drop for foo { fn finalize(&self) {} } } diff --git a/src/test/compile-fail/issue-3243.rs b/src/test/compile-fail/issue-3243.rs index 4a09e93deff3d..ac5c099e1146a 100644 --- a/src/test/compile-fail/issue-3243.rs +++ b/src/test/compile-fail/issue-3243.rs @@ -18,4 +18,4 @@ fn function() -> &[mut int] { fn main() { let x = function(); error!("%?", x); -} \ No newline at end of file +} diff --git a/src/test/compile-fail/issue-3344.rs b/src/test/compile-fail/issue-3344.rs index 84deb4cad46e3..2d31867752ac5 100644 --- a/src/test/compile-fail/issue-3344.rs +++ b/src/test/compile-fail/issue-3344.rs @@ -9,7 +9,7 @@ // except according to those terms. enum thing = uint; -impl thing : cmp::Ord { //~ ERROR missing method `gt` +impl cmp::Ord for thing { //~ ERROR missing method `gt` pure fn lt(&self, other: &thing) -> bool { **self < **other } pure fn le(&self, other: &thing) -> bool { **self < **other } pure fn ge(&self, other: &thing) -> bool { **self < **other } diff --git a/src/test/compile-fail/issue-3477.rs b/src/test/compile-fail/issue-3477.rs index 7e189348db354..23e680fd851c3 100644 --- a/src/test/compile-fail/issue-3477.rs +++ b/src/test/compile-fail/issue-3477.rs @@ -1,3 +1,3 @@ fn main() { let _p: char = 100; //~ ERROR mismatched types: expected `char` but found -} \ No newline at end of file +} diff --git a/src/test/compile-fail/issue-3651-2.rs b/src/test/compile-fail/issue-3651-2.rs index bb20be701db40..2431313df631c 100644 --- a/src/test/compile-fail/issue-3651-2.rs +++ b/src/test/compile-fail/issue-3651-2.rs @@ -10,4 +10,4 @@ fn main() { do 5.times {} //~ ERROR Do-block body must return bool, but returns () here. Perhaps -} \ No newline at end of file +} diff --git a/src/test/compile-fail/issue-3651.rs b/src/test/compile-fail/issue-3651.rs index 392c1415d8a71..38e9348155ac3 100644 --- a/src/test/compile-fail/issue-3651.rs +++ b/src/test/compile-fail/issue-3651.rs @@ -10,4 +10,4 @@ fn main() { for task::spawn { return true; } //~ ERROR A `for` loop iterator should expect a closure that -} \ No newline at end of file +} diff --git a/src/test/compile-fail/issue-3668.rs b/src/test/compile-fail/issue-3668.rs index 364701de2d109..2b25afeb0e7b4 100644 --- a/src/test/compile-fail/issue-3668.rs +++ b/src/test/compile-fail/issue-3668.rs @@ -13,7 +13,7 @@ trait PTrait { fn getChildOption() -> Option<@P>; } -impl P: PTrait { +impl PTrait for P { fn getChildOption() -> Option<@P> { const childVal: @P = self.child.get(); //~ ERROR attempt to use a non-constant value in a constant fail!(); diff --git a/src/test/compile-fail/issue-3702-2.rs b/src/test/compile-fail/issue-3702-2.rs index f50b046b5ee75..54100d543dda0 100644 --- a/src/test/compile-fail/issue-3702-2.rs +++ b/src/test/compile-fail/issue-3702-2.rs @@ -13,7 +13,7 @@ trait Add { fn add_dynamic(&self, other: &Add) -> int; } -impl int: Add { +impl Add for int { fn to_int(&self) -> int { *self } fn add_dynamic(&self, other: &Add) -> int { self.to_int() + other.to_int() //~ ERROR multiple applicable methods in scope diff --git a/src/test/compile-fail/issue-3820.rs b/src/test/compile-fail/issue-3820.rs index 719036db1ab95..3a726d270ffce 100644 --- a/src/test/compile-fail/issue-3820.rs +++ b/src/test/compile-fail/issue-3820.rs @@ -13,7 +13,7 @@ struct Thing { x: int } -impl Thing/*: Mul*/ { //~ ERROR Look ma, no Mul! +impl Mul*/ for Thing/* { //~ ERROR Look ma, no Mul! pure fn mul(c: &int) -> Thing { Thing {x: self.x * *c} } diff --git a/src/test/compile-fail/issue-3953.rs b/src/test/compile-fail/issue-3953.rs index 0b10f6cd17eaa..2c797691b8d7a 100644 --- a/src/test/compile-fail/issue-3953.rs +++ b/src/test/compile-fail/issue-3953.rs @@ -21,7 +21,7 @@ enum Lol = int; pub impl Lol: Hahaha { } -impl Lol: Eq { +impl Eq for Lol { pure fn eq(&self, other: &Lol) -> bool { **self != **other } pure fn ne(&self, other: &Lol) -> bool { **self == **other } } @@ -32,4 +32,4 @@ fn main() { } else { io::println("2 != 4"); } -} \ No newline at end of file +} diff --git a/src/test/compile-fail/issue-3973.rs b/src/test/compile-fail/issue-3973.rs index 5d49610a4e5be..812e0fc8c9660 100644 --- a/src/test/compile-fail/issue-3973.rs +++ b/src/test/compile-fail/issue-3973.rs @@ -15,7 +15,7 @@ struct Point { mut y: float, } -impl Point : ToStr { //~ ERROR implements a method not defined in the trait +impl ToStr for Point { //~ ERROR implements a method not defined in the trait static fn new(x: float, y: float) -> Point { Point { x: x, y: y } } diff --git a/src/test/compile-fail/issue-4335.rs b/src/test/compile-fail/issue-4335.rs index 3aaac650c2b0e..7242d993f33f7 100644 --- a/src/test/compile-fail/issue-4335.rs +++ b/src/test/compile-fail/issue-4335.rs @@ -16,4 +16,4 @@ fn f(v: &r/T) -> &r/fn()->T { id::<&r/fn()->T>(|| *v) } //~ ERROR ??? fn main() { let v = &5; io::println(fmt!("%d", f(v)())); -} \ No newline at end of file +} diff --git a/src/test/compile-fail/issue-4523.rs b/src/test/compile-fail/issue-4523.rs index e72b73f8fa4c6..49510c33858be 100644 --- a/src/test/compile-fail/issue-4523.rs +++ b/src/test/compile-fail/issue-4523.rs @@ -14,4 +14,4 @@ const f: fn() = foopy; //~ ERROR mismatched types: expected `&static/fn()` fn main () { f(); -} \ No newline at end of file +} diff --git a/src/test/compile-fail/issue-818.rs b/src/test/compile-fail/issue-818.rs index 824f36038dd1c..00f2df0038594 100644 --- a/src/test/compile-fail/issue-818.rs +++ b/src/test/compile-fail/issue-818.rs @@ -21,4 +21,4 @@ fn main() { let c = ctr::new(42); let c2 = ctr::inc(c); assert *c2 == 5; //~ ERROR can only dereference enums with a single, public variant -} \ No newline at end of file +} diff --git a/src/test/compile-fail/kindck-nonsendable-1.rs b/src/test/compile-fail/kindck-nonsendable-1.rs index f04740bae4c53..a513e367fe5bc 100644 --- a/src/test/compile-fail/kindck-nonsendable-1.rs +++ b/src/test/compile-fail/kindck-nonsendable-1.rs @@ -15,4 +15,4 @@ fn main() { let _ = fn~() { foo(x); }; //~ ERROR value has non-owned type `@uint` let _ = fn~(copy x) { foo(x); }; //~ ERROR value has non-owned type `@uint` let _ = fn~(move x) { foo(x); }; //~ ERROR value has non-owned type `@uint` -} \ No newline at end of file +} diff --git a/src/test/compile-fail/kindck-owned-trait-contains.rs b/src/test/compile-fail/kindck-owned-trait-contains.rs index 69f07e3e77492..2864e27f42f8f 100644 --- a/src/test/compile-fail/kindck-owned-trait-contains.rs +++ b/src/test/compile-fail/kindck-owned-trait-contains.rs @@ -10,7 +10,7 @@ trait repeat { fn get() -> A; } -impl @A: repeat { +impl repeat for @A { fn get() -> A { *self } } @@ -28,4 +28,4 @@ fn main() { repeater(@x) }; assert 3 == *(y.get()); //~ ERROR reference is not valid -} \ No newline at end of file +} diff --git a/src/test/compile-fail/kindck-owned-trait-scoped.rs b/src/test/compile-fail/kindck-owned-trait-scoped.rs index 6c6cdbbb2c773..3d83f13c211ba 100644 --- a/src/test/compile-fail/kindck-owned-trait-scoped.rs +++ b/src/test/compile-fail/kindck-owned-trait-scoped.rs @@ -15,7 +15,7 @@ trait foo { fn foo(i: &self/int) -> int; } -impl T: foo { +impl foo for T { fn foo(i: &self/int) -> int {*i} } @@ -42,4 +42,4 @@ fn to_foo_3(t: T) -> foo { } fn main() { -} \ No newline at end of file +} diff --git a/src/test/compile-fail/lint-deprecated-self.rs b/src/test/compile-fail/lint-deprecated-self.rs index f02ab438fde23..9da103396d87c 100644 --- a/src/test/compile-fail/lint-deprecated-self.rs +++ b/src/test/compile-fail/lint-deprecated-self.rs @@ -8,7 +8,7 @@ mod a { x: int } - impl S : T { + impl T for S { fn f() { //~ ERROR this method form is deprecated } } diff --git a/src/test/compile-fail/lint-non-camel-case-types.rs b/src/test/compile-fail/lint-non-camel-case-types.rs index 2cb0c9e8ddb4d..27c9ca64a93c6 100644 --- a/src/test/compile-fail/lint-non-camel-case-types.rs +++ b/src/test/compile-fail/lint-non-camel-case-types.rs @@ -31,4 +31,4 @@ enum Foo5 { trait foo6 { //~ ERROR type, variant, or trait should have a camel case identifier } -fn main() { } \ No newline at end of file +fn main() { } diff --git a/src/test/compile-fail/liveness-unused.rs b/src/test/compile-fail/liveness-unused.rs index 351a63f062d7e..b5157c669a73a 100644 --- a/src/test/compile-fail/liveness-unused.rs +++ b/src/test/compile-fail/liveness-unused.rs @@ -62,7 +62,7 @@ struct r { x: (), } -impl r : Drop { +impl Drop for r { fn finalize(&self) {} } diff --git a/src/test/compile-fail/loop-does-not-diverge.rs b/src/test/compile-fail/loop-does-not-diverge.rs index 0265bd6d24b67..0a9d9fb20ab0e 100644 --- a/src/test/compile-fail/loop-does-not-diverge.rs +++ b/src/test/compile-fail/loop-does-not-diverge.rs @@ -19,4 +19,4 @@ fn forever() -> ! { fn main() { if (1 == 2) { forever(); } -} \ No newline at end of file +} diff --git a/src/test/compile-fail/lub-in-args.rs b/src/test/compile-fail/lub-in-args.rs index ffd5ce3d10801..c2879d7f27203 100644 --- a/src/test/compile-fail/lub-in-args.rs +++ b/src/test/compile-fail/lub-in-args.rs @@ -24,4 +24,4 @@ fn main() { two_args(x, y); //~ ERROR (values differ in mutability) two_args(a, b); //~ ERROR (values differ in mutability) -} \ No newline at end of file +} diff --git a/src/test/compile-fail/missing-derivable-attr.rs b/src/test/compile-fail/missing-derivable-attr.rs index bff6344bc5539..3d63b622fcc96 100644 --- a/src/test/compile-fail/missing-derivable-attr.rs +++ b/src/test/compile-fail/missing-derivable-attr.rs @@ -16,7 +16,7 @@ struct A { x: int } -impl int : MyEq { +impl MyEq for int { pure fn eq(&self, other: &int) -> bool { *self == *other } } diff --git a/src/test/compile-fail/mod_file_correct_spans.rs b/src/test/compile-fail/mod_file_correct_spans.rs index aa1106952fab8..f2973fb0d5eae 100644 --- a/src/test/compile-fail/mod_file_correct_spans.rs +++ b/src/test/compile-fail/mod_file_correct_spans.rs @@ -14,4 +14,4 @@ mod mod_file_aux; fn main() { assert mod_file_aux::bar() == 10; //~ ERROR unresolved name -} \ No newline at end of file +} diff --git a/src/test/compile-fail/mod_file_not_exist.rs b/src/test/compile-fail/mod_file_not_exist.rs index da2eb70915ca8..42a43ea358ca5 100644 --- a/src/test/compile-fail/mod_file_not_exist.rs +++ b/src/test/compile-fail/mod_file_not_exist.rs @@ -12,4 +12,4 @@ mod not_a_real_file; //~ ERROR not_a_real_file.rs fn main() { assert mod_file_aux::bar() == 10; -} \ No newline at end of file +} diff --git a/src/test/compile-fail/mod_file_with_path_attr.rs b/src/test/compile-fail/mod_file_with_path_attr.rs index 7cc03081105f6..56be5e5022a0e 100644 --- a/src/test/compile-fail/mod_file_with_path_attr.rs +++ b/src/test/compile-fail/mod_file_with_path_attr.rs @@ -13,4 +13,4 @@ mod m; //~ ERROR not_a_real_file.rs fn main() { assert m::foo() == 10; -} \ No newline at end of file +} diff --git a/src/test/compile-fail/moves-based-on-type-access-to-field.rs b/src/test/compile-fail/moves-based-on-type-access-to-field.rs index 663b615816d0c..6cc19b18c20a6 100644 --- a/src/test/compile-fail/moves-based-on-type-access-to-field.rs +++ b/src/test/compile-fail/moves-based-on-type-access-to-field.rs @@ -17,4 +17,4 @@ fn f20() { touch(&x[0]); //~ ERROR use of partially moved value: `x` } -fn main() {} \ No newline at end of file +fn main() {} diff --git a/src/test/compile-fail/multiple-main.rs b/src/test/compile-fail/multiple-main.rs index 0ca42425dbdf9..ef8cd58abf992 100644 --- a/src/test/compile-fail/multiple-main.rs +++ b/src/test/compile-fail/multiple-main.rs @@ -14,4 +14,4 @@ fn main() { mod foo { fn main() { //~ ERROR multiple 'main' functions } -} \ No newline at end of file +} diff --git a/src/test/compile-fail/multitrait.rs b/src/test/compile-fail/multitrait.rs index a0a9e3f0ddf27..b49ee5aab47e6 100644 --- a/src/test/compile-fail/multitrait.rs +++ b/src/test/compile-fail/multitrait.rs @@ -12,7 +12,7 @@ struct S { y: int } -impl S: Cmp, ToStr { //~ ERROR: expected `{` but found `,` +impl Cmp, ToStr for S { //~ ERROR: expected `{` but found `,` fn eq(&&other: S) { false } fn to_str(&self) -> ~str { ~"hi" } } diff --git a/src/test/compile-fail/no-send-res-ports.rs b/src/test/compile-fail/no-send-res-ports.rs index d0c216fe23122..4954bbfa09d06 100644 --- a/src/test/compile-fail/no-send-res-ports.rs +++ b/src/test/compile-fail/no-send-res-ports.rs @@ -15,7 +15,7 @@ fn main() { _x: Port<()>, } - impl foo : Drop { + impl Drop for foo { fn finalize(&self) {} } diff --git a/src/test/compile-fail/non-const.rs b/src/test/compile-fail/non-const.rs index 84f34d0e9bdfb..9bc4ce87787ed 100644 --- a/src/test/compile-fail/non-const.rs +++ b/src/test/compile-fail/non-const.rs @@ -16,7 +16,7 @@ struct r { x:int, } -impl r : Drop { +impl Drop for r { fn finalize(&self) {} } @@ -30,7 +30,7 @@ struct r2 { x:@mut int, } -impl r2 : Drop { +impl Drop for r2 { fn finalize(&self) {} } diff --git a/src/test/compile-fail/noncopyable-class.rs b/src/test/compile-fail/noncopyable-class.rs index 360180ee4557e..115120ff37263 100644 --- a/src/test/compile-fail/noncopyable-class.rs +++ b/src/test/compile-fail/noncopyable-class.rs @@ -14,7 +14,7 @@ struct bar { x: int, } -impl bar : Drop { +impl Drop for bar { fn finalize(&self) {} } diff --git a/src/test/compile-fail/omitted-arg-in-item-fn.rs b/src/test/compile-fail/omitted-arg-in-item-fn.rs index df833ad55fe82..fcbfb115af756 100644 --- a/src/test/compile-fail/omitted-arg-in-item-fn.rs +++ b/src/test/compile-fail/omitted-arg-in-item-fn.rs @@ -9,4 +9,4 @@ // except according to those terms. fn foo(x) { //~ ERROR expected `:` but found `)` -} \ No newline at end of file +} diff --git a/src/test/compile-fail/omitted-arg-wrong-types.rs b/src/test/compile-fail/omitted-arg-wrong-types.rs index 2a9f427c7b040..13087e05d0be4 100644 --- a/src/test/compile-fail/omitted-arg-wrong-types.rs +++ b/src/test/compile-fail/omitted-arg-wrong-types.rs @@ -17,4 +17,4 @@ fn main() { let_in(3, fn&(i) { assert i == 3u; }); //~^ ERROR expected `int` but found `uint` -} \ No newline at end of file +} diff --git a/src/test/compile-fail/pinned-deep-copy.rs b/src/test/compile-fail/pinned-deep-copy.rs index 80cf409f23986..43515e265297e 100644 --- a/src/test/compile-fail/pinned-deep-copy.rs +++ b/src/test/compile-fail/pinned-deep-copy.rs @@ -12,7 +12,7 @@ struct r { i: @mut int, } -impl r : Drop { +impl Drop for r { fn finalize(&self) { *(self.i) = *(self.i) + 1; } diff --git a/src/test/compile-fail/pptypedef.rs b/src/test/compile-fail/pptypedef.rs index 223d7effa4ce6..b3717c5b20ec4 100644 --- a/src/test/compile-fail/pptypedef.rs +++ b/src/test/compile-fail/pptypedef.rs @@ -16,4 +16,4 @@ fn bar(_t: foo) {} fn main() { // we used to print foo: bar(Some(3u)); //~ ERROR mismatched types: expected `foo` -} \ No newline at end of file +} diff --git a/src/test/compile-fail/private_variant_2.rs b/src/test/compile-fail/private_variant_2.rs index 11d929f79ca2f..e6a27e6a4bb54 100644 --- a/src/test/compile-fail/private_variant_2.rs +++ b/src/test/compile-fail/private_variant_2.rs @@ -14,4 +14,4 @@ extern mod private_variant_1; fn main() { let _x = private_variant_1::super_sekrit::baz; //~ ERROR baz is private -} \ No newline at end of file +} diff --git a/src/test/compile-fail/pure-modifies-aliased.rs b/src/test/compile-fail/pure-modifies-aliased.rs index 85497e2ee0acb..90c507091e932 100644 --- a/src/test/compile-fail/pure-modifies-aliased.rs +++ b/src/test/compile-fail/pure-modifies-aliased.rs @@ -22,7 +22,7 @@ trait modify_in_box_rec { pure fn modify_in_box_rec(sum: @{mut f: int}); } -impl int: modify_in_box_rec { +impl modify_in_box_rec for int { pure fn modify_in_box_rec(sum: @{mut f: int}) { sum.f = self; //~ ERROR assigning to mutable field prohibited in pure context } diff --git a/src/test/compile-fail/qquote-1.rs b/src/test/compile-fail/qquote-1.rs index a9ba7082628b5..e4e61e438f938 100644 --- a/src/test/compile-fail/qquote-1.rs +++ b/src/test/compile-fail/qquote-1.rs @@ -31,7 +31,7 @@ trait fake_ext_ctxt { type fake_session = parse::parse_sess; -impl fake_session: fake_ext_ctxt { +impl fake_ext_ctxt for fake_session { fn cfg() -> ast::crate_cfg { ~[] } fn parse_sess() -> parse::parse_sess { self } fn call_site() -> span { diff --git a/src/test/compile-fail/qquote-2.rs b/src/test/compile-fail/qquote-2.rs index fe382badb5cdf..abe62e15e1309 100644 --- a/src/test/compile-fail/qquote-2.rs +++ b/src/test/compile-fail/qquote-2.rs @@ -30,7 +30,7 @@ trait fake_ext_ctxt { type fake_session = parse::parse_sess; -impl fake_session: fake_ext_ctxt { +impl fake_ext_ctxt for fake_session { fn cfg() -> ast::crate_cfg { ~[] } fn parse_sess() -> parse::parse_sess { self } fn call_site() -> span { diff --git a/src/test/compile-fail/rec-expected.rs b/src/test/compile-fail/rec-expected.rs index e64b6092c66ef..962201aa9b966 100644 --- a/src/test/compile-fail/rec-expected.rs +++ b/src/test/compile-fail/rec-expected.rs @@ -16,4 +16,4 @@ fn have_bar(b: bar) { want_foo(b); //~ ERROR expected a record with field `a` } -fn main() {} \ No newline at end of file +fn main() {} diff --git a/src/test/compile-fail/record-with-resource.rs b/src/test/compile-fail/record-with-resource.rs index c9dc77ce4d21b..2a1db52d73312 100644 --- a/src/test/compile-fail/record-with-resource.rs +++ b/src/test/compile-fail/record-with-resource.rs @@ -12,7 +12,7 @@ struct my_resource { x: int, } -impl my_resource : Drop { +impl Drop for my_resource { fn finalize(&self) { log(error, self.x); } diff --git a/src/test/compile-fail/regions-addr-of-arg.rs b/src/test/compile-fail/regions-addr-of-arg.rs index b9ffb485bdf71..54d7c0b4d18b7 100644 --- a/src/test/compile-fail/regions-addr-of-arg.rs +++ b/src/test/compile-fail/regions-addr-of-arg.rs @@ -17,4 +17,4 @@ fn bar(a: int) { } fn main() { -} \ No newline at end of file +} diff --git a/src/test/compile-fail/regions-escape-via-trait-or-not.rs b/src/test/compile-fail/regions-escape-via-trait-or-not.rs index 0e6039a4db70e..0681680b9c4a2 100644 --- a/src/test/compile-fail/regions-escape-via-trait-or-not.rs +++ b/src/test/compile-fail/regions-escape-via-trait-or-not.rs @@ -12,7 +12,7 @@ trait deref { fn get() -> int; } -impl &int: deref { +impl deref for &int { fn get() -> int { *self } diff --git a/src/test/compile-fail/regions-in-consts.rs b/src/test/compile-fail/regions-in-consts.rs index 47a290099d37f..1d6ddc4cd9ade 100644 --- a/src/test/compile-fail/regions-in-consts.rs +++ b/src/test/compile-fail/regions-in-consts.rs @@ -12,4 +12,4 @@ const c_x: &blk/int = &22; //~ ERROR only the static region is allowed here const c_y: &static/int = &22; fn main() { -} \ No newline at end of file +} diff --git a/src/test/compile-fail/regions-in-enums.rs b/src/test/compile-fail/regions-in-enums.rs index 5e90fbb0498ae..baf072c01eea2 100644 --- a/src/test/compile-fail/regions-in-enums.rs +++ b/src/test/compile-fail/regions-in-enums.rs @@ -20,4 +20,4 @@ enum yes2 { x5(&foo/uint) //~ ERROR named regions other than `self` are not allowed as part of a type declaration } -fn main() {} \ No newline at end of file +fn main() {} diff --git a/src/test/compile-fail/regions-in-rsrcs.rs b/src/test/compile-fail/regions-in-rsrcs.rs index 5547d14799c31..a3ff05634839d 100644 --- a/src/test/compile-fail/regions-in-rsrcs.rs +++ b/src/test/compile-fail/regions-in-rsrcs.rs @@ -12,7 +12,7 @@ struct yes0 { x: &uint, } -impl yes0 : Drop { +impl Drop for yes0 { fn finalize(&self) {} } @@ -20,7 +20,7 @@ struct yes1 { x: &self/uint, } -impl yes1 : Drop { +impl Drop for yes1 { fn finalize(&self) {} } @@ -28,7 +28,7 @@ struct yes2 { x: &foo/uint, //~ ERROR named regions other than `self` are not allowed as part of a type declaration } -impl yes2 : Drop { +impl Drop for yes2 { fn finalize(&self) {} } diff --git a/src/test/compile-fail/regions-in-type-items.rs b/src/test/compile-fail/regions-in-type-items.rs index a183c60fecdd2..a83b747d2f11d 100644 --- a/src/test/compile-fail/regions-in-type-items.rs +++ b/src/test/compile-fail/regions-in-type-items.rs @@ -20,4 +20,4 @@ type item_ty_yes2 = { x: &foo/uint //~ ERROR named regions other than `self` are not allowed as part of a type declaration }; -fn main() {} \ No newline at end of file +fn main() {} diff --git a/src/test/compile-fail/regions-infer-call-3.rs b/src/test/compile-fail/regions-infer-call-3.rs index fcef29a5156c4..762142993f9d9 100644 --- a/src/test/compile-fail/regions-infer-call-3.rs +++ b/src/test/compile-fail/regions-infer-call-3.rs @@ -21,4 +21,4 @@ fn manip(x: &a/int) -> int { } fn main() { -} \ No newline at end of file +} diff --git a/src/test/compile-fail/regions-infer-contravariance-due-to-immutability.rs b/src/test/compile-fail/regions-infer-contravariance-due-to-immutability.rs index 2c493ba2882cd..e9603dba74424 100644 --- a/src/test/compile-fail/regions-infer-contravariance-due-to-immutability.rs +++ b/src/test/compile-fail/regions-infer-contravariance-due-to-immutability.rs @@ -25,4 +25,4 @@ fn to_longer_lifetime(bi: contravariant/&r) -> contravariant/&static { } fn main() { -} \ No newline at end of file +} diff --git a/src/test/compile-fail/regions-infer-contravariance-due-to-ret.rs b/src/test/compile-fail/regions-infer-contravariance-due-to-ret.rs index 16a6f9352905a..5c57fe26c24b7 100644 --- a/src/test/compile-fail/regions-infer-contravariance-due-to-ret.rs +++ b/src/test/compile-fail/regions-infer-contravariance-due-to-ret.rs @@ -30,4 +30,4 @@ fn to_longer_lifetime(bi: contravariant/&r) -> contravariant/&static { } fn main() { -} \ No newline at end of file +} diff --git a/src/test/compile-fail/regions-infer-covariance-due-to-arg.rs b/src/test/compile-fail/regions-infer-covariance-due-to-arg.rs index cfd8834a53adf..a7363867ddc56 100644 --- a/src/test/compile-fail/regions-infer-covariance-due-to-arg.rs +++ b/src/test/compile-fail/regions-infer-covariance-due-to-arg.rs @@ -29,4 +29,4 @@ fn to_longer_lifetime(bi: covariant/&r) -> covariant/&static { } fn main() { -} \ No newline at end of file +} diff --git a/src/test/compile-fail/regions-infer-invariance-due-to-arg-and-ret.rs b/src/test/compile-fail/regions-infer-invariance-due-to-arg-and-ret.rs index ec11b193ba646..a22bc7c08c574 100644 --- a/src/test/compile-fail/regions-infer-invariance-due-to-arg-and-ret.rs +++ b/src/test/compile-fail/regions-infer-invariance-due-to-arg-and-ret.rs @@ -29,4 +29,4 @@ fn to_longer_lifetime(bi: invariant/&r) -> invariant/&static { } fn main() { -} \ No newline at end of file +} diff --git a/src/test/compile-fail/regions-infer-invariance-due-to-mutability-1.rs b/src/test/compile-fail/regions-infer-invariance-due-to-mutability-1.rs index b500b8d6724f9..83c2c5806e450 100644 --- a/src/test/compile-fail/regions-infer-invariance-due-to-mutability-1.rs +++ b/src/test/compile-fail/regions-infer-invariance-due-to-mutability-1.rs @@ -25,4 +25,4 @@ fn to_longer_lifetime(bi: invariant/&r) -> invariant/&static { } fn main() { -} \ No newline at end of file +} diff --git a/src/test/compile-fail/regions-infer-invariance-due-to-mutability-2.rs b/src/test/compile-fail/regions-infer-invariance-due-to-mutability-2.rs index 523b48f2aff7e..1a20ca23faedb 100644 --- a/src/test/compile-fail/regions-infer-invariance-due-to-mutability-2.rs +++ b/src/test/compile-fail/regions-infer-invariance-due-to-mutability-2.rs @@ -25,4 +25,4 @@ fn to_longer_lifetime(bi: invariant/&r) -> invariant/&static { } fn main() { -} \ No newline at end of file +} diff --git a/src/test/compile-fail/regions-infer-invariance-due-to-mutability-3.rs b/src/test/compile-fail/regions-infer-invariance-due-to-mutability-3.rs index 76996e9c14224..3d831f02a916b 100644 --- a/src/test/compile-fail/regions-infer-invariance-due-to-mutability-3.rs +++ b/src/test/compile-fail/regions-infer-invariance-due-to-mutability-3.rs @@ -25,4 +25,4 @@ fn to_longer_lifetime(bi: invariant/&r) -> invariant/&static { } fn main() { -} \ No newline at end of file +} diff --git a/src/test/compile-fail/regions-infer-invariance-due-to-mutability-4.rs b/src/test/compile-fail/regions-infer-invariance-due-to-mutability-4.rs index 0f2bdd57bbf01..2c232f70bc412 100644 --- a/src/test/compile-fail/regions-infer-invariance-due-to-mutability-4.rs +++ b/src/test/compile-fail/regions-infer-invariance-due-to-mutability-4.rs @@ -25,4 +25,4 @@ fn to_longer_lifetime(bi: invariant/&r) -> invariant/&static { } fn main() { -} \ No newline at end of file +} diff --git a/src/test/compile-fail/regions-infer-invariance-due-to-mutability.rs b/src/test/compile-fail/regions-infer-invariance-due-to-mutability.rs index 119c28a9e84c6..fabce969b9c3f 100644 --- a/src/test/compile-fail/regions-infer-invariance-due-to-mutability.rs +++ b/src/test/compile-fail/regions-infer-invariance-due-to-mutability.rs @@ -25,4 +25,4 @@ fn to_longer_lifetime(bi: invariant/&r) -> invariant/&static { } fn main() { -} \ No newline at end of file +} diff --git a/src/test/compile-fail/regions-infer-paramd-indirect.rs b/src/test/compile-fail/regions-infer-paramd-indirect.rs index 51a8fe9ceac48..c3ce00594f4c1 100644 --- a/src/test/compile-fail/regions-infer-paramd-indirect.rs +++ b/src/test/compile-fail/regions-infer-paramd-indirect.rs @@ -20,7 +20,7 @@ trait set_f { fn set_f_bad(b: @b); } -impl c: set_f { +impl set_f for c { fn set_f_ok(b: @b/&self) { self.f = b; } diff --git a/src/test/compile-fail/regions-infer-paramd-method.rs b/src/test/compile-fail/regions-infer-paramd-method.rs index 46b809d225fb6..a75e1deb6a2a3 100644 --- a/src/test/compile-fail/regions-infer-paramd-method.rs +++ b/src/test/compile-fail/regions-infer-paramd-method.rs @@ -23,7 +23,7 @@ trait set_foo_foo { fn set_foo(f: foo); } -impl with_foo: set_foo_foo { +impl set_foo_foo for with_foo { fn set_foo(f: foo) { self.f = f; //~ ERROR mismatched types: expected `@foo/&self` but found `@foo/&` } @@ -41,7 +41,7 @@ trait set_foo_bar { fn set_foo(f: bar); } -impl with_bar: set_foo_bar { +impl set_foo_bar for with_bar { fn set_foo(f: bar) { self.f = f; } diff --git a/src/test/compile-fail/regions-infer-region-in-fn-but-not-type.rs b/src/test/compile-fail/regions-infer-region-in-fn-but-not-type.rs index 914e77bb5bb25..7b8b8daf565b4 100644 --- a/src/test/compile-fail/regions-infer-region-in-fn-but-not-type.rs +++ b/src/test/compile-fail/regions-infer-region-in-fn-but-not-type.rs @@ -16,4 +16,4 @@ enum foo = fn~(x: &int); fn take_foo(x: foo/&) {} //~ ERROR no region bound is allowed on `foo` fn main() { -} \ No newline at end of file +} diff --git a/src/test/compile-fail/regions-nested-fns-2.rs b/src/test/compile-fail/regions-nested-fns-2.rs index 63c27957215f7..ee2aea1086be3 100644 --- a/src/test/compile-fail/regions-nested-fns-2.rs +++ b/src/test/compile-fail/regions-nested-fns-2.rs @@ -18,4 +18,4 @@ fn nested() { }); } -fn main() {} \ No newline at end of file +fn main() {} diff --git a/src/test/compile-fail/regions-nested-fns.rs b/src/test/compile-fail/regions-nested-fns.rs index fa4cebcdefb5a..4d53db35596bc 100644 --- a/src/test/compile-fail/regions-nested-fns.rs +++ b/src/test/compile-fail/regions-nested-fns.rs @@ -27,4 +27,4 @@ fn nested(x: &x/int) { }); } -fn main() {} \ No newline at end of file +fn main() {} diff --git a/src/test/compile-fail/regions-out-of-scope-slice.rs b/src/test/compile-fail/regions-out-of-scope-slice.rs index 55cdf2752edf8..102ff8b3998bf 100644 --- a/src/test/compile-fail/regions-out-of-scope-slice.rs +++ b/src/test/compile-fail/regions-out-of-scope-slice.rs @@ -19,4 +19,4 @@ fn foo(cond: bool) { } } -fn main() {} \ No newline at end of file +fn main() {} diff --git a/src/test/compile-fail/regions-scoping.rs b/src/test/compile-fail/regions-scoping.rs index f999242973345..380a9a57d01fe 100644 --- a/src/test/compile-fail/regions-scoping.rs +++ b/src/test/compile-fail/regions-scoping.rs @@ -53,4 +53,4 @@ fn nested(x: &x/int) { // (1) } } -fn main() {} \ No newline at end of file +fn main() {} diff --git a/src/test/compile-fail/regions-trait-1.rs b/src/test/compile-fail/regions-trait-1.rs index 76e2244c5702b..de31c64328f92 100644 --- a/src/test/compile-fail/regions-trait-1.rs +++ b/src/test/compile-fail/regions-trait-1.rs @@ -17,7 +17,7 @@ trait get_ctxt { type has_ctxt = { c: &ctxt }; -impl has_ctxt: get_ctxt { +impl get_ctxt for has_ctxt { // Here an error occurs because we used `&self` but // the definition used `&`: diff --git a/src/test/compile-fail/regions-trait-2.rs b/src/test/compile-fail/regions-trait-2.rs index 044e656e71c41..f19417425aace 100644 --- a/src/test/compile-fail/regions-trait-2.rs +++ b/src/test/compile-fail/regions-trait-2.rs @@ -16,7 +16,7 @@ trait get_ctxt { type has_ctxt = { c: &ctxt }; -impl has_ctxt: get_ctxt { +impl get_ctxt for has_ctxt { fn get_ctxt() -> &self/ctxt { self.c } } diff --git a/src/test/compile-fail/regions-var-type-out-of-scope.rs b/src/test/compile-fail/regions-var-type-out-of-scope.rs index aad58446d0ecf..48ef79a998488 100644 --- a/src/test/compile-fail/regions-var-type-out-of-scope.rs +++ b/src/test/compile-fail/regions-var-type-out-of-scope.rs @@ -19,4 +19,4 @@ fn foo(cond: bool) { } } -fn main() {} \ No newline at end of file +fn main() {} diff --git a/src/test/compile-fail/repeat-to-run-dtor-twice.rs b/src/test/compile-fail/repeat-to-run-dtor-twice.rs index 58c07cc8ea6db..18bdb564441d3 100644 --- a/src/test/compile-fail/repeat-to-run-dtor-twice.rs +++ b/src/test/compile-fail/repeat-to-run-dtor-twice.rs @@ -16,7 +16,7 @@ struct Foo { } -impl Foo : Drop { +impl Drop for Foo { fn finalize(&self) { io::println("Goodbye!"); } diff --git a/src/test/compile-fail/reserved-be.rs b/src/test/compile-fail/reserved-be.rs index b0e8e6ae7bd12..386d53cc16e92 100644 --- a/src/test/compile-fail/reserved-be.rs +++ b/src/test/compile-fail/reserved-be.rs @@ -11,4 +11,4 @@ fn main() { let be = 0; //~^ ERROR `be` is a reserved keyword -} \ No newline at end of file +} diff --git a/src/test/compile-fail/selftype-astparam.rs b/src/test/compile-fail/selftype-astparam.rs index e3bdb97e744d8..c89d1d2795b51 100644 --- a/src/test/compile-fail/selftype-astparam.rs +++ b/src/test/compile-fail/selftype-astparam.rs @@ -12,7 +12,7 @@ trait add { fn plus(++x: Self) -> Self; } -impl int: add { +impl add for int { fn plus(++x: int) -> int { self + x } } diff --git a/src/test/compile-fail/seq-args.rs b/src/test/compile-fail/seq-args.rs index 5aec1c41d0fa4..0d253d782832a 100644 --- a/src/test/compile-fail/seq-args.rs +++ b/src/test/compile-fail/seq-args.rs @@ -12,10 +12,10 @@ extern mod std; fn main() { trait seq { } -impl ~[T]: seq { //~ ERROR wrong number of type arguments +impl seq for ~[T] { //~ ERROR wrong number of type arguments /* ... */ } -impl u32: seq { +impl seq for u32 { /* Treat the integer as a sequence of bits */ } diff --git a/src/test/compile-fail/staticness-mismatch.rs b/src/test/compile-fail/staticness-mismatch.rs index 6d02291622ed4..e67a409998798 100644 --- a/src/test/compile-fail/staticness-mismatch.rs +++ b/src/test/compile-fail/staticness-mismatch.rs @@ -13,7 +13,7 @@ trait foo { static fn bar(); } -impl int: foo { +impl foo for int { fn bar() {} //~ ERROR method `bar` is declared as static in its trait, but not in its impl } diff --git a/src/test/compile-fail/struct-fields-dupe.rs b/src/test/compile-fail/struct-fields-dupe.rs index 06cd7bf246895..ffbfecdc48c7e 100644 --- a/src/test/compile-fail/struct-fields-dupe.rs +++ b/src/test/compile-fail/struct-fields-dupe.rs @@ -17,4 +17,4 @@ fn main() { foo: 0, foo: 0 //~ ERROR field `foo` specified more than once }; -} \ No newline at end of file +} diff --git a/src/test/compile-fail/tps-invariant-class.rs b/src/test/compile-fail/tps-invariant-class.rs index ee7e52d321971..c1a0b2209711c 100644 --- a/src/test/compile-fail/tps-invariant-class.rs +++ b/src/test/compile-fail/tps-invariant-class.rs @@ -30,4 +30,4 @@ fn main() { // No error when type of parameter actually IS @const int let b = box_impl::<@const int>(@3); set_box_impl(b, @mut 5); -} \ No newline at end of file +} diff --git a/src/test/compile-fail/tps-invariant-enum.rs b/src/test/compile-fail/tps-invariant-enum.rs index fda80dc4d32c6..1514dc5fd546d 100644 --- a/src/test/compile-fail/tps-invariant-enum.rs +++ b/src/test/compile-fail/tps-invariant-enum.rs @@ -25,4 +25,4 @@ fn main() { let x: @const int = @3; // only way I could find to upcast let b = box_impl::<@const int>({mut f: x}); set_box_impl(b, @mut 5); -} \ No newline at end of file +} diff --git a/src/test/compile-fail/tps-invariant-trait.rs b/src/test/compile-fail/tps-invariant-trait.rs index 94c17fa1602a6..f2e030b259ed5 100644 --- a/src/test/compile-fail/tps-invariant-trait.rs +++ b/src/test/compile-fail/tps-invariant-trait.rs @@ -17,7 +17,7 @@ enum box_impl = { mut f: T }; -impl box_impl: box_trait { +impl box_trait for box_impl { fn get() -> T { return self.f; } fn set(t: T) { self.f = t; } } @@ -36,4 +36,4 @@ fn main() { //~^ ERROR values differ in mutability set_box_impl(b, @mut 5); //~^ ERROR values differ in mutability -} \ No newline at end of file +} diff --git a/src/test/compile-fail/trait-impl-can-not-have-untraitful-methods.rs b/src/test/compile-fail/trait-impl-can-not-have-untraitful-methods.rs index 41277974cbfcf..a20186c362b10 100644 --- a/src/test/compile-fail/trait-impl-can-not-have-untraitful-methods.rs +++ b/src/test/compile-fail/trait-impl-can-not-have-untraitful-methods.rs @@ -10,8 +10,8 @@ trait A { } -impl int: A { +impl A for int { fn foo() { } //~ ERROR method `foo` is not a member of trait `A` } -fn main() { } \ No newline at end of file +fn main() { } 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 8ff4188d4b6e0..f32793ad1e45a 100644 --- a/src/test/compile-fail/trait-impl-different-num-params.rs +++ b/src/test/compile-fail/trait-impl-different-num-params.rs @@ -11,7 +11,7 @@ trait foo { fn bar(x: uint) -> Self; } -impl int: foo { +impl foo for int { fn bar() -> int { //~^ ERROR method `bar` has 0 parameters but the trait has 1 self diff --git a/src/test/compile-fail/trait-impl-method-mismatch.rs b/src/test/compile-fail/trait-impl-method-mismatch.rs index 5509ad42a7069..6931e680e08f2 100644 --- a/src/test/compile-fail/trait-impl-method-mismatch.rs +++ b/src/test/compile-fail/trait-impl-method-mismatch.rs @@ -14,7 +14,7 @@ trait Mumbo { fn jbmbo(&self) -> @uint; } -impl uint: Mumbo { +impl Mumbo for uint { // Cannot have a larger effect than the trait: fn jumbo(&self, x: @uint) { *self + *x; } //~^ ERROR expected pure fn but found impure fn diff --git a/src/test/compile-fail/trait-impl-subtype.rs b/src/test/compile-fail/trait-impl-subtype.rs index b138cb88f0fae..eb34ebbdfb0d8 100644 --- a/src/test/compile-fail/trait-impl-subtype.rs +++ b/src/test/compile-fail/trait-impl-subtype.rs @@ -12,7 +12,7 @@ trait Mumbo { fn jumbo(&self, x: @uint) -> uint; } -impl uint: Mumbo { +impl Mumbo for uint { // Note: this method def is ok, it is more accepting and // less effecting than the trait method: pure fn jumbo(&self, x: @const uint) -> uint { *self + *x } diff --git a/src/test/compile-fail/trait-inheritance-missing-requirement.rs b/src/test/compile-fail/trait-inheritance-missing-requirement.rs index 37d1e02b8a992..a341c24261135 100644 --- a/src/test/compile-fail/trait-inheritance-missing-requirement.rs +++ b/src/test/compile-fail/trait-inheritance-missing-requirement.rs @@ -24,7 +24,7 @@ struct A { } // Can't implement Bar without an impl of Foo -impl A : Bar { +impl Bar for A { fn g() { } } diff --git a/src/test/compile-fail/trait-keyword.rs b/src/test/compile-fail/trait-keyword.rs index db85c89f93327..e60be6c81eb58 100644 --- a/src/test/compile-fail/trait-keyword.rs +++ b/src/test/compile-fail/trait-keyword.rs @@ -10,4 +10,4 @@ iface foo { } //~ ERROR iface -fn main() {} \ No newline at end of file +fn main() {} diff --git a/src/test/compile-fail/trait-test-2.rs b/src/test/compile-fail/trait-test-2.rs index cabcbff115454..73b7c4369ac8e 100644 --- a/src/test/compile-fail/trait-test-2.rs +++ b/src/test/compile-fail/trait-test-2.rs @@ -9,8 +9,8 @@ // except according to those terms. trait bar { fn dup() -> Self; fn blah(); } -impl int: bar { fn dup() -> int { self } fn blah() {} } -impl uint: bar { fn dup() -> uint { self } fn blah() {} } +impl bar for int { fn dup() -> int { self } fn blah() {} } +impl bar for uint { fn dup() -> uint { self } fn blah() {} } fn main() { 10i.dup::(); //~ ERROR does not take type parameters diff --git a/src/test/compile-fail/trait-test.rs b/src/test/compile-fail/trait-test.rs index 9bc2abe076ce2..cd92801fb4d28 100644 --- a/src/test/compile-fail/trait-test.rs +++ b/src/test/compile-fail/trait-test.rs @@ -10,6 +10,6 @@ trait foo { fn foo(); } -impl uint: int { fn foo() {} } //~ ERROR trait +impl int for uint { fn foo() {} } //~ ERROR trait fn main() {} diff --git a/src/test/compile-fail/tutorial-suffix-inference-test.rs b/src/test/compile-fail/tutorial-suffix-inference-test.rs index b890ce205be31..c68af84b95be0 100644 --- a/src/test/compile-fail/tutorial-suffix-inference-test.rs +++ b/src/test/compile-fail/tutorial-suffix-inference-test.rs @@ -29,4 +29,4 @@ fn main() { identity_u16(a); //~^ ERROR mismatched types: expected `u16` but found `int` -} \ No newline at end of file +} diff --git a/src/test/compile-fail/unique-mut.rs b/src/test/compile-fail/unique-mut.rs index 44c30eebe6695..a3a197505a340 100644 --- a/src/test/compile-fail/unique-mut.rs +++ b/src/test/compile-fail/unique-mut.rs @@ -11,4 +11,4 @@ //error-pattern:mismatched types fn main() { let i: ~int = ~mut 0; -} \ No newline at end of file +} diff --git a/src/test/compile-fail/unique-object-noncopyable.rs b/src/test/compile-fail/unique-object-noncopyable.rs index 010161181f53e..edc8a47822d72 100644 --- a/src/test/compile-fail/unique-object-noncopyable.rs +++ b/src/test/compile-fail/unique-object-noncopyable.rs @@ -16,11 +16,11 @@ struct Bar { x: int, } -impl Bar : Drop { +impl Drop for Bar { fn finalize(&self) {} } -impl Bar : Foo { +impl Foo for Bar { fn f(&self) { io::println("hi"); } diff --git a/src/test/compile-fail/unique-pinned-nocopy.rs b/src/test/compile-fail/unique-pinned-nocopy.rs index 0211fd3c01166..1eebc7701328c 100644 --- a/src/test/compile-fail/unique-pinned-nocopy.rs +++ b/src/test/compile-fail/unique-pinned-nocopy.rs @@ -12,7 +12,7 @@ struct r { b:bool, } -impl r : Drop { +impl Drop for r { fn finalize(&self) {} } diff --git a/src/test/compile-fail/unique-vec-res.rs b/src/test/compile-fail/unique-vec-res.rs index a97f47551e1dd..28a7b37d6e20b 100644 --- a/src/test/compile-fail/unique-vec-res.rs +++ b/src/test/compile-fail/unique-vec-res.rs @@ -12,7 +12,7 @@ struct r { i: @mut int, } -impl r : Drop { +impl Drop for r { fn finalize(&self) { *(self.i) = *(self.i) + 1; } diff --git a/src/test/compile-fail/unreachable-code.rs b/src/test/compile-fail/unreachable-code.rs index c91bfe9163018..8ddd934f5804d 100644 --- a/src/test/compile-fail/unreachable-code.rs +++ b/src/test/compile-fail/unreachable-code.rs @@ -13,4 +13,4 @@ fn main() { loop{} // red herring to make sure compilation fails log(error, 42 == 'c'); -} \ No newline at end of file +} diff --git a/src/test/compile-fail/vec-concat-bug.rs b/src/test/compile-fail/vec-concat-bug.rs index 42db7b9283806..f9ad20eaeb9b4 100644 --- a/src/test/compile-fail/vec-concat-bug.rs +++ b/src/test/compile-fail/vec-concat-bug.rs @@ -20,4 +20,4 @@ fn concat(v: ~[const ~[const T]]) -> ~[T] { return r; } -fn main() {} \ No newline at end of file +fn main() {} diff --git a/src/test/compile-fail/vec-res-add.rs b/src/test/compile-fail/vec-res-add.rs index feaceea37288c..f21a202dcd82b 100644 --- a/src/test/compile-fail/vec-res-add.rs +++ b/src/test/compile-fail/vec-res-add.rs @@ -16,7 +16,7 @@ struct r { fn r(i:int) -> r { r { i: i } } -impl r : Drop { +impl Drop for r { fn finalize(&self) {} } diff --git a/src/test/compile-fail/vtable-res-trait-param.rs b/src/test/compile-fail/vtable-res-trait-param.rs index d00e7fff0769a..7b48eca3dbe23 100644 --- a/src/test/compile-fail/vtable-res-trait-param.rs +++ b/src/test/compile-fail/vtable-res-trait-param.rs @@ -16,7 +16,7 @@ trait TraitB { fn gimme_an_a(a: A) -> int; } -impl int: TraitB { +impl TraitB for int { fn gimme_an_a(a: A) -> int { a.method_a() + self } diff --git a/src/test/compile-fail/warn-path-statement.rs b/src/test/compile-fail/warn-path-statement.rs index 5e67afcc2b2e6..90515807ac6cc 100644 --- a/src/test/compile-fail/warn-path-statement.rs +++ b/src/test/compile-fail/warn-path-statement.rs @@ -13,4 +13,4 @@ fn main() { let x = 10; x; //~ ERROR path statement with no effect -} \ No newline at end of file +} diff --git a/src/test/run-fail/die-macro-expr.rs b/src/test/run-fail/die-macro-expr.rs index 26d5ea4349de6..06365ed989a64 100644 --- a/src/test/run-fail/die-macro-expr.rs +++ b/src/test/run-fail/die-macro-expr.rs @@ -2,4 +2,4 @@ fn main() { let i: int = fail!(~"test"); -} \ No newline at end of file +} diff --git a/src/test/run-fail/die-macro-pure.rs b/src/test/run-fail/die-macro-pure.rs index 74de57a8a25a4..4479c2ecbeb35 100644 --- a/src/test/run-fail/die-macro-pure.rs +++ b/src/test/run-fail/die-macro-pure.rs @@ -6,4 +6,4 @@ pure fn f() { fn main() { f(); -} \ No newline at end of file +} diff --git a/src/test/run-fail/die-macro.rs b/src/test/run-fail/die-macro.rs index 6eb56a5be4e59..3fa3d69441a62 100644 --- a/src/test/run-fail/die-macro.rs +++ b/src/test/run-fail/die-macro.rs @@ -2,4 +2,4 @@ fn main() { fail!(~"test"); -} \ No newline at end of file +} diff --git a/src/test/run-fail/issue-2061.rs b/src/test/run-fail/issue-2061.rs index e4355c7e02f35..cee3546acfa89 100644 --- a/src/test/run-fail/issue-2061.rs +++ b/src/test/run-fail/issue-2061.rs @@ -14,7 +14,7 @@ struct R { b: int, } -impl R : Drop { +impl Drop for R { fn finalize(&self) { let _y = R { b: self.b }; } diff --git a/src/test/run-fail/linked-failure4.rs b/src/test/run-fail/linked-failure4.rs index 23ddc7573197f..18d6b3c369bc1 100644 --- a/src/test/run-fail/linked-failure4.rs +++ b/src/test/run-fail/linked-failure4.rs @@ -29,4 +29,4 @@ fn sleeper() { fn main() { task::spawn(|| sleeper() ); task::spawn(|| parent() ); -} \ No newline at end of file +} diff --git a/src/test/run-fail/morestack2.rs b/src/test/run-fail/morestack2.rs index d5f438385986d..acd4fbad6e4cf 100644 --- a/src/test/run-fail/morestack2.rs +++ b/src/test/run-fail/morestack2.rs @@ -36,7 +36,7 @@ struct and_then_get_big_again { x:int, } -impl and_then_get_big_again : Drop { +impl Drop for and_then_get_big_again { fn finalize(&self) { fn getbig(i: int) { if i != 0 { diff --git a/src/test/run-fail/morestack3.rs b/src/test/run-fail/morestack3.rs index e97e56ea0f9e2..14fc40a43cc9a 100644 --- a/src/test/run-fail/morestack3.rs +++ b/src/test/run-fail/morestack3.rs @@ -27,7 +27,7 @@ struct and_then_get_big_again { x:int, } -impl and_then_get_big_again : Drop { +impl Drop for and_then_get_big_again { fn finalize(&self) { fn getbig(i: int) { if i != 0 { diff --git a/src/test/run-fail/morestack4.rs b/src/test/run-fail/morestack4.rs index 30e9147cff7e8..e45853937037e 100644 --- a/src/test/run-fail/morestack4.rs +++ b/src/test/run-fail/morestack4.rs @@ -27,7 +27,7 @@ struct and_then_get_big_again { x:int, } -impl and_then_get_big_again : Drop { +impl Drop for and_then_get_big_again { fn finalize(&self) {} } diff --git a/src/test/run-fail/rt-set-exit-status-fail2.rs b/src/test/run-fail/rt-set-exit-status-fail2.rs index e936270d4b865..78de5c3b847d7 100644 --- a/src/test/run-fail/rt-set-exit-status-fail2.rs +++ b/src/test/run-fail/rt-set-exit-status-fail2.rs @@ -17,7 +17,7 @@ struct r { // Setting the exit status after the runtime has already // failed has no effect and the process exits with the // runtime's exit code -impl r : Drop { +impl Drop for r { fn finalize(&self) { os::set_exit_status(50); } diff --git a/src/test/run-fail/rt-set-exit-status.rs b/src/test/run-fail/rt-set-exit-status.rs index 76d311cf055bc..b20eb222025aa 100644 --- a/src/test/run-fail/rt-set-exit-status.rs +++ b/src/test/run-fail/rt-set-exit-status.rs @@ -15,4 +15,4 @@ fn main() { // 101 is the code the runtime uses on task failure and the value // compiletest expects run-fail tests to return. os::set_exit_status(101); -} \ No newline at end of file +} diff --git a/src/test/run-fail/too-much-recursion.rs b/src/test/run-fail/too-much-recursion.rs index 0af0cdf4a20e6..009dee8cb7c67 100644 --- a/src/test/run-fail/too-much-recursion.rs +++ b/src/test/run-fail/too-much-recursion.rs @@ -15,4 +15,4 @@ fn main() { log(debug, ~"don't optimize me out"); main(); -} \ No newline at end of file +} diff --git a/src/test/run-fail/unwind-assert.rs b/src/test/run-fail/unwind-assert.rs index 8e0fb37561e3a..1efff172d7c25 100644 --- a/src/test/run-fail/unwind-assert.rs +++ b/src/test/run-fail/unwind-assert.rs @@ -13,4 +13,4 @@ fn main() { let a = @0; assert false; -} \ No newline at end of file +} diff --git a/src/test/run-fail/unwind-box-res.rs b/src/test/run-fail/unwind-box-res.rs index 920ddbb5bf24c..f544438a7cae1 100644 --- a/src/test/run-fail/unwind-box-res.rs +++ b/src/test/run-fail/unwind-box-res.rs @@ -18,7 +18,7 @@ struct r { v: *int, } -impl r : Drop { +impl Drop for r { fn finalize(&self) { unsafe { let _v2: ~int = cast::reinterpret_cast(&self.v); diff --git a/src/test/run-fail/unwind-box-trait.rs b/src/test/run-fail/unwind-box-trait.rs index 1602964b481e7..b17fc467f0b1a 100644 --- a/src/test/run-fail/unwind-box-trait.rs +++ b/src/test/run-fail/unwind-box-trait.rs @@ -18,7 +18,7 @@ trait i { fn foo(); } -impl ~int: i { +impl i for ~int { fn foo() { } } diff --git a/src/test/run-fail/unwind-resource-fail3.rs b/src/test/run-fail/unwind-resource-fail3.rs index 514c780da0969..27e0ebe77614f 100644 --- a/src/test/run-fail/unwind-resource-fail3.rs +++ b/src/test/run-fail/unwind-resource-fail3.rs @@ -17,7 +17,7 @@ struct faily_box { fn faily_box(i: @int) -> faily_box { faily_box { i: i } } -impl faily_box : Drop { +impl Drop for faily_box { fn finalize(&self) { fail!(~"quux"); } diff --git a/src/test/run-pass-fulldeps/qquote.rs b/src/test/run-pass-fulldeps/qquote.rs index 5a82d0104383b..57b45575b3e63 100644 --- a/src/test/run-pass-fulldeps/qquote.rs +++ b/src/test/run-pass-fulldeps/qquote.rs @@ -34,7 +34,7 @@ trait fake_ext_ctxt { type fake_session = parse::parse_sess; -impl fake_session: fake_ext_ctxt { +impl fake_ext_ctxt for fake_session { fn cfg() -> ast::crate_cfg { ~[] } fn parse_sess() -> parse::parse_sess { self } fn call_site() -> span { diff --git a/src/test/run-pass/alignment-gep-tup-like-1.rs b/src/test/run-pass/alignment-gep-tup-like-1.rs index 64cc58c2af5ef..350132c15b829 100644 --- a/src/test/run-pass/alignment-gep-tup-like-1.rs +++ b/src/test/run-pass/alignment-gep-tup-like-1.rs @@ -21,4 +21,4 @@ pub fn main() { debug!("a=%? b=%?", a, b); assert a == 22u64; assert b == 44u16; -} \ No newline at end of file +} diff --git a/src/test/run-pass/alignment-gep-tup-like-2.rs b/src/test/run-pass/alignment-gep-tup-like-2.rs index 01dcd6a364740..e16fae776f7e9 100644 --- a/src/test/run-pass/alignment-gep-tup-like-2.rs +++ b/src/test/run-pass/alignment-gep-tup-like-2.rs @@ -36,4 +36,4 @@ pub fn main() { debug!("a=%u b=%u", *a as uint, b as uint); assert *a == x; assert b == y; -} \ No newline at end of file +} diff --git a/src/test/run-pass/alt-value-binding-in-guard-3291.rs b/src/test/run-pass/alt-value-binding-in-guard-3291.rs index 460e8873a17ea..5171d7d2a58a6 100644 --- a/src/test/run-pass/alt-value-binding-in-guard-3291.rs +++ b/src/test/run-pass/alt-value-binding-in-guard-3291.rs @@ -21,4 +21,4 @@ pub fn main() { foo(Some(~22), false); foo(None, true); foo(None, false); -} \ No newline at end of file +} diff --git a/src/test/run-pass/assignability-trait.rs b/src/test/run-pass/assignability-trait.rs index d0dc2638ee593..85efaa8aed225 100644 --- a/src/test/run-pass/assignability-trait.rs +++ b/src/test/run-pass/assignability-trait.rs @@ -16,7 +16,7 @@ trait iterable { fn iterate(blk: fn(x: &A) -> bool); } -impl &[A]: iterable { +impl iterable for &[A] { fn iterate(f: fn(x: &A) -> bool) { for vec::each(self) |e| { if !f(e) { break; } @@ -24,7 +24,7 @@ impl &[A]: iterable { } } -impl ~[A]: iterable { +impl iterable for ~[A] { fn iterate(f: fn(x: &A) -> bool) { for vec::each(self) |e| { if !f(e) { break; } diff --git a/src/test/run-pass/auto-encode.rs b/src/test/run-pass/auto-encode.rs index 316f5ed195035..53c572e75d099 100644 --- a/src/test/run-pass/auto-encode.rs +++ b/src/test/run-pass/auto-encode.rs @@ -59,7 +59,7 @@ enum Expr { Minus(@Expr, @Expr) } -impl Expr : cmp::Eq { +impl cmp::Eq for Expr { pure fn eq(&self, other: &Expr) -> bool { match *self { Val(e0a) => { @@ -85,21 +85,21 @@ impl Expr : cmp::Eq { pure fn ne(&self, other: &Expr) -> bool { !(*self).eq(other) } } -impl AnEnum : cmp::Eq { +impl cmp::Eq for AnEnum { pure fn eq(&self, other: &AnEnum) -> bool { (*self).v == other.v } pure fn ne(&self, other: &AnEnum) -> bool { !(*self).eq(other) } } -impl Point : cmp::Eq { +impl cmp::Eq for Point { pure fn eq(&self, other: &Point) -> bool { self.x == other.x && self.y == other.y } pure fn ne(&self, other: &Point) -> bool { !(*self).eq(other) } } -impl Quark : cmp::Eq { +impl cmp::Eq for Quark { pure fn eq(&self, other: &Quark) -> bool { match *self { Top(ref q) => { @@ -119,7 +119,7 @@ impl Quark : cmp::Eq { pure fn ne(&self, other: &Quark) -> bool { !(*self).eq(other) } } -impl CLike : cmp::Eq { +impl cmp::Eq for CLike { pure fn eq(&self, other: &CLike) -> bool { (*self) as int == *other as int } diff --git a/src/test/run-pass/auto-ref-bounded-ty-param.rs b/src/test/run-pass/auto-ref-bounded-ty-param.rs index 4b943e62fd20f..08c936f2bb66e 100644 --- a/src/test/run-pass/auto-ref-bounded-ty-param.rs +++ b/src/test/run-pass/auto-ref-bounded-ty-param.rs @@ -20,13 +20,13 @@ trait Baz { fn g(&self); } -impl T : Foo { +impl Foo for T { fn f(&self) { self.g(); } } -impl Bar : Baz { +impl Baz for Bar { fn g(&self) { io::println(self.x.to_str()); } diff --git a/src/test/run-pass/auto-ref-slice-plus-ref.rs b/src/test/run-pass/auto-ref-slice-plus-ref.rs index 7c284bd820276..e792930889792 100644 --- a/src/test/run-pass/auto-ref-slice-plus-ref.rs +++ b/src/test/run-pass/auto-ref-slice-plus-ref.rs @@ -16,12 +16,12 @@ trait MyIter { pure fn test_const(&const self); } -impl &[int]: MyIter { +impl MyIter for &[int] { pure fn test_imm(&self) { assert self[0] == 1 } pure fn test_const(&const self) { assert self[0] == 1 } } -impl &str: MyIter { +impl MyIter for &str { pure fn test_imm(&self) { assert *self == "test" } pure fn test_const(&const self) { assert *self == "test" } } diff --git a/src/test/run-pass/auto-ref-sliceable.rs b/src/test/run-pass/auto-ref-sliceable.rs index 8423ea8c2d80d..23165d026e812 100644 --- a/src/test/run-pass/auto-ref-sliceable.rs +++ b/src/test/run-pass/auto-ref-sliceable.rs @@ -12,7 +12,7 @@ trait Pushable { fn push_val(&mut self, +t: T); } -impl ~[T]: Pushable { +impl Pushable for ~[T] { fn push_val(&mut self, +t: T) { self.push(move t); } @@ -23,4 +23,4 @@ pub fn main() { v.push_val(2); v.push_val(3); assert v == ~[1, 2, 3]; -} \ No newline at end of file +} diff --git a/src/test/run-pass/auto-ref.rs b/src/test/run-pass/auto-ref.rs index f3a1c824f80c5..ec5a17ffc54e4 100644 --- a/src/test/run-pass/auto-ref.rs +++ b/src/test/run-pass/auto-ref.rs @@ -16,7 +16,7 @@ trait Stuff { fn printme(); } -impl &Foo : Stuff { +impl Stuff for &Foo { fn printme() { io::println(fmt!("%d", self.x)); } diff --git a/src/test/run-pass/autoderef-method-newtype.rs b/src/test/run-pass/autoderef-method-newtype.rs index cc45c75968cff..5eb4d6dcaf37b 100644 --- a/src/test/run-pass/autoderef-method-newtype.rs +++ b/src/test/run-pass/autoderef-method-newtype.rs @@ -12,7 +12,7 @@ trait double { fn double() -> uint; } -impl uint: double { +impl double for uint { fn double() -> uint { self * 2u } } diff --git a/src/test/run-pass/autoderef-method-on-trait-monomorphized.rs b/src/test/run-pass/autoderef-method-on-trait-monomorphized.rs index d3377d196a4a8..53dd6f942e860 100644 --- a/src/test/run-pass/autoderef-method-on-trait-monomorphized.rs +++ b/src/test/run-pass/autoderef-method-on-trait-monomorphized.rs @@ -12,7 +12,7 @@ trait double { fn double() -> uint; } -impl uint: double { +impl double for uint { fn double() -> uint { self * 2u } } diff --git a/src/test/run-pass/autoderef-method-on-trait.rs b/src/test/run-pass/autoderef-method-on-trait.rs index 0071cc5923a1c..3653c0eb9c95a 100644 --- a/src/test/run-pass/autoderef-method-on-trait.rs +++ b/src/test/run-pass/autoderef-method-on-trait.rs @@ -12,7 +12,7 @@ trait double { fn double() -> uint; } -impl uint: double { +impl double for uint { fn double() -> uint { self * 2u } } diff --git a/src/test/run-pass/autoderef-method-priority.rs b/src/test/run-pass/autoderef-method-priority.rs index aa487a529660a..be028a789c9b6 100644 --- a/src/test/run-pass/autoderef-method-priority.rs +++ b/src/test/run-pass/autoderef-method-priority.rs @@ -12,11 +12,11 @@ trait double { fn double() -> uint; } -impl uint: double { +impl double for uint { fn double() -> uint { self } } -impl @uint: double { +impl double for @uint { fn double() -> uint { *self * 2u } } 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 cab69a243d4f2..52f7a0ba72ebf 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 @@ -12,7 +12,7 @@ trait double { fn double() -> uint; } -impl @@uint: double { +impl double for @@uint { fn double() -> uint { **self * 2u } } diff --git a/src/test/run-pass/autoderef-method-twice.rs b/src/test/run-pass/autoderef-method-twice.rs index 5b307478887db..1a8d550e9e7b7 100644 --- a/src/test/run-pass/autoderef-method-twice.rs +++ b/src/test/run-pass/autoderef-method-twice.rs @@ -12,7 +12,7 @@ trait double { fn double() -> uint; } -impl uint: double { +impl double for uint { fn double() -> uint { self * 2u } } diff --git a/src/test/run-pass/autoderef-method.rs b/src/test/run-pass/autoderef-method.rs index 66372654701b7..1e61f194354a7 100644 --- a/src/test/run-pass/autoderef-method.rs +++ b/src/test/run-pass/autoderef-method.rs @@ -12,7 +12,7 @@ trait double { fn double() -> uint; } -impl uint: double { +impl double for uint { fn double() -> uint { self * 2u } } diff --git a/src/test/run-pass/autoref-intermediate-types-issue-3585.rs b/src/test/run-pass/autoref-intermediate-types-issue-3585.rs index 1d7aa862a2a40..60f19b4db0a7d 100644 --- a/src/test/run-pass/autoref-intermediate-types-issue-3585.rs +++ b/src/test/run-pass/autoref-intermediate-types-issue-3585.rs @@ -12,13 +12,13 @@ trait Foo { fn foo(&self) -> ~str; } -impl @T: Foo { +impl Foo for @T { fn foo(&self) -> ~str { fmt!("@%s", (**self).foo()) } } -impl uint: Foo { +impl Foo for uint { fn foo(&self) -> ~str { fmt!("%u", *self) } @@ -27,4 +27,4 @@ impl uint: Foo { pub fn main() { let x = @3u; assert x.foo() == ~"@3"; -} \ No newline at end of file +} diff --git a/src/test/run-pass/big-literals.rs b/src/test/run-pass/big-literals.rs index 338c264b65b70..4a4f6c9bce7cf 100644 --- a/src/test/run-pass/big-literals.rs +++ b/src/test/run-pass/big-literals.rs @@ -16,4 +16,4 @@ pub fn main() { assert -2147483648i32 - 1i32 == 2147483647i32; assert -9223372036854775808i64 - 1i64 == 9223372036854775807i64; -} \ No newline at end of file +} diff --git a/src/test/run-pass/binops.rs b/src/test/run-pass/binops.rs index d27ca86c26ae2..99379813840ff 100644 --- a/src/test/run-pass/binops.rs +++ b/src/test/run-pass/binops.rs @@ -98,7 +98,7 @@ fn p(x: int, y: int) -> p { } } -impl p : cmp::Eq { +impl cmp::Eq for p { pure fn eq(&self, other: &p) -> bool { (*self).x == (*other).x && (*self).y == (*other).y } diff --git a/src/test/run-pass/borrow-by-val-method-receiver.rs b/src/test/run-pass/borrow-by-val-method-receiver.rs index daed89033fca0..c2b19d2ce35b8 100644 --- a/src/test/run-pass/borrow-by-val-method-receiver.rs +++ b/src/test/run-pass/borrow-by-val-method-receiver.rs @@ -12,7 +12,7 @@ trait Foo { fn foo(self); } -impl &[int]: Foo { +impl Foo for &[int] { fn foo(self) {} } diff --git a/src/test/run-pass/borrowck-borrow-from-at-vec.rs b/src/test/run-pass/borrowck-borrow-from-at-vec.rs index 88c06476243a2..0b15adb82bf03 100644 --- a/src/test/run-pass/borrowck-borrow-from-at-vec.rs +++ b/src/test/run-pass/borrowck-borrow-from-at-vec.rs @@ -17,4 +17,4 @@ fn sum_slice(x: &[int]) -> int { pub fn main() { let x = @[1, 2, 3]; assert sum_slice(x) == 6; -} \ No newline at end of file +} diff --git a/src/test/run-pass/borrowck-move-from-unsafe-ptr-ok.rs b/src/test/run-pass/borrowck-move-from-unsafe-ptr-ok.rs index 8db3bdd5e64fd..b54791328a0cb 100644 --- a/src/test/run-pass/borrowck-move-from-unsafe-ptr-ok.rs +++ b/src/test/run-pass/borrowck-move-from-unsafe-ptr-ok.rs @@ -18,4 +18,4 @@ fn bar(x: *~int) -> ~int { } pub fn main() { -} \ No newline at end of file +} diff --git a/src/test/run-pass/borrowck-mut-vec-as-imm-slice.rs b/src/test/run-pass/borrowck-mut-vec-as-imm-slice.rs index 9126a327d861d..62e58412a7303 100644 --- a/src/test/run-pass/borrowck-mut-vec-as-imm-slice.rs +++ b/src/test/run-pass/borrowck-mut-vec-as-imm-slice.rs @@ -20,4 +20,4 @@ fn has_mut_vec(+v: ~[int]) -> int { pub fn main() { assert has_mut_vec(~[1, 2, 3]) == 6; -} \ No newline at end of file +} diff --git a/src/test/run-pass/borrowck-newtype-issue-2573.rs b/src/test/run-pass/borrowck-newtype-issue-2573.rs index 88ddf4e081adc..5dc373aa50fef 100644 --- a/src/test/run-pass/borrowck-newtype-issue-2573.rs +++ b/src/test/run-pass/borrowck-newtype-issue-2573.rs @@ -16,7 +16,7 @@ trait frob { fn frob(); } -impl foo: frob { +impl frob for foo { fn frob() { really_impure(self.bar); } diff --git a/src/test/run-pass/borrowck-preserve-box-in-field.rs b/src/test/run-pass/borrowck-preserve-box-in-field.rs index 482673f9184a6..5cea4129857d5 100644 --- a/src/test/run-pass/borrowck-preserve-box-in-field.rs +++ b/src/test/run-pass/borrowck-preserve-box-in-field.rs @@ -30,4 +30,4 @@ pub fn main() { assert *b_x == 3; assert ptr::addr_of(&(*x.f)) != ptr::addr_of(&(*b_x)); } -} \ No newline at end of file +} diff --git a/src/test/run-pass/borrowck-preserve-box-in-uniq.rs b/src/test/run-pass/borrowck-preserve-box-in-uniq.rs index 3f5708a893033..9724717f2d580 100644 --- a/src/test/run-pass/borrowck-preserve-box-in-uniq.rs +++ b/src/test/run-pass/borrowck-preserve-box-in-uniq.rs @@ -30,4 +30,4 @@ pub fn main() { assert *b_x == 3; assert ptr::addr_of(&(*x.f)) != ptr::addr_of(&(*b_x)); } -} \ No newline at end of file +} diff --git a/src/test/run-pass/borrowck-preserve-box-sometimes-needed.rs b/src/test/run-pass/borrowck-preserve-box-sometimes-needed.rs index b4b5a622408c2..a0f1801ce29a9 100644 --- a/src/test/run-pass/borrowck-preserve-box-sometimes-needed.rs +++ b/src/test/run-pass/borrowck-preserve-box-sometimes-needed.rs @@ -21,4 +21,4 @@ fn switcher(x: Option<@int>) { pub fn main() { switcher(None); switcher(Some(@3)); -} \ No newline at end of file +} diff --git a/src/test/run-pass/borrowck-preserve-box.rs b/src/test/run-pass/borrowck-preserve-box.rs index 37c598f01a710..70f26d12dcd70 100644 --- a/src/test/run-pass/borrowck-preserve-box.rs +++ b/src/test/run-pass/borrowck-preserve-box.rs @@ -28,4 +28,4 @@ pub fn main() { assert *b_x == 3; assert ptr::addr_of(&(*x)) != ptr::addr_of(&(*b_x)); } -} \ No newline at end of file +} diff --git a/src/test/run-pass/borrowck-preserve-cond-box.rs b/src/test/run-pass/borrowck-preserve-cond-box.rs index 490db9c47f728..ca785558be3a7 100644 --- a/src/test/run-pass/borrowck-preserve-cond-box.rs +++ b/src/test/run-pass/borrowck-preserve-cond-box.rs @@ -37,4 +37,4 @@ fn testfn(cond: bool) { pub fn main() { testfn(true); testfn(false); -} \ No newline at end of file +} diff --git a/src/test/run-pass/borrowck-univariant-enum.rs b/src/test/run-pass/borrowck-univariant-enum.rs index 531c49b82d76a..530870191f50a 100644 --- a/src/test/run-pass/borrowck-univariant-enum.rs +++ b/src/test/run-pass/borrowck-univariant-enum.rs @@ -26,4 +26,4 @@ pub fn main() { } }; assert z == 18; -} \ No newline at end of file +} diff --git a/src/test/run-pass/borrowed-ptr-pattern-option.rs b/src/test/run-pass/borrowed-ptr-pattern-option.rs index f709448d43149..5fcc2ca6b4772 100644 --- a/src/test/run-pass/borrowed-ptr-pattern-option.rs +++ b/src/test/run-pass/borrowed-ptr-pattern-option.rs @@ -20,4 +20,4 @@ pub fn main() { let x = None; let y = Some(3); assert select(&x, &y).get() == 3; -} \ No newline at end of file +} diff --git a/src/test/run-pass/boxed-trait-with-vstore.rs b/src/test/run-pass/boxed-trait-with-vstore.rs index 1347430e4a079..50e137d6fd540 100644 --- a/src/test/run-pass/boxed-trait-with-vstore.rs +++ b/src/test/run-pass/boxed-trait-with-vstore.rs @@ -12,7 +12,7 @@ trait Foo { fn foo(); } -impl int : Foo { +impl Foo for int { fn foo() { io::println("Hello world!"); } diff --git a/src/test/run-pass/cast-region-to-uint.rs b/src/test/run-pass/cast-region-to-uint.rs index bd099f45e49bb..81fa3d6538c44 100644 --- a/src/test/run-pass/cast-region-to-uint.rs +++ b/src/test/run-pass/cast-region-to-uint.rs @@ -11,4 +11,4 @@ pub fn main() { let x = 3; debug!("&x=%x", ptr::to_uint(&x)); -} \ No newline at end of file +} diff --git a/src/test/run-pass/cfg-family.rs b/src/test/run-pass/cfg-family.rs index d3a8dd53014fc..24120b69c7f0c 100644 --- a/src/test/run-pass/cfg-family.rs +++ b/src/test/run-pass/cfg-family.rs @@ -14,4 +14,4 @@ pub fn main() { #[cfg(unix)] pub fn main() { -} \ No newline at end of file +} diff --git a/src/test/run-pass/cfg-target-family.rs b/src/test/run-pass/cfg-target-family.rs index ddf58d310cfe9..784c9326a0186 100644 --- a/src/test/run-pass/cfg-target-family.rs +++ b/src/test/run-pass/cfg-target-family.rs @@ -14,4 +14,4 @@ pub fn main() { #[cfg(target_family = "unix")] pub fn main() { -} \ No newline at end of file +} diff --git a/src/test/run-pass/class-attributes-2.rs b/src/test/run-pass/class-attributes-2.rs index 471f830c3e217..8636699c48251 100644 --- a/src/test/run-pass/class-attributes-2.rs +++ b/src/test/run-pass/class-attributes-2.rs @@ -12,7 +12,7 @@ struct cat { name: ~str, } -impl cat : Drop { +impl Drop for cat { #[cat_dropper] /** Actually, cats don't always land on their feet when you drop them. diff --git a/src/test/run-pass/class-cast-to-trait-multiple-types.rs b/src/test/run-pass/class-cast-to-trait-multiple-types.rs index 2f7ede7e59e5a..b72a8e5da2710 100644 --- a/src/test/run-pass/class-cast-to-trait-multiple-types.rs +++ b/src/test/run-pass/class-cast-to-trait-multiple-types.rs @@ -33,7 +33,7 @@ impl dog { } } -impl dog : noisy { +impl noisy for dog { fn speak() -> int { self.bark() } } @@ -51,7 +51,7 @@ struct cat { name : ~str, } -impl cat : noisy { +impl noisy for cat { fn speak() -> int { self.meow() as int } } diff --git a/src/test/run-pass/class-cast-to-trait.rs b/src/test/run-pass/class-cast-to-trait.rs index 014b5441cc2ce..cb2e56d7f6e1a 100644 --- a/src/test/run-pass/class-cast-to-trait.rs +++ b/src/test/run-pass/class-cast-to-trait.rs @@ -18,7 +18,7 @@ struct cat { name : ~str, } -impl cat : noisy { +impl noisy for cat { fn speak() { self.meow(); } } @@ -58,4 +58,4 @@ fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat { pub fn main() { let nyan : noisy = cat(0u, 2, ~"nyan") as noisy; nyan.speak(); -} \ No newline at end of file +} diff --git a/src/test/run-pass/class-dtor.rs b/src/test/run-pass/class-dtor.rs index 07193400c6a9e..229c683706dff 100644 --- a/src/test/run-pass/class-dtor.rs +++ b/src/test/run-pass/class-dtor.rs @@ -13,7 +13,7 @@ struct cat { meows : uint, } -impl cat : Drop { +impl Drop for cat { fn finalize(&self) { (self.done)(self.meows); } diff --git a/src/test/run-pass/class-impl-very-parameterized-trait.rs b/src/test/run-pass/class-impl-very-parameterized-trait.rs index 347f44b2afa6a..01b72c9d99592 100644 --- a/src/test/run-pass/class-impl-very-parameterized-trait.rs +++ b/src/test/run-pass/class-impl-very-parameterized-trait.rs @@ -15,7 +15,7 @@ use core::iter::BaseIter; enum cat_type { tuxedo, tabby, tortoiseshell } -impl cat_type : cmp::Eq { +impl cmp::Eq for cat_type { pure fn eq(&self, other: &cat_type) -> bool { ((*self) as uint) == ((*other) as uint) } @@ -49,7 +49,7 @@ impl cat { } } -impl cat: BaseIter<(int, &T)> { +impl BaseIter<(int, &T)> for cat { pure fn each(&self, f: fn(&(int, &self/T)) -> bool) { let mut n = int::abs(self.meows); while n > 0 { @@ -61,16 +61,16 @@ impl cat: BaseIter<(int, &T)> { pure fn size_hint(&self) -> Option { Some(self.len()) } } -impl cat: Container { +impl Container for cat { pure fn len(&self) -> uint { self.meows as uint } pure fn is_empty(&self) -> bool { self.meows == 0 } } -impl cat: Mutable { +impl Mutable for cat { fn clear(&mut self) {} } -impl cat: Map { +impl Map for cat { pure fn contains_key(&self, k: &int) -> bool { *k <= self.meows } pure fn each_key(&self, f: fn(v: &int) -> bool) { diff --git a/src/test/run-pass/class-implement-trait-cross-crate.rs b/src/test/run-pass/class-implement-trait-cross-crate.rs index ff052259a7677..155090b44dfc3 100644 --- a/src/test/run-pass/class-implement-trait-cross-crate.rs +++ b/src/test/run-pass/class-implement-trait-cross-crate.rs @@ -34,7 +34,7 @@ impl cat { } } -impl cat : noisy { +impl noisy for cat { fn speak() { self.meow(); } @@ -65,4 +65,4 @@ pub fn main() { assert(!nyan.eat()); for uint::range(1u, 10u) |_i| { nyan.speak(); }; assert(nyan.eat()); -} \ No newline at end of file +} diff --git a/src/test/run-pass/class-implement-traits.rs b/src/test/run-pass/class-implement-traits.rs index 4679abe21d7a0..06a2dbeb9a499 100644 --- a/src/test/run-pass/class-implement-traits.rs +++ b/src/test/run-pass/class-implement-traits.rs @@ -46,7 +46,7 @@ impl cat { } } -impl cat : noisy { +impl noisy for cat { fn speak() { self.meow(); } } diff --git a/src/test/run-pass/class-separate-impl.rs b/src/test/run-pass/class-separate-impl.rs index 7e59b5d7a870b..919fb058a953a 100644 --- a/src/test/run-pass/class-separate-impl.rs +++ b/src/test/run-pass/class-separate-impl.rs @@ -53,7 +53,7 @@ fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat { } } -impl cat: ToStr { +impl ToStr for cat { pure fn to_str(&self) -> ~str { copy self.name } } diff --git a/src/test/run-pass/class-str-field.rs b/src/test/run-pass/class-str-field.rs index 060ad2b4beba9..db70d6e3b362c 100644 --- a/src/test/run-pass/class-str-field.rs +++ b/src/test/run-pass/class-str-field.rs @@ -22,4 +22,4 @@ fn cat(in_name: ~str) -> cat { pub fn main() { let nyan = cat(~"nyan"); -} \ No newline at end of file +} diff --git a/src/test/run-pass/classes-cross-crate.rs b/src/test/run-pass/classes-cross-crate.rs index 1b68e6c519aa5..d40f948431e25 100644 --- a/src/test/run-pass/classes-cross-crate.rs +++ b/src/test/run-pass/classes-cross-crate.rs @@ -19,4 +19,4 @@ pub fn main() { assert(!nyan.eat()); for uint::range(1u, 10u) |_i| { nyan.speak(); }; assert(nyan.eat()); -} \ No newline at end of file +} diff --git a/src/test/run-pass/classes.rs b/src/test/run-pass/classes.rs index c3bc2f096ba78..808b7cac501a6 100644 --- a/src/test/run-pass/classes.rs +++ b/src/test/run-pass/classes.rs @@ -56,4 +56,4 @@ pub fn main() { assert(!nyan.eat()); for uint::range(1u, 10u) |_i| { nyan.speak(); }; assert(nyan.eat()); -} \ No newline at end of file +} diff --git a/src/test/run-pass/clone-with-exterior.rs b/src/test/run-pass/clone-with-exterior.rs index 09b57ebd6177c..9c8ca729a23ca 100644 --- a/src/test/run-pass/clone-with-exterior.rs +++ b/src/test/run-pass/clone-with-exterior.rs @@ -21,4 +21,4 @@ pub fn main() { let z : @{a:int, b:int} = @{ a : 10, b : 12}; let p = task::_spawn(bind f(z)); task::join_id(p); -} \ No newline at end of file +} diff --git a/src/test/run-pass/coerce-reborrow-mut-vec-rcvr.rs b/src/test/run-pass/coerce-reborrow-mut-vec-rcvr.rs index 0820af24c49ea..7797af14364c8 100644 --- a/src/test/run-pass/coerce-reborrow-mut-vec-rcvr.rs +++ b/src/test/run-pass/coerce-reborrow-mut-vec-rcvr.rs @@ -2,7 +2,7 @@ trait Reverser { fn reverse(&self); } -impl &mut [uint] : Reverser { +impl Reverser for &mut [uint] { fn reverse(&self) { vec::reverse(*self); } diff --git a/src/test/run-pass/coherence-copy-bound.rs b/src/test/run-pass/coherence-copy-bound.rs index 7435096c27535..9921389da6674 100644 --- a/src/test/run-pass/coherence-copy-bound.rs +++ b/src/test/run-pass/coherence-copy-bound.rs @@ -1,13 +1,13 @@ trait X {} -impl A : X {} +impl X for A {} struct S { x: int, drop {} } -impl S : X {} +impl X for S {} pub fn main(){} diff --git a/src/test/run-pass/coherence-impl-in-fn.rs b/src/test/run-pass/coherence-impl-in-fn.rs index 561187d1934f6..4fb43092500b3 100644 --- a/src/test/run-pass/coherence-impl-in-fn.rs +++ b/src/test/run-pass/coherence-impl-in-fn.rs @@ -10,7 +10,7 @@ pub fn main() { enum x { foo } - impl x : ::core::cmp::Eq { + impl ::core::cmp::Eq for x { pure fn eq(&self, other: &x) -> bool { (*self) as int == (*other) as int } diff --git a/src/test/run-pass/compare-generic-enums.rs b/src/test/run-pass/compare-generic-enums.rs index e73e1e9755517..591d2666e254f 100644 --- a/src/test/run-pass/compare-generic-enums.rs +++ b/src/test/run-pass/compare-generic-enums.rs @@ -19,4 +19,4 @@ pub fn main() { assert !cmp(Some(3), Some(4)); assert cmp(Some(3), Some(3)); assert cmp(None, None); -} \ No newline at end of file +} diff --git a/src/test/run-pass/conditional-compile.rs b/src/test/run-pass/conditional-compile.rs index 1c2da8ff3ec1c..883acf817a0c8 100644 --- a/src/test/run-pass/conditional-compile.rs +++ b/src/test/run-pass/conditional-compile.rs @@ -129,7 +129,7 @@ mod test_methods { bar: uint } - impl Foo: Fooable { + impl Fooable for Foo { #[cfg(bogus)] static fn what() { } diff --git a/src/test/run-pass/const-const.rs b/src/test/run-pass/const-const.rs index b3498b4dc58b3..c07b2e2671e33 100644 --- a/src/test/run-pass/const-const.rs +++ b/src/test/run-pass/const-const.rs @@ -13,4 +13,4 @@ const b: int = a + 2; pub fn main() { assert b == 3; -} \ No newline at end of file +} diff --git a/src/test/run-pass/const-extern-function.rs b/src/test/run-pass/const-extern-function.rs index 4d7dc6bac9dbd..1fd2ebab83ff3 100644 --- a/src/test/run-pass/const-extern-function.rs +++ b/src/test/run-pass/const-extern-function.rs @@ -20,4 +20,4 @@ struct S { pub fn main() { assert foopy == f; assert f == s.f; -} \ No newline at end of file +} diff --git a/src/test/run-pass/const-fn-val.rs b/src/test/run-pass/const-fn-val.rs index 17c66b354a1bc..4d4247ed5b91e 100644 --- a/src/test/run-pass/const-fn-val.rs +++ b/src/test/run-pass/const-fn-val.rs @@ -18,4 +18,4 @@ const b : Bar = Bar { f: foo }; pub fn main() { assert (b.f)() == 0xca7f000d; -} \ No newline at end of file +} diff --git a/src/test/run-pass/const-negative.rs b/src/test/run-pass/const-negative.rs index 44917e23293b8..2b6817d4a0862 100644 --- a/src/test/run-pass/const-negative.rs +++ b/src/test/run-pass/const-negative.rs @@ -14,4 +14,4 @@ const toplevel_mod: int = -1; pub fn main() { assert toplevel_mod == -1; -} \ No newline at end of file +} diff --git a/src/test/run-pass/const-struct.rs b/src/test/run-pass/const-struct.rs index 58c09ccce923d..24243601e09de 100644 --- a/src/test/run-pass/const-struct.rs +++ b/src/test/run-pass/const-struct.rs @@ -11,7 +11,7 @@ struct foo { a: int, b: int, c: int } -impl foo : cmp::Eq { +impl cmp::Eq for foo { pure fn eq(&self, other: &foo) -> bool { (*self).a == (*other).a && (*self).b == (*other).b && diff --git a/src/test/run-pass/cycle-collection2.rs b/src/test/run-pass/cycle-collection2.rs index 8eaad5c08b2a2..127a1c9703896 100644 --- a/src/test/run-pass/cycle-collection2.rs +++ b/src/test/run-pass/cycle-collection2.rs @@ -17,4 +17,4 @@ pub fn main() { let w = @foo{ mut z: || nop() }; let x : fn@() = || nop_foo(w); w.z = x; -} \ No newline at end of file +} diff --git a/src/test/run-pass/cycle-collection4.rs b/src/test/run-pass/cycle-collection4.rs index b34ff10b53143..4be43fc1296ed 100644 --- a/src/test/run-pass/cycle-collection4.rs +++ b/src/test/run-pass/cycle-collection4.rs @@ -17,4 +17,4 @@ pub fn main() { let w = @foo{ z: || nop() }; let x : fn@() = || nop_foo(~[], w); w.z = x; -} \ No newline at end of file +} diff --git a/src/test/run-pass/cycle-collection5.rs b/src/test/run-pass/cycle-collection5.rs index 9a5d776baccd2..6f3297c660272 100644 --- a/src/test/run-pass/cycle-collection5.rs +++ b/src/test/run-pass/cycle-collection5.rs @@ -19,4 +19,4 @@ pub fn main() { let w = @foo { mut z: || nop() }; let x : fn@() = || nop_foo(o(), w); w.z = x; -} \ No newline at end of file +} diff --git a/src/test/run-pass/deep-vector.rs b/src/test/run-pass/deep-vector.rs index d2d8181e114ac..e6ae892093c8f 100644 --- a/src/test/run-pass/deep-vector.rs +++ b/src/test/run-pass/deep-vector.rs @@ -2009,4 +2009,4 @@ pub fn main() { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]; -} \ No newline at end of file +} diff --git a/src/test/run-pass/deep-vector2.rs b/src/test/run-pass/deep-vector2.rs index e66cf1bbea64d..ab08a538723e4 100644 --- a/src/test/run-pass/deep-vector2.rs +++ b/src/test/run-pass/deep-vector2.rs @@ -8009,4 +8009,4 @@ pub fn main() { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]; -} \ No newline at end of file +} diff --git a/src/test/run-pass/default-method-simple.rs b/src/test/run-pass/default-method-simple.rs index 41ab5b1d3c860..4e17506d6ead9 100644 --- a/src/test/run-pass/default-method-simple.rs +++ b/src/test/run-pass/default-method-simple.rs @@ -22,7 +22,7 @@ struct A { x: int } -impl A : Foo { +impl Foo for A { fn g() { io::println("Goodbye!"); } diff --git a/src/test/run-pass/do-for-no-args.rs b/src/test/run-pass/do-for-no-args.rs index 5c5cec1fac1d8..745d941182e6c 100644 --- a/src/test/run-pass/do-for-no-args.rs +++ b/src/test/run-pass/do-for-no-args.rs @@ -17,4 +17,4 @@ fn d(f: fn@()) { } pub fn main() { for f { } do d { } -} \ No newline at end of file +} diff --git a/src/test/run-pass/do-pure.rs b/src/test/run-pass/do-pure.rs index 5cad9235af843..b422f5819f09c 100644 --- a/src/test/run-pass/do-pure.rs +++ b/src/test/run-pass/do-pure.rs @@ -17,4 +17,4 @@ pure fn g() { } pub fn main() { -} \ No newline at end of file +} diff --git a/src/test/run-pass/drop-trait-generic.rs b/src/test/run-pass/drop-trait-generic.rs index 256461b61bd05..270137c2fd292 100644 --- a/src/test/run-pass/drop-trait-generic.rs +++ b/src/test/run-pass/drop-trait-generic.rs @@ -12,7 +12,7 @@ struct S { x: T } -impl S : ::core::ops::Drop { +impl ::core::ops::Drop for S { fn finalize(&self) { io::println("bye"); } diff --git a/src/test/run-pass/drop-trait.rs b/src/test/run-pass/drop-trait.rs index 084bff6374380..3eddda376a836 100644 --- a/src/test/run-pass/drop-trait.rs +++ b/src/test/run-pass/drop-trait.rs @@ -12,7 +12,7 @@ struct Foo { x: int } -impl Foo : Drop { +impl Drop for Foo { fn finalize(&self) { io::println("bye"); } diff --git a/src/test/run-pass/early-vtbl-resolution.rs b/src/test/run-pass/early-vtbl-resolution.rs index d71edb660985f..0191934d60807 100644 --- a/src/test/run-pass/early-vtbl-resolution.rs +++ b/src/test/run-pass/early-vtbl-resolution.rs @@ -12,7 +12,7 @@ trait thing { fn foo() -> Option; } -impl int: thing { +impl thing for int { fn foo() -> Option { None } } fn foo_func>(x: B) -> Option { x.foo() } diff --git a/src/test/run-pass/empty-tag.rs b/src/test/run-pass/empty-tag.rs index 0dd6c2773ce96..4c71e10c8e3aa 100644 --- a/src/test/run-pass/empty-tag.rs +++ b/src/test/run-pass/empty-tag.rs @@ -10,7 +10,7 @@ enum chan { chan_t, } -impl chan : cmp::Eq { +impl cmp::Eq for chan { pure fn eq(&self, other: &chan) -> bool { ((*self) as uint) == ((*other) as uint) } diff --git a/src/test/run-pass/explicit-self-objects-box.rs b/src/test/run-pass/explicit-self-objects-box.rs index 8d081c16830e4..c18e263245a42 100644 --- a/src/test/run-pass/explicit-self-objects-box.rs +++ b/src/test/run-pass/explicit-self-objects-box.rs @@ -16,7 +16,7 @@ struct S { x: int } -impl S : Foo { +impl Foo for S { fn f(@self) { assert self.x == 3; } diff --git a/src/test/run-pass/explicit-self-objects-ext-1.rs b/src/test/run-pass/explicit-self-objects-ext-1.rs index f6a6ae5ed49e1..80c18ca0974a4 100644 --- a/src/test/run-pass/explicit-self-objects-ext-1.rs +++ b/src/test/run-pass/explicit-self-objects-ext-1.rs @@ -13,7 +13,7 @@ pub trait ReaderUtil { fn read_bytes(&self, len: uint); } -impl T : ReaderUtil { +impl ReaderUtil for T { fn read_bytes(&self, len: uint) { let mut count = self.read(&mut [0], len); @@ -26,7 +26,7 @@ struct S { y: int } -impl S: Reader { +impl Reader for S { fn read(&self, bytes: &mut [u8], len: uint) -> uint { 0 } diff --git a/src/test/run-pass/explicit-self-objects-ext-2.rs b/src/test/run-pass/explicit-self-objects-ext-2.rs index f6a6ae5ed49e1..80c18ca0974a4 100644 --- a/src/test/run-pass/explicit-self-objects-ext-2.rs +++ b/src/test/run-pass/explicit-self-objects-ext-2.rs @@ -13,7 +13,7 @@ pub trait ReaderUtil { fn read_bytes(&self, len: uint); } -impl T : ReaderUtil { +impl ReaderUtil for T { fn read_bytes(&self, len: uint) { let mut count = self.read(&mut [0], len); @@ -26,7 +26,7 @@ struct S { y: int } -impl S: Reader { +impl Reader for S { fn read(&self, bytes: &mut [u8], len: uint) -> uint { 0 } diff --git a/src/test/run-pass/explicit-self-objects-ext-3.rs b/src/test/run-pass/explicit-self-objects-ext-3.rs index 1804c24708bac..a32ac955b946b 100644 --- a/src/test/run-pass/explicit-self-objects-ext-3.rs +++ b/src/test/run-pass/explicit-self-objects-ext-3.rs @@ -13,7 +13,7 @@ pub trait ReaderUtil { fn read_bytes(len: uint); } -impl T : ReaderUtil { +impl ReaderUtil for T { fn read_bytes(len: uint) { let mut count = self.read(&mut [0], len); @@ -26,7 +26,7 @@ struct S { y: int } -impl S: Reader { +impl Reader for S { fn read(&self, bytes: &mut [u8], len: uint) -> uint { 0 } diff --git a/src/test/run-pass/explicit-self-objects-ext-4.rs b/src/test/run-pass/explicit-self-objects-ext-4.rs index b460131461232..ca7764f96f4f1 100644 --- a/src/test/run-pass/explicit-self-objects-ext-4.rs +++ b/src/test/run-pass/explicit-self-objects-ext-4.rs @@ -13,7 +13,7 @@ pub trait ReaderUtil { fn read_bytes(len: uint); } -impl T : ReaderUtil { +impl ReaderUtil for T { fn read_bytes(len: uint) { let mut count = self.read(&mut [0], len); @@ -26,7 +26,7 @@ struct S { y: int } -impl S: Reader { +impl Reader for S { fn read(bytes: &mut [u8], len: uint) -> uint { 0 } diff --git a/src/test/run-pass/explicit-self-objects-simple.rs b/src/test/run-pass/explicit-self-objects-simple.rs index 79d5d7791f420..3b5c02672d6a0 100644 --- a/src/test/run-pass/explicit-self-objects-simple.rs +++ b/src/test/run-pass/explicit-self-objects-simple.rs @@ -16,7 +16,7 @@ struct S { x: int } -impl S : Foo { +impl Foo for S { fn f(&self) { assert self.x == 3; } diff --git a/src/test/run-pass/explicit-self-objects-uniq.rs b/src/test/run-pass/explicit-self-objects-uniq.rs index 6e789b7ff1ed1..44f39e3ef0c5d 100644 --- a/src/test/run-pass/explicit-self-objects-uniq.rs +++ b/src/test/run-pass/explicit-self-objects-uniq.rs @@ -16,7 +16,7 @@ struct S { x: int } -impl S : Foo { +impl Foo for S { fn f(~self) { assert self.x == 3; } diff --git a/src/test/run-pass/explicit-self.rs b/src/test/run-pass/explicit-self.rs index ebffa131fb6ae..f162a1bc48a6a 100644 --- a/src/test/run-pass/explicit-self.rs +++ b/src/test/run-pass/explicit-self.rs @@ -63,7 +63,7 @@ impl thing { } trait Nus { fn f(&self); } -impl thing: Nus { fn f(&self) {} } +impl Nus for thing { fn f(&self) {} } pub fn main() { diff --git a/src/test/run-pass/export-unexported-dep.rs b/src/test/run-pass/export-unexported-dep.rs index 16f2467422683..1b33df0b328c9 100644 --- a/src/test/run-pass/export-unexported-dep.rs +++ b/src/test/run-pass/export-unexported-dep.rs @@ -15,7 +15,7 @@ mod foo { // not exported enum t { t1, t2, } - impl t : cmp::Eq { + impl cmp::Eq for t { pure fn eq(&self, other: &t) -> bool { ((*self) as uint) == ((*other) as uint) } diff --git a/src/test/run-pass/expr-alt-struct.rs b/src/test/run-pass/expr-alt-struct.rs index 620881d30e3ce..ed362edde4064 100644 --- a/src/test/run-pass/expr-alt-struct.rs +++ b/src/test/run-pass/expr-alt-struct.rs @@ -23,7 +23,7 @@ fn test_rec() { enum mood { happy, sad, } -impl mood : cmp::Eq { +impl cmp::Eq for mood { pure fn eq(&self, other: &mood) -> bool { ((*self) as uint) == ((*other) as uint) } diff --git a/src/test/run-pass/expr-if-struct.rs b/src/test/run-pass/expr-if-struct.rs index 2f222c2d08e07..ea0bd76843861 100644 --- a/src/test/run-pass/expr-if-struct.rs +++ b/src/test/run-pass/expr-if-struct.rs @@ -24,7 +24,7 @@ fn test_rec() { enum mood { happy, sad, } -impl mood : cmp::Eq { +impl cmp::Eq for mood { pure fn eq(&self, other: &mood) -> bool { ((*self) as uint) == ((*other) as uint) } diff --git a/src/test/run-pass/extern-1.rs b/src/test/run-pass/extern-1.rs index 3aaa514eea2c3..e4b9b9dfa1686 100644 --- a/src/test/run-pass/extern-1.rs +++ b/src/test/run-pass/extern-1.rs @@ -12,4 +12,4 @@ extern fn f() { } pub fn main() { -} \ No newline at end of file +} diff --git a/src/test/run-pass/fn-assign-managed-to-bare-1.rs b/src/test/run-pass/fn-assign-managed-to-bare-1.rs index 6561708192b6b..c08d8f61033be 100644 --- a/src/test/run-pass/fn-assign-managed-to-bare-1.rs +++ b/src/test/run-pass/fn-assign-managed-to-bare-1.rs @@ -17,4 +17,4 @@ pub fn main() assert add(3)(4) == 7; let add3 : fn(int)->int = add(3); assert add3(4) == 7; -} \ No newline at end of file +} diff --git a/src/test/run-pass/fn-bare-assign.rs b/src/test/run-pass/fn-bare-assign.rs index 1d523e180ff29..ded30c6c7d626 100644 --- a/src/test/run-pass/fn-bare-assign.rs +++ b/src/test/run-pass/fn-bare-assign.rs @@ -22,4 +22,4 @@ pub fn main() { let h = f; g(h, &mut called); assert called == true; -} \ No newline at end of file +} diff --git a/src/test/run-pass/fn-bare-coerce-to-block.rs b/src/test/run-pass/fn-bare-coerce-to-block.rs index b243ce63e18c2..a1ccb8b37eff9 100644 --- a/src/test/run-pass/fn-bare-coerce-to-block.rs +++ b/src/test/run-pass/fn-bare-coerce-to-block.rs @@ -14,4 +14,4 @@ fn likes_block(f: fn()) { f() } pub fn main() { likes_block(bare); -} \ No newline at end of file +} diff --git a/src/test/run-pass/fn-bare-coerce-to-shared.rs b/src/test/run-pass/fn-bare-coerce-to-shared.rs index 91b0abbb3ec3e..5f69af3113478 100644 --- a/src/test/run-pass/fn-bare-coerce-to-shared.rs +++ b/src/test/run-pass/fn-bare-coerce-to-shared.rs @@ -14,4 +14,4 @@ fn likes_shared(f: fn@()) { f() } pub fn main() { likes_shared(bare); -} \ No newline at end of file +} diff --git a/src/test/run-pass/fn-bare-item.rs b/src/test/run-pass/fn-bare-item.rs index c224f48cbc3fe..85203c185443e 100644 --- a/src/test/run-pass/fn-bare-item.rs +++ b/src/test/run-pass/fn-bare-item.rs @@ -14,4 +14,4 @@ fn f() { pub fn main() { f(); -} \ No newline at end of file +} diff --git a/src/test/run-pass/fn-bare-size.rs b/src/test/run-pass/fn-bare-size.rs index 499dc6a4a2b22..e727dd6e8ab26 100644 --- a/src/test/run-pass/fn-bare-size.rs +++ b/src/test/run-pass/fn-bare-size.rs @@ -16,4 +16,4 @@ pub fn main() { // Bare functions should just be a pointer assert sys::rustrt::size_of::() == sys::rustrt::size_of::(); -} \ No newline at end of file +} diff --git a/src/test/run-pass/fn-coerce-field.rs b/src/test/run-pass/fn-coerce-field.rs index 028fb0f444091..d1c903411afbe 100644 --- a/src/test/run-pass/fn-coerce-field.rs +++ b/src/test/run-pass/fn-coerce-field.rs @@ -15,4 +15,4 @@ struct r { pub fn main() { fn f() {} let i: r = r {field: f}; -} \ No newline at end of file +} diff --git a/src/test/run-pass/foreign-call-no-runtime.rs b/src/test/run-pass/foreign-call-no-runtime.rs index 865aa77536284..5d400e98d41aa 100644 --- a/src/test/run-pass/foreign-call-no-runtime.rs +++ b/src/test/run-pass/foreign-call-no-runtime.rs @@ -21,4 +21,4 @@ extern fn callback(data: libc::uintptr_t) { let data: *int = cast::transmute(data); assert *data == 100; } -} \ No newline at end of file +} diff --git a/src/test/run-pass/generic-object.rs b/src/test/run-pass/generic-object.rs index 497739471d89a..5279ef043f559 100644 --- a/src/test/run-pass/generic-object.rs +++ b/src/test/run-pass/generic-object.rs @@ -16,7 +16,7 @@ struct S { x: int } -impl S : Foo { +impl Foo for S { fn get() -> int { self.x } diff --git a/src/test/run-pass/impl-implicit-trait.rs b/src/test/run-pass/impl-implicit-trait.rs index 8afa762c0a3ea..511529bbc8f78 100644 --- a/src/test/run-pass/impl-implicit-trait.rs +++ b/src/test/run-pass/impl-implicit-trait.rs @@ -27,4 +27,4 @@ impl option__ { } pub fn main() { -} \ No newline at end of file +} diff --git a/src/test/run-pass/impl-variance.rs b/src/test/run-pass/impl-variance.rs index 972bd959a1d27..59e248dfc1b31 100644 --- a/src/test/run-pass/impl-variance.rs +++ b/src/test/run-pass/impl-variance.rs @@ -12,7 +12,7 @@ trait foo { fn foo() -> uint; } -impl ~[const T]: foo { +impl foo for ~[const T] { fn foo() -> uint { vec::len(self) } } diff --git a/src/test/run-pass/infinite-loops.rs b/src/test/run-pass/infinite-loops.rs index 70a4cecf47a11..62644fc678ea8 100644 --- a/src/test/run-pass/infinite-loops.rs +++ b/src/test/run-pass/infinite-loops.rs @@ -27,4 +27,4 @@ fn loop(n: int) { loop { } } -pub fn main() { let t: task = spawn loop(5); join(t); } \ No newline at end of file +pub fn main() { let t: task = spawn loop(5); join(t); } diff --git a/src/test/run-pass/init-res-into-things.rs b/src/test/run-pass/init-res-into-things.rs index 965c14f7315b7..0605fac3677bf 100644 --- a/src/test/run-pass/init-res-into-things.rs +++ b/src/test/run-pass/init-res-into-things.rs @@ -17,7 +17,7 @@ struct r { struct Box { x: r } -impl r : Drop { +impl Drop for r { fn finalize(&self) { *(self.i) = *(self.i) + 1; } diff --git a/src/test/run-pass/issue-1701.rs b/src/test/run-pass/issue-1701.rs index 33caaf1b53fca..305bd69a57e5b 100644 --- a/src/test/run-pass/issue-1701.rs +++ b/src/test/run-pass/issue-1701.rs @@ -28,4 +28,4 @@ pub fn main() { assert noise(dog(pug)) == Some(~"woof"); assert noise(rabbit(~"Hilbert", upright)) == None; assert noise(tiger) == Some(~"roar"); -} \ No newline at end of file +} diff --git a/src/test/run-pass/issue-1821.rs b/src/test/run-pass/issue-1821.rs index 092d2b05cb742..92f0beaeb9c27 100644 --- a/src/test/run-pass/issue-1821.rs +++ b/src/test/run-pass/issue-1821.rs @@ -12,4 +12,4 @@ enum t { foo(~[t]) } -pub fn main() {} \ No newline at end of file +pub fn main() {} diff --git a/src/test/run-pass/issue-1974.rs b/src/test/run-pass/issue-1974.rs index a28d5a205e995..90646b0750aa9 100644 --- a/src/test/run-pass/issue-1974.rs +++ b/src/test/run-pass/issue-1974.rs @@ -15,4 +15,4 @@ pub fn main() { while s != ~"" { return; } -} \ No newline at end of file +} diff --git a/src/test/run-pass/issue-2185.rs b/src/test/run-pass/issue-2185.rs index e24defbf40caa..ff35b81aad1f6 100644 --- a/src/test/run-pass/issue-2185.rs +++ b/src/test/run-pass/issue-2185.rs @@ -20,11 +20,11 @@ trait iterable { fn iter(blk: fn(A)); } -impl fn@(fn(A)): iterable { +impl iterable for fn@(fn(A)) { fn iter(blk: fn(A)) { self(blk); } } -impl fn@(fn(uint)): iterable { +impl iterable for fn@(fn(uint)) { fn iter(blk: fn(&&v: uint)) { self( |i| blk(i) ) } } diff --git a/src/test/run-pass/issue-2190-2.rs b/src/test/run-pass/issue-2190-2.rs index b28055eca2799..245864cc3391d 100644 --- a/src/test/run-pass/issue-2190-2.rs +++ b/src/test/run-pass/issue-2190-2.rs @@ -28,4 +28,4 @@ pub fn main() { foo(Some(||bar())); } } pub fn main() { -} \ No newline at end of file +} diff --git a/src/test/run-pass/issue-2216.rs b/src/test/run-pass/issue-2216.rs index 730646e4075a9..ada3852812c8b 100644 --- a/src/test/run-pass/issue-2216.rs +++ b/src/test/run-pass/issue-2216.rs @@ -29,4 +29,4 @@ pub fn main() { error!("%?", x); assert(x == 42); -} \ No newline at end of file +} diff --git a/src/test/run-pass/issue-2284.rs b/src/test/run-pass/issue-2284.rs index e2484433448d1..1c4f21c628867 100644 --- a/src/test/run-pass/issue-2284.rs +++ b/src/test/run-pass/issue-2284.rs @@ -17,4 +17,4 @@ fn f(t: T) { } pub fn main() { -} \ No newline at end of file +} diff --git a/src/test/run-pass/issue-2288.rs b/src/test/run-pass/issue-2288.rs index a77bbe150ab86..99c9828bfeaa0 100644 --- a/src/test/run-pass/issue-2288.rs +++ b/src/test/run-pass/issue-2288.rs @@ -15,7 +15,7 @@ struct foo { x: A, } -impl foo : clam { +impl clam for foo { fn chowder(y: A) { } } diff --git a/src/test/run-pass/issue-2316-c.rs b/src/test/run-pass/issue-2316-c.rs index 4a12440040c41..c9dc6a58c122b 100644 --- a/src/test/run-pass/issue-2316-c.rs +++ b/src/test/run-pass/issue-2316-c.rs @@ -17,4 +17,4 @@ use issue_2316_b::cloth; pub fn main() { let _c: cloth::fabric = cloth::calico; -} \ No newline at end of file +} diff --git a/src/test/run-pass/issue-2487-a.rs b/src/test/run-pass/issue-2487-a.rs index 62fef8202aa53..198a8c900d77b 100644 --- a/src/test/run-pass/issue-2487-a.rs +++ b/src/test/run-pass/issue-2487-a.rs @@ -13,7 +13,7 @@ struct socket { } -impl socket : Drop { +impl Drop for socket { fn finalize(&self) {} } diff --git a/src/test/run-pass/issue-2611.rs b/src/test/run-pass/issue-2611.rs index de03e3382a6d1..b70a9670df193 100644 --- a/src/test/run-pass/issue-2611.rs +++ b/src/test/run-pass/issue-2611.rs @@ -14,7 +14,7 @@ trait FlatMapToVec { fn flat_map_to_vec>(op: fn(&A) -> IB) -> ~[B]; } -impl BaseIter: FlatMapToVec { +impl FlatMapToVec for BaseIter { fn flat_map_to_vec>(op: fn(&A) -> IB) -> ~[B] { iter::flat_map_to_vec(&self, op) } diff --git a/src/test/run-pass/issue-2708.rs b/src/test/run-pass/issue-2708.rs index f16a65c930994..9e8438efad57f 100644 --- a/src/test/run-pass/issue-2708.rs +++ b/src/test/run-pass/issue-2708.rs @@ -15,7 +15,7 @@ struct Font { } -impl Font : Drop { +impl Drop for Font { fn finalize(&self) {} } diff --git a/src/test/run-pass/issue-2734.rs b/src/test/run-pass/issue-2734.rs index d389ff34abe77..ed7b032e7139e 100644 --- a/src/test/run-pass/issue-2734.rs +++ b/src/test/run-pass/issue-2734.rs @@ -9,7 +9,7 @@ // except according to those terms. trait hax { } -impl A: hax { } +impl hax for A { } fn perform_hax(x: @T) -> hax { x as hax diff --git a/src/test/run-pass/issue-2735-2.rs b/src/test/run-pass/issue-2735-2.rs index 21bd5e2ebc119..a1619c69b3ce0 100644 --- a/src/test/run-pass/issue-2735-2.rs +++ b/src/test/run-pass/issue-2735-2.rs @@ -13,7 +13,7 @@ struct defer { b: &mut bool, } -impl defer : Drop { +impl Drop for defer { fn finalize(&self) { *(self.b) = true; } diff --git a/src/test/run-pass/issue-2735-3.rs b/src/test/run-pass/issue-2735-3.rs index 6a706404e33c0..c39b8a6c6d73c 100644 --- a/src/test/run-pass/issue-2735-3.rs +++ b/src/test/run-pass/issue-2735-3.rs @@ -13,7 +13,7 @@ struct defer { b: &mut bool, } -impl defer : Drop { +impl Drop for defer { fn finalize(&self) { *(self.b) = true; } diff --git a/src/test/run-pass/issue-2735.rs b/src/test/run-pass/issue-2735.rs index 709227c83e390..8a6f2a0b461bf 100644 --- a/src/test/run-pass/issue-2735.rs +++ b/src/test/run-pass/issue-2735.rs @@ -9,7 +9,7 @@ // except according to those terms. trait hax { } -impl A: hax { } +impl hax for A { } fn perform_hax(x: @T) -> hax { x as hax diff --git a/src/test/run-pass/issue-2895.rs b/src/test/run-pass/issue-2895.rs index be1cb3bef8fee..d97c3c3de5ecd 100644 --- a/src/test/run-pass/issue-2895.rs +++ b/src/test/run-pass/issue-2895.rs @@ -16,7 +16,7 @@ struct Kitty { x: int, } -impl Kitty : Drop { +impl Drop for Kitty { fn finalize(&self) {} } diff --git a/src/test/run-pass/issue-2904.rs b/src/test/run-pass/issue-2904.rs index d6804d83d72c8..eadfa82619acd 100644 --- a/src/test/run-pass/issue-2904.rs +++ b/src/test/run-pass/issue-2904.rs @@ -27,7 +27,7 @@ enum square { empty } -impl square: to_str::ToStr { +impl to_str::ToStr for square { pure fn to_str(&self) -> ~str { match *self { bot => { ~"R" } diff --git a/src/test/run-pass/issue-2935.rs b/src/test/run-pass/issue-2935.rs index e30d8997b3bda..82089dd3bed1b 100644 --- a/src/test/run-pass/issue-2935.rs +++ b/src/test/run-pass/issue-2935.rs @@ -16,7 +16,7 @@ trait it { fn f(); } -impl t: it { +impl it for t { fn f() { } } diff --git a/src/test/run-pass/issue-2936.rs b/src/test/run-pass/issue-2936.rs index 3a024c73791e7..52f1678fd022d 100644 --- a/src/test/run-pass/issue-2936.rs +++ b/src/test/run-pass/issue-2936.rs @@ -20,7 +20,7 @@ struct cbar { x: int, } -impl cbar : bar { +impl bar for cbar { fn get_bar() -> int { self.x } diff --git a/src/test/run-pass/issue-2989.rs b/src/test/run-pass/issue-2989.rs index 40a78d7114acb..0ad88e350a6df 100644 --- a/src/test/run-pass/issue-2989.rs +++ b/src/test/run-pass/issue-2989.rs @@ -14,7 +14,7 @@ trait methods { fn to_bytes() -> ~[u8]; } -impl (): methods { +impl methods for () { fn to_bytes() -> ~[u8] { vec::from_elem(0, 0) } diff --git a/src/test/run-pass/issue-3211.rs b/src/test/run-pass/issue-3211.rs index 2bb57d6c95a11..435ac8e7bfe4e 100644 --- a/src/test/run-pass/issue-3211.rs +++ b/src/test/run-pass/issue-3211.rs @@ -5,4 +5,4 @@ pub fn main() { } assert x == 4096; io::println(fmt!("x = %u", x)); -} \ No newline at end of file +} diff --git a/src/test/run-pass/issue-3220.rs b/src/test/run-pass/issue-3220.rs index 561a1925a9747..71c83e02617ff 100644 --- a/src/test/run-pass/issue-3220.rs +++ b/src/test/run-pass/issue-3220.rs @@ -10,7 +10,7 @@ struct thing { x: int, } -impl thing : Drop { +impl Drop for thing { fn finalize(&self) {} } diff --git a/src/test/run-pass/issue-3305.rs b/src/test/run-pass/issue-3305.rs index d3377d196a4a8..53dd6f942e860 100644 --- a/src/test/run-pass/issue-3305.rs +++ b/src/test/run-pass/issue-3305.rs @@ -12,7 +12,7 @@ trait double { fn double() -> uint; } -impl uint: double { +impl double for uint { fn double() -> uint { self * 2u } } diff --git a/src/test/run-pass/issue-3461.rs b/src/test/run-pass/issue-3461.rs index f285479df2051..4c4144f28e891 100644 --- a/src/test/run-pass/issue-3461.rs +++ b/src/test/run-pass/issue-3461.rs @@ -14,4 +14,4 @@ pub fn main() { fn foo() { } let bar: ~fn() = ~foo; -} \ No newline at end of file +} diff --git a/src/test/run-pass/issue-3480.rs b/src/test/run-pass/issue-3480.rs index 8e4f344695381..252ebb86685ec 100644 --- a/src/test/run-pass/issue-3480.rs +++ b/src/test/run-pass/issue-3480.rs @@ -24,4 +24,4 @@ impl IMap : ImmutableMap } } -pub fn main() {} \ No newline at end of file +pub fn main() {} diff --git a/src/test/run-pass/issue-3683.rs b/src/test/run-pass/issue-3683.rs index 729f91760b10b..e254ac809a4b5 100644 --- a/src/test/run-pass/issue-3683.rs +++ b/src/test/run-pass/issue-3683.rs @@ -17,7 +17,7 @@ trait Foo { } } -impl int: Foo { +impl Foo for int { fn a() -> int { 3 } diff --git a/src/test/run-pass/issue-3753.rs b/src/test/run-pass/issue-3753.rs index 39d3e20ae2feb..920736a976ec2 100644 --- a/src/test/run-pass/issue-3753.rs +++ b/src/test/run-pass/issue-3753.rs @@ -34,4 +34,4 @@ pub impl Shape { pub fn main(){ let s = Circle(Point { x: 1f, y: 2f }, 3f); io::println(fmt!("%f", s.area(s))); -} \ No newline at end of file +} diff --git a/src/test/run-pass/issue-3794.rs b/src/test/run-pass/issue-3794.rs index 47373e5490a7a..1c1eb75c220c1 100644 --- a/src/test/run-pass/issue-3794.rs +++ b/src/test/run-pass/issue-3794.rs @@ -17,7 +17,7 @@ struct S { s: int, } -impl S: T { +impl T for S { fn print(&self) { io::println(fmt!("%?", self)); } diff --git a/src/test/run-pass/issue-3860.rs b/src/test/run-pass/issue-3860.rs index ba519fe58124e..fdc50220014f3 100644 --- a/src/test/run-pass/issue-3860.rs +++ b/src/test/run-pass/issue-3860.rs @@ -21,4 +21,4 @@ pub fn main() { // Neither of the next two lines should cause an error let _ = x.stuff(); x.stuff(); -} \ No newline at end of file +} diff --git a/src/test/run-pass/issue-3979-generics.rs b/src/test/run-pass/issue-3979-generics.rs index 0f34947309615..ab042922df942 100644 --- a/src/test/run-pass/issue-3979-generics.rs +++ b/src/test/run-pass/issue-3979-generics.rs @@ -23,7 +23,7 @@ trait Movable: Positioned { struct Point { mut x: int, mut y: int } -impl Point: Positioned { +impl Positioned for Point { fn SetX(&self, x: int) { self.x = x; } diff --git a/src/test/run-pass/issue-3979-xcrate.rs b/src/test/run-pass/issue-3979-xcrate.rs index 888fee6317d60..07cf9d68d167c 100644 --- a/src/test/run-pass/issue-3979-xcrate.rs +++ b/src/test/run-pass/issue-3979-xcrate.rs @@ -15,7 +15,7 @@ use issue_3979_traits::*; struct Point { mut x: int, mut y: int } -impl Point: Positioned { +impl Positioned for Point { fn SetX(&self, x: int) { self.x = x; } diff --git a/src/test/run-pass/issue-3979.rs b/src/test/run-pass/issue-3979.rs index 3a112de5503e0..3ea2ef83296a9 100644 --- a/src/test/run-pass/issue-3979.rs +++ b/src/test/run-pass/issue-3979.rs @@ -22,7 +22,7 @@ trait Movable: Positioned { struct Point { mut x: int, mut y: int } -impl Point: Positioned { +impl Positioned for Point { fn SetX(&self, x: int) { self.x = x; } diff --git a/src/test/run-pass/issue-4401.rs b/src/test/run-pass/issue-4401.rs index 2af0246fb3776..d89e0e7d95e15 100644 --- a/src/test/run-pass/issue-4401.rs +++ b/src/test/run-pass/issue-4401.rs @@ -5,4 +5,4 @@ pub fn main() { } assert count == 999_999; io::println(fmt!("%u", count)); -} \ No newline at end of file +} diff --git a/src/test/run-pass/issue-4542.rs b/src/test/run-pass/issue-4542.rs index 329e3647faea5..f708b099c3796 100644 --- a/src/test/run-pass/issue-4542.rs +++ b/src/test/run-pass/issue-4542.rs @@ -15,4 +15,4 @@ pub fn main() { s => { } } } -} \ No newline at end of file +} diff --git a/src/test/run-pass/issue-979.rs b/src/test/run-pass/issue-979.rs index 38fbc44e85145..119739f7fdbc8 100644 --- a/src/test/run-pass/issue-979.rs +++ b/src/test/run-pass/issue-979.rs @@ -12,7 +12,7 @@ struct r { b: @mut int, } -impl r : Drop { +impl Drop for r { fn finalize(&self) { *(self.b) += 1; } diff --git a/src/test/run-pass/kindck-owned-trait-contains-1.rs b/src/test/run-pass/kindck-owned-trait-contains-1.rs index f87e55173ab06..351f68ab37c15 100644 --- a/src/test/run-pass/kindck-owned-trait-contains-1.rs +++ b/src/test/run-pass/kindck-owned-trait-contains-1.rs @@ -10,7 +10,7 @@ trait repeat { fn get() -> A; } -impl @A: repeat { +impl repeat for @A { fn get() -> A { *self } } @@ -23,4 +23,4 @@ pub fn main() { let x = &3; let y = repeater(@x); assert *x == *(y.get()); -} \ No newline at end of file +} diff --git a/src/test/run-pass/lint-structural-records.rs b/src/test/run-pass/lint-structural-records.rs index 9a812b77cb881..e5107ba187cbb 100644 --- a/src/test/run-pass/lint-structural-records.rs +++ b/src/test/run-pass/lint-structural-records.rs @@ -11,4 +11,4 @@ #[warn(structural_records)]; pub fn main() { let _foo = {x:5}; -} \ No newline at end of file +} diff --git a/src/test/run-pass/loop-break-cont-1.rs b/src/test/run-pass/loop-break-cont-1.rs index 1634f36df53b3..b91770b3e397e 100644 --- a/src/test/run-pass/loop-break-cont-1.rs +++ b/src/test/run-pass/loop-break-cont-1.rs @@ -14,4 +14,4 @@ pub fn main() { break; } assert true; -} \ No newline at end of file +} diff --git a/src/test/run-pass/loop-break-cont.rs b/src/test/run-pass/loop-break-cont.rs index 3be3d5f7585a2..05a1764ed5ad9 100644 --- a/src/test/run-pass/loop-break-cont.rs +++ b/src/test/run-pass/loop-break-cont.rs @@ -45,4 +45,4 @@ pub fn main() { is_even = true; } assert is_even; -} \ No newline at end of file +} diff --git a/src/test/run-pass/loop-diverges.rs b/src/test/run-pass/loop-diverges.rs index 27838fe642ace..9c46ba2cb9bbf 100644 --- a/src/test/run-pass/loop-diverges.rs +++ b/src/test/run-pass/loop-diverges.rs @@ -17,4 +17,4 @@ fn forever() -> ! { pub fn main() { if (1 == 2) { forever(); } -} \ No newline at end of file +} diff --git a/src/test/run-pass/max-min-classes.rs b/src/test/run-pass/max-min-classes.rs index 7247afeacd6fe..762b89f5101cd 100644 --- a/src/test/run-pass/max-min-classes.rs +++ b/src/test/run-pass/max-min-classes.rs @@ -23,7 +23,7 @@ impl Foo { } } -impl Foo : Product { +impl Product for Foo { fn product() -> int { self.x * self.y } diff --git a/src/test/run-pass/mlist-cycle.rs b/src/test/run-pass/mlist-cycle.rs index 537ce1bb218bc..8e544c09216ac 100644 --- a/src/test/run-pass/mlist-cycle.rs +++ b/src/test/run-pass/mlist-cycle.rs @@ -22,4 +22,4 @@ pub fn main() { first._0 = @link(second); sys.rustrt.gc(); let third: @cell = @{mut c: @nil()}; -} \ No newline at end of file +} diff --git a/src/test/run-pass/mod-merge-hack.rs b/src/test/run-pass/mod-merge-hack.rs index 20df4978508bc..cd90468101326 100644 --- a/src/test/run-pass/mod-merge-hack.rs +++ b/src/test/run-pass/mod-merge-hack.rs @@ -16,4 +16,4 @@ mod myint32; pub fn main() { assert myint32::bits == 32; assert myint32::min(10, 20) == 10; -} \ No newline at end of file +} diff --git a/src/test/run-pass/mod_file.rs b/src/test/run-pass/mod_file.rs index 1fedf0c7874f9..f041aa9672d2f 100644 --- a/src/test/run-pass/mod_file.rs +++ b/src/test/run-pass/mod_file.rs @@ -16,4 +16,4 @@ mod mod_file_aux; pub fn main() { assert mod_file_aux::foo() == 10; -} \ No newline at end of file +} diff --git a/src/test/run-pass/mod_file_with_path_attr.rs b/src/test/run-pass/mod_file_with_path_attr.rs index b7172a3d50c03..463132919c782 100644 --- a/src/test/run-pass/mod_file_with_path_attr.rs +++ b/src/test/run-pass/mod_file_with_path_attr.rs @@ -17,4 +17,4 @@ mod m; pub fn main() { assert m::foo() == 10; -} \ No newline at end of file +} diff --git a/src/test/run-pass/module-polymorphism3-files/float-template/inst_f32.rs b/src/test/run-pass/module-polymorphism3-files/float-template/inst_f32.rs index 66201efc77b96..2242daa2d802f 100644 --- a/src/test/run-pass/module-polymorphism3-files/float-template/inst_f32.rs +++ b/src/test/run-pass/module-polymorphism3-files/float-template/inst_f32.rs @@ -8,4 +8,4 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub type T = f32; \ No newline at end of file +pub type T = f32; diff --git a/src/test/run-pass/module-polymorphism3-files/float-template/inst_f64.rs b/src/test/run-pass/module-polymorphism3-files/float-template/inst_f64.rs index e6222cabae64c..543d672b0ab37 100644 --- a/src/test/run-pass/module-polymorphism3-files/float-template/inst_f64.rs +++ b/src/test/run-pass/module-polymorphism3-files/float-template/inst_f64.rs @@ -8,4 +8,4 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub type T = f64; \ No newline at end of file +pub type T = f64; diff --git a/src/test/run-pass/module-polymorphism3-files/float-template/inst_float.rs b/src/test/run-pass/module-polymorphism3-files/float-template/inst_float.rs index ad504f79863cd..7151796c8ece1 100644 --- a/src/test/run-pass/module-polymorphism3-files/float-template/inst_float.rs +++ b/src/test/run-pass/module-polymorphism3-files/float-template/inst_float.rs @@ -8,4 +8,4 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub type T = float; \ No newline at end of file +pub type T = float; diff --git a/src/test/run-pass/monad.rs b/src/test/run-pass/monad.rs index b5c6d8353745a..9447330fe07ed 100644 --- a/src/test/run-pass/monad.rs +++ b/src/test/run-pass/monad.rs @@ -15,7 +15,7 @@ trait vec_monad { fn bind(f: fn(A) -> ~[B]) -> ~[B]; } -impl ~[A]: vec_monad { +impl vec_monad for ~[A] { fn bind(f: fn(A) -> ~[B]) -> ~[B] { let mut r = ~[]; for self.each |elt| { r += f(*elt); } @@ -27,7 +27,7 @@ trait option_monad { fn bind(f: fn(A) -> Option) -> Option; } -impl Option: option_monad { +impl option_monad for Option { fn bind(f: fn(A) -> Option) -> Option { match self { Some(ref a) => { f(*a) } diff --git a/src/test/run-pass/monomorphize-trait-in-fn-at.rs b/src/test/run-pass/monomorphize-trait-in-fn-at.rs index bce5bb9cadee0..3c491a7f69573 100644 --- a/src/test/run-pass/monomorphize-trait-in-fn-at.rs +++ b/src/test/run-pass/monomorphize-trait-in-fn-at.rs @@ -20,7 +20,7 @@ trait ty_ops { fn mk() -> uint; } -impl (): ty_ops { +impl ty_ops for () { fn mk() -> uint { 22u } } @@ -29,4 +29,4 @@ pub fn main() { mk_nil(()) }; assert fn_env() == 22u; -} \ No newline at end of file +} diff --git a/src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs b/src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs index 72933f18d6f74..57f7a3f24db21 100644 --- a/src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs +++ b/src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs @@ -17,19 +17,19 @@ trait Serializable { fn serialize(s: S); } -impl int: Serializable { +impl Serializable for int { fn serialize(_s: S) { } } struct F { a: A } -impl F: Serializable { +impl Serializable for F { fn serialize(s: S) { self.a.serialize(move s); } } -impl io::Writer: Serializer { +impl Serializer for io::Writer { } pub fn main() { diff --git a/src/test/run-pass/morestack1.rs b/src/test/run-pass/morestack1.rs index c31dae404c6df..775bbc883f6d8 100644 --- a/src/test/run-pass/morestack1.rs +++ b/src/test/run-pass/morestack1.rs @@ -16,4 +16,4 @@ fn getbig(i: int) { pub fn main() { getbig(100000); -} \ No newline at end of file +} diff --git a/src/test/run-pass/morestack2.rs b/src/test/run-pass/morestack2.rs index 5b2c016d44bda..e3e2a788230a7 100644 --- a/src/test/run-pass/morestack2.rs +++ b/src/test/run-pass/morestack2.rs @@ -21,4 +21,4 @@ fn getbig(i: int) -> int { pub fn main() { getbig(10000); -} \ No newline at end of file +} diff --git a/src/test/run-pass/morestack3.rs b/src/test/run-pass/morestack3.rs index 717536a2fbcab..748d765f2c371 100644 --- a/src/test/run-pass/morestack3.rs +++ b/src/test/run-pass/morestack3.rs @@ -49,4 +49,4 @@ fn getbig(a0: int, pub fn main() { let a = 10000; getbig(a, a+1, a+2, a+3, a+4, a+5, a+6, a+7, a+8, a+9); -} \ No newline at end of file +} diff --git a/src/test/run-pass/morestack4.rs b/src/test/run-pass/morestack4.rs index 8f9a257541219..82d4279ed2b96 100644 --- a/src/test/run-pass/morestack4.rs +++ b/src/test/run-pass/morestack4.rs @@ -104,4 +104,4 @@ pub fn main() { a38: 10000u64, a39: 10000u64, }); -} \ No newline at end of file +} diff --git a/src/test/run-pass/morestack5.rs b/src/test/run-pass/morestack5.rs index c0407b6e786f8..1d232cc5cbd8d 100644 --- a/src/test/run-pass/morestack5.rs +++ b/src/test/run-pass/morestack5.rs @@ -24,4 +24,4 @@ pub fn main() { task::try(|| getbig(200) ); sz += 1u; } -} \ No newline at end of file +} diff --git a/src/test/run-pass/move-nullary-fn.rs b/src/test/run-pass/move-nullary-fn.rs index 77d4d2ccb3629..0aac8857c598d 100644 --- a/src/test/run-pass/move-nullary-fn.rs +++ b/src/test/run-pass/move-nullary-fn.rs @@ -17,4 +17,4 @@ fn f(-thing: fn@()) { pub fn main() { f(fn@() {}); -} \ No newline at end of file +} diff --git a/src/test/run-pass/mut-function-arguments.rs b/src/test/run-pass/mut-function-arguments.rs index ffa18e040e7e7..8d3f28fb3dcf2 100644 --- a/src/test/run-pass/mut-function-arguments.rs +++ b/src/test/run-pass/mut-function-arguments.rs @@ -24,4 +24,4 @@ pub fn main() { let z = ~17; f(z); g(); -} \ No newline at end of file +} diff --git a/src/test/run-pass/operator-overloading.rs b/src/test/run-pass/operator-overloading.rs index 1ffdc6a21ca66..3c6a347137752 100644 --- a/src/test/run-pass/operator-overloading.rs +++ b/src/test/run-pass/operator-overloading.rs @@ -16,37 +16,37 @@ struct Point { y: int } -impl Point : ops::Add { +impl ops::Add for Point { pure fn add(&self, other: &Point) -> Point { Point {x: self.x + (*other).x, y: self.y + (*other).y} } } -impl Point : ops::Sub { +impl ops::Sub for Point { pure fn sub(&self, other: &Point) -> Point { Point {x: self.x - (*other).x, y: self.y - (*other).y} } } -impl Point : ops::Neg { +impl ops::Neg for Point { pure fn neg(&self) -> Point { Point {x: -self.x, y: -self.y} } } -impl Point : ops::Not { +impl ops::Not for Point { pure fn not(&self) -> Point { Point {x: !self.x, y: !self.y } } } -impl Point : ops::Index { +impl ops::Index for Point { pure fn index(&self, +x: bool) -> int { if x { self.x } else { self.y } } } -impl Point : cmp::Eq { +impl cmp::Eq for Point { pure fn eq(&self, other: &Point) -> bool { (*self).x == (*other).x && (*self).y == (*other).y } diff --git a/src/test/run-pass/option-unwrap.rs b/src/test/run-pass/option-unwrap.rs index c0095b5296509..9f787c915e59d 100644 --- a/src/test/run-pass/option-unwrap.rs +++ b/src/test/run-pass/option-unwrap.rs @@ -13,7 +13,7 @@ struct dtor { } -impl dtor : Drop { +impl Drop for dtor { fn finalize(&self) { // abuse access to shared mutable state to write this code *self.x -= 1; diff --git a/src/test/run-pass/propagate-expected-type-through-block.rs b/src/test/run-pass/propagate-expected-type-through-block.rs index 525535dd13997..d41e629b5da53 100644 --- a/src/test/run-pass/propagate-expected-type-through-block.rs +++ b/src/test/run-pass/propagate-expected-type-through-block.rs @@ -9,4 +9,4 @@ pub fn main() { |x| *x + *y }; assert foo(@22) == 25; -} \ No newline at end of file +} diff --git a/src/test/run-pass/pure-sum.rs b/src/test/run-pass/pure-sum.rs index 19957a67c0415..f4c92c869e46e 100644 --- a/src/test/run-pass/pure-sum.rs +++ b/src/test/run-pass/pure-sum.rs @@ -49,4 +49,4 @@ pure fn sums_to_using_uniq_rec(v: ~[int], sum: int) -> bool { } pub fn main() { -} \ No newline at end of file +} diff --git a/src/test/run-pass/rcvr-borrowed-to-region.rs b/src/test/run-pass/rcvr-borrowed-to-region.rs index 7f8e9cfdd6905..61cb473bf8fb2 100644 --- a/src/test/run-pass/rcvr-borrowed-to-region.rs +++ b/src/test/run-pass/rcvr-borrowed-to-region.rs @@ -13,7 +13,7 @@ trait get { } // Note: impl on a slice -impl &int: get { +impl get for &int { fn get() -> int { return *self; } diff --git a/src/test/run-pass/rcvr-borrowed-to-slice.rs b/src/test/run-pass/rcvr-borrowed-to-slice.rs index 51f4b4c953d0c..6073295336049 100644 --- a/src/test/run-pass/rcvr-borrowed-to-slice.rs +++ b/src/test/run-pass/rcvr-borrowed-to-slice.rs @@ -13,7 +13,7 @@ trait sum { } // Note: impl on a slice -impl &[int]: sum { +impl sum for &[int] { fn sum() -> int { let mut sum = 0; for vec::each(self) |e| { sum += *e; } diff --git a/src/test/run-pass/recursion.rs b/src/test/run-pass/recursion.rs index 77c0872b7c400..092cd3d8ed5bb 100644 --- a/src/test/run-pass/recursion.rs +++ b/src/test/run-pass/recursion.rs @@ -12,10 +12,10 @@ enum Nil {Nil} struct Cons {head:int, tail:T} trait Dot {fn dot(other:self) -> int;} -impl Nil:Dot { +impl Dot for Nil { fn dot(_:Nil) -> int {0} } -impl Cons:Dot { +impl Dot for Cons { fn dot(other:Cons) -> int { self.head * other.head + self.tail.dot(other.tail) } diff --git a/src/test/run-pass/reflect-visit-data.rs b/src/test/run-pass/reflect-visit-data.rs index 96bddf7099b8e..d6470ad72b04e 100644 --- a/src/test/run-pass/reflect-visit-data.rs +++ b/src/test/run-pass/reflect-visit-data.rs @@ -59,7 +59,7 @@ impl ptr_visit_adaptor { } -impl ptr_visit_adaptor: TyVisitor { +impl TyVisitor for ptr_visit_adaptor { fn visit_bot(&self) -> bool { self.align_to::<()>(); @@ -498,14 +498,14 @@ impl my_visitor { struct Inner { inner: V } -impl my_visitor: movable_ptr { +impl movable_ptr for my_visitor { fn move_ptr(adjustment: fn(*c_void) -> *c_void) { self.ptr1 = adjustment(self.ptr1); self.ptr2 = adjustment(self.ptr2); } } -impl my_visitor: TyVisitor { +impl TyVisitor for my_visitor { fn visit_bot(&self) -> bool { true } fn visit_nil(&self) -> bool { true } diff --git a/src/test/run-pass/reflect-visit-type.rs b/src/test/run-pass/reflect-visit-type.rs index 9c8c65698b3a1..6b57c73d0f276 100644 --- a/src/test/run-pass/reflect-visit-type.rs +++ b/src/test/run-pass/reflect-visit-type.rs @@ -12,7 +12,7 @@ use intrinsic::{TyDesc, get_tydesc, visit_tydesc, TyVisitor}; enum my_visitor = @{ mut types: ~[str] }; -impl my_visitor: TyVisitor { +impl TyVisitor for my_visitor { fn visit_bot() -> bool { self.types += ~["bot"]; error!("visited bot type"); diff --git a/src/test/run-pass/regions-creating-enums2.rs b/src/test/run-pass/regions-creating-enums2.rs index 2245bd72f880b..9daec577cfa26 100644 --- a/src/test/run-pass/regions-creating-enums2.rs +++ b/src/test/run-pass/regions-creating-enums2.rs @@ -18,4 +18,4 @@ fn mk_add_ok(x: &r/ast, y: &r/ast) -> ast/&r { } pub fn main() { -} \ No newline at end of file +} diff --git a/src/test/run-pass/regions-creating-enums5.rs b/src/test/run-pass/regions-creating-enums5.rs index 959a40055fd38..943ec3f9cb749 100644 --- a/src/test/run-pass/regions-creating-enums5.rs +++ b/src/test/run-pass/regions-creating-enums5.rs @@ -18,4 +18,4 @@ fn mk_add_ok(x: &a/ast, y: &a/ast, z: &ast) -> ast/&a { } pub fn main() { -} \ No newline at end of file +} diff --git a/src/test/run-pass/regions-infer-call-2.rs b/src/test/run-pass/regions-infer-call-2.rs index 940c087ea62ac..b84de89feb818 100644 --- a/src/test/run-pass/regions-infer-call-2.rs +++ b/src/test/run-pass/regions-infer-call-2.rs @@ -20,4 +20,4 @@ fn has_one(x: &a/int) -> int { pub fn main() { assert has_one(&2) == 22; -} \ No newline at end of file +} diff --git a/src/test/run-pass/regions-infer-call.rs b/src/test/run-pass/regions-infer-call.rs index d546bed4fde74..12f631755a904 100644 --- a/src/test/run-pass/regions-infer-call.rs +++ b/src/test/run-pass/regions-infer-call.rs @@ -16,4 +16,4 @@ fn has_two(x: &a/int, y: &b/int) -> int { pub fn main() { assert has_two(&20, &2) == 22; -} \ No newline at end of file +} diff --git a/src/test/run-pass/regions-infer-contravariance-due-to-ret.rs b/src/test/run-pass/regions-infer-contravariance-due-to-ret.rs index 414f12bf3da4e..d2a91db6bb8e8 100644 --- a/src/test/run-pass/regions-infer-contravariance-due-to-ret.rs +++ b/src/test/run-pass/regions-infer-contravariance-due-to-ret.rs @@ -25,4 +25,4 @@ pub fn main() { let g = 21; let foo = boxed_int { f: &g }; assert with(&foo) == 22; -} \ No newline at end of file +} diff --git a/src/test/run-pass/regions-infer-contravariance.rs b/src/test/run-pass/regions-infer-contravariance.rs index eccc75ed11f0e..11a24fdc96272 100644 --- a/src/test/run-pass/regions-infer-contravariance.rs +++ b/src/test/run-pass/regions-infer-contravariance.rs @@ -28,4 +28,4 @@ pub fn main() { let g = 22; let foo = boxed_int { f: &g }; with(&foo); -} \ No newline at end of file +} diff --git a/src/test/run-pass/regions-nullary-variant.rs b/src/test/run-pass/regions-nullary-variant.rs index ac416dd446846..27dc2dea40d4d 100644 --- a/src/test/run-pass/regions-nullary-variant.rs +++ b/src/test/run-pass/regions-nullary-variant.rs @@ -16,4 +16,4 @@ fn mk(cond: bool, ptr: &r/uint) -> roption/&r { if cond {a} else {b(ptr)} } -pub fn main() {} \ No newline at end of file +pub fn main() {} diff --git a/src/test/run-pass/regions-self-impls.rs b/src/test/run-pass/regions-self-impls.rs index 40c83a1708969..7b07a8cf1af4d 100644 --- a/src/test/run-pass/regions-self-impls.rs +++ b/src/test/run-pass/regions-self-impls.rs @@ -14,7 +14,7 @@ trait get_chowder { fn get_chowder() -> &self/int; } -impl Clam: get_chowder { +impl get_chowder for Clam { fn get_chowder() -> &self/int { return self.chowder; } } diff --git a/src/test/run-pass/regions-trait.rs b/src/test/run-pass/regions-trait.rs index 86da7c722ff30..e45a0d252c668 100644 --- a/src/test/run-pass/regions-trait.rs +++ b/src/test/run-pass/regions-trait.rs @@ -16,7 +16,7 @@ trait get_ctxt { struct HasCtxt { c: &Ctxt } -impl HasCtxt: get_ctxt { +impl get_ctxt for HasCtxt { fn get_ctxt() -> &self/Ctxt { self.c } diff --git a/src/test/run-pass/resource-assign-is-not-copy.rs b/src/test/run-pass/resource-assign-is-not-copy.rs index 9de6fbebf85a5..ee28c96defcad 100644 --- a/src/test/run-pass/resource-assign-is-not-copy.rs +++ b/src/test/run-pass/resource-assign-is-not-copy.rs @@ -12,7 +12,7 @@ struct r { i: @mut int, } -impl r : Drop { +impl Drop for r { fn finalize(&self) { *(self.i) += 1; } diff --git a/src/test/run-pass/resource-cycle.rs b/src/test/run-pass/resource-cycle.rs index fa9832125b3f7..fb9a1e8117a5b 100644 --- a/src/test/run-pass/resource-cycle.rs +++ b/src/test/run-pass/resource-cycle.rs @@ -14,7 +14,7 @@ struct r { v: *int, } -impl r : Drop { +impl Drop for r { fn finalize(&self) { unsafe { debug!("r's dtor: self = %x, self.v = %x, self.v's value = %x", diff --git a/src/test/run-pass/resource-cycle2.rs b/src/test/run-pass/resource-cycle2.rs index 0b7179cc819ca..eea5c43bb9955 100644 --- a/src/test/run-pass/resource-cycle2.rs +++ b/src/test/run-pass/resource-cycle2.rs @@ -20,7 +20,7 @@ struct r { v: U, } -impl r : Drop { +impl Drop for r { fn finalize(&self) { unsafe { let v2: ~int = cast::reinterpret_cast(&self.v.c); diff --git a/src/test/run-pass/resource-cycle3.rs b/src/test/run-pass/resource-cycle3.rs index 4bec2f10f9899..544d82e799544 100644 --- a/src/test/run-pass/resource-cycle3.rs +++ b/src/test/run-pass/resource-cycle3.rs @@ -24,7 +24,7 @@ struct R { x: *int, } -impl R : Drop { +impl Drop for R { fn finalize(&self) { unsafe { let _v2: ~int = cast::reinterpret_cast(&self.v.c); diff --git a/src/test/run-pass/resource-destruct.rs b/src/test/run-pass/resource-destruct.rs index 6d4ddd1304193..7b5456e21898c 100644 --- a/src/test/run-pass/resource-destruct.rs +++ b/src/test/run-pass/resource-destruct.rs @@ -12,7 +12,7 @@ struct shrinky_pointer { i: @@mut int, } -impl shrinky_pointer : Drop { +impl Drop for shrinky_pointer { fn finalize(&self) { log(error, ~"Hello!"); **(self.i) -= 1; } diff --git a/src/test/run-pass/resource-generic.rs b/src/test/run-pass/resource-generic.rs index 86e023c4e8a11..17ce27fa60ad1 100644 --- a/src/test/run-pass/resource-generic.rs +++ b/src/test/run-pass/resource-generic.rs @@ -17,7 +17,7 @@ struct finish { arg: Arg } -impl finish : Drop { +impl Drop for finish { fn finalize(&self) { (self.arg.fin)(self.arg.val); } diff --git a/src/test/run-pass/resource-in-struct.rs b/src/test/run-pass/resource-in-struct.rs index 50e60cb0f377f..54b543c7c3f46 100644 --- a/src/test/run-pass/resource-in-struct.rs +++ b/src/test/run-pass/resource-in-struct.rs @@ -18,7 +18,7 @@ struct close_res { } -impl close_res : Drop { +impl Drop for close_res { fn finalize(&self) { *(self.i) = false; } diff --git a/src/test/run-pass/self-type-param.rs b/src/test/run-pass/self-type-param.rs index d0d20d096b4ec..0af197968040f 100644 --- a/src/test/run-pass/self-type-param.rs +++ b/src/test/run-pass/self-type-param.rs @@ -6,7 +6,7 @@ struct S { x: int } -impl S : MyTrait { +impl MyTrait for S { fn f(&self) -> S { S { x: 3 } } diff --git a/src/test/run-pass/send-resource.rs b/src/test/run-pass/send-resource.rs index 11d1af2b39975..ac910232c16bf 100644 --- a/src/test/run-pass/send-resource.rs +++ b/src/test/run-pass/send-resource.rs @@ -14,7 +14,7 @@ struct test { f: int, } -impl test : Drop { +impl Drop for test { fn finalize(&self) {} } diff --git a/src/test/run-pass/sendable-class.rs b/src/test/run-pass/sendable-class.rs index a5691e289d700..19169c168c2cf 100644 --- a/src/test/run-pass/sendable-class.rs +++ b/src/test/run-pass/sendable-class.rs @@ -25,4 +25,4 @@ fn foo(i:int, j: char) -> foo { pub fn main() { let (_po, ch) = pipes::stream(); ch.send(foo(42, 'c')); -} \ No newline at end of file +} diff --git a/src/test/run-pass/static-impl.rs b/src/test/run-pass/static-impl.rs index 2aeabcf48727a..870059d1edc52 100644 --- a/src/test/run-pass/static-impl.rs +++ b/src/test/run-pass/static-impl.rs @@ -30,7 +30,7 @@ trait uint_utils { fn multi(f: fn(uint)); } -impl uint: uint_utils { +impl uint_utils for uint { fn str() -> ~str { uint::str(self) } fn multi(f: fn(uint)) { let mut c = 0u; @@ -44,7 +44,7 @@ trait vec_utils { fn map_(f: fn(T) -> U) -> ~[U]; } -impl ~[T]: vec_utils { +impl vec_utils for ~[T] { fn length_() -> uint { vec::len(self) } fn iter_(f: fn(T)) { for self.each |x| { f(*x); } } fn map_(f: fn(T) -> U) -> ~[U] { 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 bf70b86a4c66e..328a937b441fe 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 @@ -16,7 +16,7 @@ trait Deserializable { static fn deserialize(d: &D) -> Self; } -impl int: Deserializable { +impl Deserializable for int { static fn deserialize(d: &D) -> int { return d.read_int(); } @@ -24,7 +24,7 @@ impl int: Deserializable { struct FromThinAir { dummy: () } -impl FromThinAir: Deserializer { +impl Deserializer for FromThinAir { fn read_int() -> int { 22 } } diff --git a/src/test/run-pass/static-method-test.rs b/src/test/run-pass/static-method-test.rs index 28bdcddb3adbb..3402da6c55c9d 100644 --- a/src/test/run-pass/static-method-test.rs +++ b/src/test/run-pass/static-method-test.rs @@ -21,13 +21,13 @@ fn andand(x1: T, x2: T) -> T { bool_like::select(x1, x2, x1) } -impl bool: bool_like { +impl bool_like for bool { static fn select(&&b: bool, +x1: A, +x2: A) -> A { if b { move x1 } else { move x2 } } } -impl int: bool_like { +impl bool_like for int { static fn select(&&b: int, +x1: A, +x2: A) -> A { if b != 0 { move x1 } else { move x2 } } @@ -40,14 +40,14 @@ trait buildable { } -impl @[A]: buildable { +impl buildable for @[A] { #[inline(always)] static pure fn build_sized(size: uint, builder: fn(push: pure fn(+v: A))) -> @[A] { at_vec::build_sized(size, builder) } } -impl ~[A]: buildable { +impl buildable for ~[A] { #[inline(always)] static pure fn build_sized(size: uint, builder: fn(push: pure fn(+v: A))) -> ~[A] { diff --git a/src/test/run-pass/static-methods-in-traits.rs b/src/test/run-pass/static-methods-in-traits.rs index d144181984fe6..63d25240df86d 100644 --- a/src/test/run-pass/static-methods-in-traits.rs +++ b/src/test/run-pass/static-methods-in-traits.rs @@ -13,13 +13,13 @@ mod a { static pub fn foo() -> Self; } - impl int : Foo { + impl Foo for int { static pub fn foo() -> int { 3 } } - impl uint : Foo { + impl Foo for uint { static pub fn foo() -> uint { 5u } diff --git a/src/test/run-pass/struct-literal-dtor.rs b/src/test/run-pass/struct-literal-dtor.rs index 668e7a80b35f6..9f5b8cf27dd4f 100644 --- a/src/test/run-pass/struct-literal-dtor.rs +++ b/src/test/run-pass/struct-literal-dtor.rs @@ -12,7 +12,7 @@ struct foo { x: ~str, } -impl foo : Drop { +impl Drop for foo { fn finalize(&self) { error!("%s", self.x); } diff --git a/src/test/run-pass/structured-compare.rs b/src/test/run-pass/structured-compare.rs index 17a4c904470e5..a11608bc52e91 100644 --- a/src/test/run-pass/structured-compare.rs +++ b/src/test/run-pass/structured-compare.rs @@ -12,7 +12,7 @@ enum foo { large, small, } -impl foo : cmp::Eq { +impl cmp::Eq for foo { pure fn eq(&self, other: &foo) -> bool { ((*self) as uint) == ((*other) as uint) } diff --git a/src/test/run-pass/tag-variant-disr-val.rs b/src/test/run-pass/tag-variant-disr-val.rs index c573ee376c7c0..d7571b3a47b66 100644 --- a/src/test/run-pass/tag-variant-disr-val.rs +++ b/src/test/run-pass/tag-variant-disr-val.rs @@ -19,7 +19,7 @@ enum color { orange = 8 >> 1 } -impl color : cmp::Eq { +impl cmp::Eq for color { pure fn eq(&self, other: &color) -> bool { ((*self) as uint) == ((*other) as uint) } diff --git a/src/test/run-pass/tag.rs b/src/test/run-pass/tag.rs index e74237c749443..e9e7fdeaddff2 100644 --- a/src/test/run-pass/tag.rs +++ b/src/test/run-pass/tag.rs @@ -14,7 +14,7 @@ // -*- rust -*- enum colour { red(int, int), green, } -impl colour : cmp::Eq { +impl cmp::Eq for colour { pure fn eq(&self, other: &colour) -> bool { match *self { red(a0, b0) => { diff --git a/src/test/run-pass/task-comm-16.rs b/src/test/run-pass/task-comm-16.rs index 91925fc19172f..afc9290b62db7 100644 --- a/src/test/run-pass/task-comm-16.rs +++ b/src/test/run-pass/task-comm-16.rs @@ -56,7 +56,7 @@ enum t { tag3(int, u8, char) } -impl t : cmp::Eq { +impl cmp::Eq for t { pure fn eq(&self, other: &t) -> bool { match *self { tag1 => { diff --git a/src/test/run-pass/task-comm-17.rs b/src/test/run-pass/task-comm-17.rs index e146afa3a0fd2..58fa65b7fe7a1 100644 --- a/src/test/run-pass/task-comm-17.rs +++ b/src/test/run-pass/task-comm-17.rs @@ -19,4 +19,4 @@ fn f() { pub fn main() { task::spawn(|| f() ); -} \ No newline at end of file +} diff --git a/src/test/run-pass/task-killjoin-rsrc.rs b/src/test/run-pass/task-killjoin-rsrc.rs index 3af59a09ad04a..ca60dfd3de009 100644 --- a/src/test/run-pass/task-killjoin-rsrc.rs +++ b/src/test/run-pass/task-killjoin-rsrc.rs @@ -19,7 +19,7 @@ struct notify { ch: Chan, v: @mut bool, } -impl notify : Drop { +impl Drop for notify { fn finalize(&self) { error!("notify: task=%? v=%x unwinding=%b b=%b", task::get_task(), diff --git a/src/test/run-pass/test-ignore-cfg.rs b/src/test/run-pass/test-ignore-cfg.rs index 6028d8c71d31b..b045dc3074d59 100644 --- a/src/test/run-pass/test-ignore-cfg.rs +++ b/src/test/run-pass/test-ignore-cfg.rs @@ -35,4 +35,4 @@ fn checktests() { assert vec::any( tests, |t| t.desc.name.to_str() == ~"shouldnotignore" && !t.desc.ignore); -} \ No newline at end of file +} diff --git a/src/test/run-pass/trait-bounds.rs b/src/test/run-pass/trait-bounds.rs index 8c737428ba977..2e093d6d63163 100644 --- a/src/test/run-pass/trait-bounds.rs +++ b/src/test/run-pass/trait-bounds.rs @@ -19,11 +19,11 @@ trait connection_factory { type my_connection = (); type my_connection_factory = (); -impl (): connection { +impl connection for () { fn read() -> int { 43 } } -impl my_connection_factory: connection_factory { +impl connection_factory for my_connection_factory { fn create() -> my_connection { () } } diff --git a/src/test/run-pass/trait-cast.rs b/src/test/run-pass/trait-cast.rs index cfb0096f97f55..62d1c00eea944 100644 --- a/src/test/run-pass/trait-cast.rs +++ b/src/test/run-pass/trait-cast.rs @@ -21,7 +21,7 @@ trait to_str { fn to_str() -> ~str; } -impl Option: to_str { +impl to_str for Option { fn to_str() -> ~str { match self { None => { ~"none" } @@ -30,11 +30,11 @@ impl Option: to_str { } } -impl int: to_str { +impl to_str for int { fn to_str() -> ~str { int::str(self) } } -impl Tree: to_str { +impl to_str for Tree { fn to_str() -> ~str { let l = self.left, r = self.right; fmt!("[%s, %s, %s]", self.val.to_str(), diff --git a/src/test/run-pass/trait-default-method-bound-subst.rs b/src/test/run-pass/trait-default-method-bound-subst.rs index 18b328d536810..3f69a2e5d909b 100644 --- a/src/test/run-pass/trait-default-method-bound-subst.rs +++ b/src/test/run-pass/trait-default-method-bound-subst.rs @@ -14,7 +14,7 @@ trait A { fn g(x: T, y: U) -> (T, U) { (move x, move y) } } -impl int: A { } +impl A for int { } fn f>(i: V, j: T, k: U) -> (T, U) { i.g(move j, move k) diff --git a/src/test/run-pass/trait-default-method-bound-subst2.rs b/src/test/run-pass/trait-default-method-bound-subst2.rs index 34d210b06accb..fcb9f60d762c8 100644 --- a/src/test/run-pass/trait-default-method-bound-subst2.rs +++ b/src/test/run-pass/trait-default-method-bound-subst2.rs @@ -14,7 +14,7 @@ trait A { fn g(x: T) -> T { move x } } -impl int: A { } +impl A for int { } fn f>(i: V, j: T) -> T { i.g(move j) diff --git a/src/test/run-pass/trait-default-method-bound-subst3.rs b/src/test/run-pass/trait-default-method-bound-subst3.rs index adf07818e0c8a..c89d4abe3dae7 100644 --- a/src/test/run-pass/trait-default-method-bound-subst3.rs +++ b/src/test/run-pass/trait-default-method-bound-subst3.rs @@ -14,7 +14,7 @@ trait A { fn g(x: T, y: T) -> (T, T) { (move x, move y) } } -impl int: A { } +impl A for int { } fn f(i: V, j: T, k: T) -> (T, T) { i.g(move j, move k) diff --git a/src/test/run-pass/trait-default-method-bound-subst4.rs b/src/test/run-pass/trait-default-method-bound-subst4.rs index 0b34691ff6eda..7a6dfa33a1ac4 100644 --- a/src/test/run-pass/trait-default-method-bound-subst4.rs +++ b/src/test/run-pass/trait-default-method-bound-subst4.rs @@ -14,7 +14,7 @@ trait A { fn g(x: uint) -> uint { move x } } -impl int: A { } +impl A for int { } fn f>(i: V, j: uint) -> uint { i.g(move j) diff --git a/src/test/run-pass/trait-default-method-bound.rs b/src/test/run-pass/trait-default-method-bound.rs index 28e15e094965b..b28884e5fbc7e 100644 --- a/src/test/run-pass/trait-default-method-bound.rs +++ b/src/test/run-pass/trait-default-method-bound.rs @@ -14,7 +14,7 @@ trait A { fn g() -> int { 10 } } -impl int: A { } +impl A for int { } fn f(i: T) { assert i.g() == 10; diff --git a/src/test/run-pass/trait-generic.rs b/src/test/run-pass/trait-generic.rs index 8a8efb4b991f1..80b1b1eba39ef 100644 --- a/src/test/run-pass/trait-generic.rs +++ b/src/test/run-pass/trait-generic.rs @@ -14,20 +14,20 @@ trait to_str { fn to_str() -> ~str; } -impl int: to_str { +impl to_str for int { fn to_str() -> ~str { int::str(self) } } -impl ~str: to_str { +impl to_str for ~str { fn to_str() -> ~str { copy self } } -impl (): to_str { +impl to_str for () { fn to_str() -> ~str { ~"()" } } trait map { fn map(f: fn(T) -> U) -> ~[U]; } -impl ~[T]: map { +impl map for ~[T] { fn map(f: fn(T) -> U) -> ~[U] { let mut r = ~[]; for self.each |x| { r += ~[f(*x)]; } diff --git a/src/test/run-pass/trait-inheritance-auto-xc-2.rs b/src/test/run-pass/trait-inheritance-auto-xc-2.rs index 105cf9ba2abf6..b8e060ee91431 100644 --- a/src/test/run-pass/trait-inheritance-auto-xc-2.rs +++ b/src/test/run-pass/trait-inheritance-auto-xc-2.rs @@ -18,7 +18,7 @@ use aux::{Foo, Bar, Baz, A}; // We want to extend all Foo, Bar, Bazes to Quuxes pub trait Quux: Foo Bar Baz { } -impl T: Quux { } +impl Quux for T { } fn f(a: &T) { assert a.f() == 10; diff --git a/src/test/run-pass/trait-inheritance-auto-xc.rs b/src/test/run-pass/trait-inheritance-auto-xc.rs index 5856d48aec420..f0fa291f00c15 100644 --- a/src/test/run-pass/trait-inheritance-auto-xc.rs +++ b/src/test/run-pass/trait-inheritance-auto-xc.rs @@ -17,9 +17,9 @@ use aux::{Foo, Bar, Baz, Quux}; struct A { x: int } -impl A : Foo { fn f() -> int { 10 } } -impl A : Bar { fn g() -> int { 20 } } -impl A : Baz { fn h() -> int { 30 } } +impl Foo for A { fn f() -> int { 10 } } +impl Bar for A { fn g() -> int { 20 } } +impl Baz for A { fn h() -> int { 30 } } fn f(a: &T) { assert a.f() == 10; diff --git a/src/test/run-pass/trait-inheritance-auto.rs b/src/test/run-pass/trait-inheritance-auto.rs index c07c03c108da5..84e498c8ffd11 100644 --- a/src/test/run-pass/trait-inheritance-auto.rs +++ b/src/test/run-pass/trait-inheritance-auto.rs @@ -10,7 +10,7 @@ // Testing that this impl turns A into a Quux, because // A is already a Foo Bar Baz -impl T: Quux { } +impl Quux for T { } trait Foo { fn f() -> int; } trait Bar { fn g() -> int; } @@ -20,9 +20,9 @@ trait Quux: Foo Bar Baz { } struct A { x: int } -impl A : Foo { fn f() -> int { 10 } } -impl A : Bar { fn g() -> int { 20 } } -impl A : Baz { fn h() -> int { 30 } } +impl Foo for A { fn f() -> int { 10 } } +impl Bar for A { fn g() -> int { 20 } } +impl Baz for A { fn h() -> int { 30 } } fn f(a: &T) { assert a.f() == 10; diff --git a/src/test/run-pass/trait-inheritance-call-bound-inherited.rs b/src/test/run-pass/trait-inheritance-call-bound-inherited.rs index 8a3e81c3fdb71..f02145896be7b 100644 --- a/src/test/run-pass/trait-inheritance-call-bound-inherited.rs +++ b/src/test/run-pass/trait-inheritance-call-bound-inherited.rs @@ -13,8 +13,8 @@ trait Bar : Foo { fn g() -> int; } struct A { x: int } -impl A : Foo { fn f() -> int { 10 } } -impl A : Bar { fn g() -> int { 20 } } +impl Foo for A { fn f() -> int { 10 } } +impl Bar for A { fn g() -> int { 20 } } // Call a function on Foo, given a T: Bar fn gg(a: &T) -> int { diff --git a/src/test/run-pass/trait-inheritance-call-bound-inherited2.rs b/src/test/run-pass/trait-inheritance-call-bound-inherited2.rs index a6bac1a058355..45498996ba552 100644 --- a/src/test/run-pass/trait-inheritance-call-bound-inherited2.rs +++ b/src/test/run-pass/trait-inheritance-call-bound-inherited2.rs @@ -14,9 +14,9 @@ trait Baz : Bar { fn h() -> int; } struct A { x: int } -impl A : Foo { fn f() -> int { 10 } } -impl A : Bar { fn g() -> int { 20 } } -impl A : Baz { fn h() -> int { 30 } } +impl Foo for A { fn f() -> int { 10 } } +impl Bar for A { fn g() -> int { 20 } } +impl Baz for A { fn h() -> int { 30 } } // Call a function on Foo, given a T: Baz, // which is inherited via Bar diff --git a/src/test/run-pass/trait-inheritance-cast-without-call-to-supertrait.rs b/src/test/run-pass/trait-inheritance-cast-without-call-to-supertrait.rs index 1ef250f215c18..caa69382e13cf 100644 --- a/src/test/run-pass/trait-inheritance-cast-without-call-to-supertrait.rs +++ b/src/test/run-pass/trait-inheritance-cast-without-call-to-supertrait.rs @@ -23,11 +23,11 @@ struct A { x: int } -impl A : Foo { +impl Foo for A { fn f() -> int { 10 } } -impl A : Bar { +impl Bar for A { fn g() -> int { 20 } } diff --git a/src/test/run-pass/trait-inheritance-cast.rs b/src/test/run-pass/trait-inheritance-cast.rs index 2fbfaf483e94f..1cfc091c24943 100644 --- a/src/test/run-pass/trait-inheritance-cast.rs +++ b/src/test/run-pass/trait-inheritance-cast.rs @@ -24,11 +24,11 @@ struct A { x: int } -impl A : Foo { +impl Foo for A { fn f() -> int { 10 } } -impl A : Bar { +impl Bar for A { fn g() -> int { 20 } } diff --git a/src/test/run-pass/trait-inheritance-cross-trait-call-xc.rs b/src/test/run-pass/trait-inheritance-cross-trait-call-xc.rs index ce0a5fe5465fb..f537357d3ce15 100644 --- a/src/test/run-pass/trait-inheritance-cross-trait-call-xc.rs +++ b/src/test/run-pass/trait-inheritance-cross-trait-call-xc.rs @@ -17,7 +17,7 @@ trait Bar : aux::Foo { fn g() -> int; } -impl aux::A : Bar { +impl Bar for aux::A { fn g() -> int { self.f() } } diff --git a/src/test/run-pass/trait-inheritance-cross-trait-call.rs b/src/test/run-pass/trait-inheritance-cross-trait-call.rs index 78e258bac48f5..5a1f109ac32cd 100644 --- a/src/test/run-pass/trait-inheritance-cross-trait-call.rs +++ b/src/test/run-pass/trait-inheritance-cross-trait-call.rs @@ -13,9 +13,9 @@ trait Bar : Foo { fn g() -> int; } struct A { x: int } -impl A : Foo { fn f() -> int { 10 } } +impl Foo for A { fn f() -> int { 10 } } -impl A : Bar { +impl Bar for A { // Testing that this impl can call the impl of Foo fn g() -> int { self.f() } } diff --git a/src/test/run-pass/trait-inheritance-diamond.rs b/src/test/run-pass/trait-inheritance-diamond.rs index 4204264135755..1c914ebabc0a2 100644 --- a/src/test/run-pass/trait-inheritance-diamond.rs +++ b/src/test/run-pass/trait-inheritance-diamond.rs @@ -17,10 +17,10 @@ trait D: B C { fn d(&self) -> int; } struct S { bogus: () } -impl S: A { fn a(&self) -> int { 10 } } -impl S: B { fn b(&self) -> int { 20 } } -impl S: C { fn c(&self) -> int { 30 } } -impl S: D { fn d(&self) -> int { 40 } } +impl A for S { fn a(&self) -> int { 10 } } +impl B for S { fn b(&self) -> int { 20 } } +impl C for S { fn c(&self) -> int { 30 } } +impl D for S { fn d(&self) -> int { 40 } } fn f(x: &T) { assert x.a() == 10; @@ -32,4 +32,4 @@ fn f(x: &T) { pub fn main() { let value = &S { bogus: () }; f(value); -} \ No newline at end of file +} diff --git a/src/test/run-pass/trait-inheritance-multiple-inheritors.rs b/src/test/run-pass/trait-inheritance-multiple-inheritors.rs index a293051d360fe..afcf5c87832ac 100644 --- a/src/test/run-pass/trait-inheritance-multiple-inheritors.rs +++ b/src/test/run-pass/trait-inheritance-multiple-inheritors.rs @@ -14,9 +14,9 @@ trait C: A { fn c(&self) -> int; } struct S { bogus: () } -impl S: A { fn a(&self) -> int { 10 } } -impl S: B { fn b(&self) -> int { 20 } } -impl S: C { fn c(&self) -> int { 30 } } +impl A for S { fn a(&self) -> int { 10 } } +impl B for S { fn b(&self) -> int { 20 } } +impl C for S { fn c(&self) -> int { 30 } } // Both B and C inherit from A fn f(x: &T) { @@ -27,4 +27,4 @@ fn f(x: &T) { pub fn main() { f(&S { bogus: () }) -} \ No newline at end of file +} diff --git a/src/test/run-pass/trait-inheritance-multiple-params.rs b/src/test/run-pass/trait-inheritance-multiple-params.rs index 7008b098d8a92..a91a40ce2212a 100644 --- a/src/test/run-pass/trait-inheritance-multiple-params.rs +++ b/src/test/run-pass/trait-inheritance-multiple-params.rs @@ -14,9 +14,9 @@ trait C: A { fn c(&self) -> int; } struct S { bogus: () } -impl S: A { fn a(&self) -> int { 10 } } -impl S: B { fn b(&self) -> int { 20 } } -impl S: C { fn c(&self) -> int { 30 } } +impl A for S { fn a(&self) -> int { 10 } } +impl B for S { fn b(&self) -> int { 20 } } +impl C for S { fn c(&self) -> int { 30 } } // Multiple type params, multiple levels of inheritance fn f(x: &X, y: &Y, z: &Z) { @@ -30,4 +30,4 @@ fn f(x: &X, y: &Y, z: &Z) { pub fn main() { let s = &S { bogus: () }; f(s, s, s); -} \ No newline at end of file +} diff --git a/src/test/run-pass/trait-inheritance-overloading-simple.rs b/src/test/run-pass/trait-inheritance-overloading-simple.rs index 70c8981fd3ceb..c41579e360374 100644 --- a/src/test/run-pass/trait-inheritance-overloading-simple.rs +++ b/src/test/run-pass/trait-inheritance-overloading-simple.rs @@ -14,7 +14,7 @@ trait MyNum : Eq { } struct MyInt { val: int } -impl MyInt : Eq { +impl Eq for MyInt { pure fn eq(&self, other: &MyInt) -> bool { self.val == other.val } pure fn ne(&self, other: &MyInt) -> bool { !self.eq(other) } } diff --git a/src/test/run-pass/trait-inheritance-overloading.rs b/src/test/run-pass/trait-inheritance-overloading.rs index 6794e8130e594..56cdb5d31188d 100644 --- a/src/test/run-pass/trait-inheritance-overloading.rs +++ b/src/test/run-pass/trait-inheritance-overloading.rs @@ -14,19 +14,19 @@ trait MyNum : Add Sub Mul Eq { } struct MyInt { val: int } -impl MyInt : Add { +impl Add for MyInt { pure fn add(&self, other: &MyInt) -> MyInt { mi(self.val + other.val) } } -impl MyInt : Sub { +impl Sub for MyInt { pure fn sub(&self, other: &MyInt) -> MyInt { mi(self.val - other.val) } } -impl MyInt : Mul { +impl Mul for MyInt { pure fn mul(&self, other: &MyInt) -> MyInt { mi(self.val * other.val) } } -impl MyInt : Eq { +impl Eq for MyInt { pure fn eq(&self, other: &MyInt) -> bool { self.val == other.val } pure fn ne(&self, other: &MyInt) -> bool { !self.eq(other) } } diff --git a/src/test/run-pass/trait-inheritance-self.rs b/src/test/run-pass/trait-inheritance-self.rs index 3f157f31283c6..02ed518ff6591 100644 --- a/src/test/run-pass/trait-inheritance-self.rs +++ b/src/test/run-pass/trait-inheritance-self.rs @@ -10,13 +10,13 @@ struct S { x: int } -impl S : Foo { +impl Foo for S { fn f(&self, x: &S) { io::println(x.x.to_str()); } } -impl S : Bar { +impl Bar for S { fn g(&self) { self.f(self); } diff --git a/src/test/run-pass/trait-inheritance-simple.rs b/src/test/run-pass/trait-inheritance-simple.rs index b119438240aeb..29e2cb2f173ad 100644 --- a/src/test/run-pass/trait-inheritance-simple.rs +++ b/src/test/run-pass/trait-inheritance-simple.rs @@ -13,8 +13,8 @@ trait Bar : Foo { fn g() -> int; } struct A { x: int } -impl A : Foo { fn f() -> int { 10 } } -impl A : Bar { fn g() -> int { 20 } } +impl Foo for A { fn f() -> int { 10 } } +impl Bar for A { fn g() -> int { 20 } } fn ff(a: &T) -> int { a.f() diff --git a/src/test/run-pass/trait-inheritance-static.rs b/src/test/run-pass/trait-inheritance-static.rs index 4b40d75960985..2659d30c2b975 100644 --- a/src/test/run-pass/trait-inheritance-static.rs +++ b/src/test/run-pass/trait-inheritance-static.rs @@ -16,7 +16,7 @@ pub trait NumExt: MyNum { } struct S { v: int } -impl S: MyNum { +impl MyNum for S { static fn from_int(i: int) -> S { S { v: i @@ -24,7 +24,7 @@ impl S: MyNum { } } -impl S: NumExt { } +impl NumExt for S { } fn greater_than_one() -> T { MyNum::from_int(1) } diff --git a/src/test/run-pass/trait-inheritance-static2.rs b/src/test/run-pass/trait-inheritance-static2.rs index 8967bd91b8bd0..6f706ad0be746 100644 --- a/src/test/run-pass/trait-inheritance-static2.rs +++ b/src/test/run-pass/trait-inheritance-static2.rs @@ -18,9 +18,9 @@ pub trait NumExt: MyEq MyNum { } struct S { v: int } -impl S: MyEq { } +impl MyEq for S { } -impl S: MyNum { +impl MyNum for S { static fn from_int(i: int) -> S { S { v: i @@ -28,7 +28,7 @@ impl S: MyNum { } } -impl S: NumExt { } +impl NumExt for S { } fn greater_than_one() -> T { MyNum::from_int(1) } diff --git a/src/test/run-pass/trait-inheritance-subst.rs b/src/test/run-pass/trait-inheritance-subst.rs index c8b270cad7648..03b7e37a7ad13 100644 --- a/src/test/run-pass/trait-inheritance-subst.rs +++ b/src/test/run-pass/trait-inheritance-subst.rs @@ -16,7 +16,7 @@ trait MyNum : Add { } struct MyInt { val: int } -impl MyInt : Add { +impl Add for MyInt { pure fn add(other: &MyInt) -> MyInt { mi(self.val + other.val) } } diff --git a/src/test/run-pass/trait-inheritance-subst2.rs b/src/test/run-pass/trait-inheritance-subst2.rs index 5659fed9c9b9a..378c78cfd921f 100644 --- a/src/test/run-pass/trait-inheritance-subst2.rs +++ b/src/test/run-pass/trait-inheritance-subst2.rs @@ -20,13 +20,13 @@ trait MyNum : Add { } struct MyInt { val: int } -impl MyInt : Panda { +impl Panda for MyInt { fn chomp(bamboo: &MyInt) -> MyInt { mi(self.val + bamboo.val) } } -impl MyInt : Add { +impl Add for MyInt { fn add(other: &MyInt) -> MyInt { self.chomp(other) } } diff --git a/src/test/run-pass/trait-inheritance-visibility.rs b/src/test/run-pass/trait-inheritance-visibility.rs index 70b0302de8cb8..6015eff8abe24 100644 --- a/src/test/run-pass/trait-inheritance-visibility.rs +++ b/src/test/run-pass/trait-inheritance-visibility.rs @@ -11,11 +11,11 @@ mod traits { pub trait Foo { fn f() -> int; } - impl int: Foo { fn f() -> int { 10 } } + impl Foo for int { fn f() -> int { 10 } } } trait Quux: traits::Foo { } -impl T: Quux { } +impl Quux for T { } // Foo is not in scope but because Quux is we can still access // Foo's methods on a Quux bound typaram @@ -25,4 +25,4 @@ fn f(x: &T) { pub fn main() { f(&0) -} \ No newline at end of file +} diff --git a/src/test/run-pass/trait-inheritance2.rs b/src/test/run-pass/trait-inheritance2.rs index 951c03fd01615..3dee07194dd51 100644 --- a/src/test/run-pass/trait-inheritance2.rs +++ b/src/test/run-pass/trait-inheritance2.rs @@ -16,9 +16,9 @@ trait Quux: Foo Bar Baz { } struct A { x: int } -impl A : Foo { fn f() -> int { 10 } } -impl A : Bar { fn g() -> int { 20 } } -impl A : Baz { fn h() -> int { 30 } } +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 A : Quux; fn f(a: &T) { diff --git a/src/test/run-pass/trait-region-pointer-simple.rs b/src/test/run-pass/trait-region-pointer-simple.rs index 1cd34e264e828..a00ca6156854d 100644 --- a/src/test/run-pass/trait-region-pointer-simple.rs +++ b/src/test/run-pass/trait-region-pointer-simple.rs @@ -16,7 +16,7 @@ struct A { x: int } -impl A : Foo { +impl Foo for A { fn f() -> int { io::println(~"Today's number is " + self.x.to_str()); return self.x; diff --git a/src/test/run-pass/trait-to-str.rs b/src/test/run-pass/trait-to-str.rs index 8b6f61117e8ea..62f4ef89d693d 100644 --- a/src/test/run-pass/trait-to-str.rs +++ b/src/test/run-pass/trait-to-str.rs @@ -20,11 +20,11 @@ trait to_str { fn to_str() -> ~str; } -impl int: to_str { +impl to_str for int { fn to_str() -> ~str { int::str(self) } } -impl ~[T]: to_str { +impl to_str for ~[T] { fn to_str() -> ~str { ~"[" + str::connect(vec::map(self, |e| e.to_str() ), ~", ") + ~"]" } diff --git a/src/test/run-pass/trait-typedef-cc.rs b/src/test/run-pass/trait-typedef-cc.rs index 9e75a6625a5ff..294b8a573f1ff 100644 --- a/src/test/run-pass/trait-typedef-cc.rs +++ b/src/test/run-pass/trait-typedef-cc.rs @@ -18,7 +18,7 @@ struct S { name: int } -impl S: Foo { +impl Foo for S { fn bar() { } } @@ -27,4 +27,4 @@ pub fn main() { name: 0 }; s.bar(); -} \ No newline at end of file +} diff --git a/src/test/run-pass/traits-default-method-macro.rs b/src/test/run-pass/traits-default-method-macro.rs index 66f4c43114119..43d8121c0b499 100644 --- a/src/test/run-pass/traits-default-method-macro.rs +++ b/src/test/run-pass/traits-default-method-macro.rs @@ -20,7 +20,7 @@ enum Baz { Quux } -impl Baz: Foo { +impl Foo for Baz { } pub fn main() { diff --git a/src/test/run-pass/traits-default-method-self.rs b/src/test/run-pass/traits-default-method-self.rs index b0742255ba37f..5a62d36f3e85d 100644 --- a/src/test/run-pass/traits-default-method-self.rs +++ b/src/test/run-pass/traits-default-method-self.rs @@ -18,7 +18,7 @@ trait Cat { fn purr() -> bool { true } } -impl int : Cat { +impl Cat for int { fn meow() -> bool { self.scratch() } diff --git a/src/test/run-pass/traits-default-method-trivial.rs b/src/test/run-pass/traits-default-method-trivial.rs index e9850588e9e21..639741a55f357 100644 --- a/src/test/run-pass/traits-default-method-trivial.rs +++ b/src/test/run-pass/traits-default-method-trivial.rs @@ -16,7 +16,7 @@ trait Cat { fn purr() -> bool { true } } -impl int : Cat { +impl Cat for int { fn meow() -> bool { self.scratch() } diff --git a/src/test/run-pass/traits.rs b/src/test/run-pass/traits.rs index 182e47aa81727..c4ec15ff2730a 100644 --- a/src/test/run-pass/traits.rs +++ b/src/test/run-pass/traits.rs @@ -43,7 +43,7 @@ trait Ord < Eq { } // pronounced "impl of Ord for int" -- not sold on this yet -impl int : Ord { +impl Ord for int { fn lt(a: &int) -> bool { self < (*a) } diff --git a/src/test/run-pass/type-param-constraints.rs b/src/test/run-pass/type-param-constraints.rs index d5749155456aa..95920bcc967d3 100644 --- a/src/test/run-pass/type-param-constraints.rs +++ b/src/test/run-pass/type-param-constraints.rs @@ -19,7 +19,7 @@ struct r { i: int, } -impl r : Drop { +impl Drop for r { fn finalize(&self) {} } diff --git a/src/test/run-pass/typeclasses-eq-example-static.rs b/src/test/run-pass/typeclasses-eq-example-static.rs index 13afc62baeb18..07f1306e40637 100644 --- a/src/test/run-pass/typeclasses-eq-example-static.rs +++ b/src/test/run-pass/typeclasses-eq-example-static.rs @@ -17,7 +17,7 @@ trait Equal { enum Color { cyan, magenta, yellow, black } -impl Color : Equal { +impl Equal for Color { static fn isEq(a: Color, b: Color) -> bool { match (a, b) { (cyan, cyan) => { true } @@ -34,7 +34,7 @@ enum ColorTree { branch(@ColorTree, @ColorTree) } -impl ColorTree : Equal { +impl Equal for ColorTree { static fn isEq(a: ColorTree, b: ColorTree) -> bool { match (a, b) { (leaf(x), leaf(y)) => { Equal::isEq(x, y) } diff --git a/src/test/run-pass/typeclasses-eq-example.rs b/src/test/run-pass/typeclasses-eq-example.rs index cf2c2e27fa563..a586457519b87 100644 --- a/src/test/run-pass/typeclasses-eq-example.rs +++ b/src/test/run-pass/typeclasses-eq-example.rs @@ -16,7 +16,7 @@ trait Equal { enum Color { cyan, magenta, yellow, black } -impl Color : Equal { +impl Equal for Color { fn isEq(a: Color) -> bool { match (self, a) { (cyan, cyan) => { true } @@ -33,7 +33,7 @@ enum ColorTree { branch(@ColorTree, @ColorTree) } -impl ColorTree : Equal { +impl Equal for ColorTree { fn isEq(a: ColorTree) -> bool { match (self, a) { (leaf(x), leaf(y)) => { x.isEq(y) } diff --git a/src/test/run-pass/unique-alt-discrim.rs b/src/test/run-pass/unique-alt-discrim.rs index 60c5bf068f0d6..1f0b13dfd0193 100644 --- a/src/test/run-pass/unique-alt-discrim.rs +++ b/src/test/run-pass/unique-alt-discrim.rs @@ -15,4 +15,4 @@ fn altsimple() { _ => { } } } -pub fn main() { } \ No newline at end of file +pub fn main() { } diff --git a/src/test/run-pass/unique-assign-drop.rs b/src/test/run-pass/unique-assign-drop.rs index 07c1d5221578d..9a49fefdef0ec 100644 --- a/src/test/run-pass/unique-assign-drop.rs +++ b/src/test/run-pass/unique-assign-drop.rs @@ -14,4 +14,4 @@ pub fn main() { // Should drop the previous value of j j = i; assert *j == 1; -} \ No newline at end of file +} diff --git a/src/test/run-pass/unique-assign.rs b/src/test/run-pass/unique-assign.rs index 9089ac9a32790..c1a2c33cc45c6 100644 --- a/src/test/run-pass/unique-assign.rs +++ b/src/test/run-pass/unique-assign.rs @@ -12,4 +12,4 @@ pub fn main() { let mut i; i = ~1; assert *i == 1; -} \ No newline at end of file +} diff --git a/src/test/run-pass/unique-autoderef-field.rs b/src/test/run-pass/unique-autoderef-field.rs index eac67c65b8f0f..4bbdc9b4cd45b 100644 --- a/src/test/run-pass/unique-autoderef-field.rs +++ b/src/test/run-pass/unique-autoderef-field.rs @@ -15,4 +15,4 @@ pub fn main() { j: 100 }; assert i.j == 100; -} \ No newline at end of file +} diff --git a/src/test/run-pass/unique-cmp.rs b/src/test/run-pass/unique-cmp.rs index 5a565d4b81c2d..9d6ed4933bcb3 100644 --- a/src/test/run-pass/unique-cmp.rs +++ b/src/test/run-pass/unique-cmp.rs @@ -15,4 +15,4 @@ pub fn main() { assert i <= ~100; assert i > ~99; assert i >= ~99; -} \ No newline at end of file +} diff --git a/src/test/run-pass/unique-create.rs b/src/test/run-pass/unique-create.rs index 989ee58a793a2..9570c17c8654c 100644 --- a/src/test/run-pass/unique-create.rs +++ b/src/test/run-pass/unique-create.rs @@ -14,4 +14,4 @@ pub fn main() { fn vec() { ~[0]; -} \ No newline at end of file +} diff --git a/src/test/run-pass/unique-decl-init.rs b/src/test/run-pass/unique-decl-init.rs index 8c6420a4df7cf..a856d37d4fca6 100644 --- a/src/test/run-pass/unique-decl-init.rs +++ b/src/test/run-pass/unique-decl-init.rs @@ -12,4 +12,4 @@ pub fn main() { let i = ~1; let j = i; assert *j == 1; -} \ No newline at end of file +} diff --git a/src/test/run-pass/unique-decl-move-temp.rs b/src/test/run-pass/unique-decl-move-temp.rs index 56cbc044c0175..fd4f428bd9d7a 100644 --- a/src/test/run-pass/unique-decl-move-temp.rs +++ b/src/test/run-pass/unique-decl-move-temp.rs @@ -11,4 +11,4 @@ pub fn main() { let i = move ~100; assert *i == 100; -} \ No newline at end of file +} diff --git a/src/test/run-pass/unique-decl-move.rs b/src/test/run-pass/unique-decl-move.rs index d41e6f99ec585..27600c04e22f9 100644 --- a/src/test/run-pass/unique-decl-move.rs +++ b/src/test/run-pass/unique-decl-move.rs @@ -12,4 +12,4 @@ pub fn main() { let i = ~100; let j = move i; assert *j == 100; -} \ No newline at end of file +} diff --git a/src/test/run-pass/unique-deref.rs b/src/test/run-pass/unique-deref.rs index 625a8f8982e0c..96e91093d37a2 100644 --- a/src/test/run-pass/unique-deref.rs +++ b/src/test/run-pass/unique-deref.rs @@ -11,4 +11,4 @@ pub fn main() { let i = ~100; assert *i == 100; -} \ No newline at end of file +} diff --git a/src/test/run-pass/unique-destructure.rs b/src/test/run-pass/unique-destructure.rs index 4c4f46607d284..513e3c017576c 100644 --- a/src/test/run-pass/unique-destructure.rs +++ b/src/test/run-pass/unique-destructure.rs @@ -13,4 +13,4 @@ struct Foo { a: int, b: int } pub fn main() { let ~Foo{a, b} = ~Foo{a: 100, b: 200}; assert a + b == 300; -} \ No newline at end of file +} diff --git a/src/test/run-pass/unique-fn-arg-move.rs b/src/test/run-pass/unique-fn-arg-move.rs index 2246fa2270ae8..61cee457b0cf0 100644 --- a/src/test/run-pass/unique-fn-arg-move.rs +++ b/src/test/run-pass/unique-fn-arg-move.rs @@ -15,4 +15,4 @@ fn f(-i: ~int) { pub fn main() { let i = ~100; f(move i); -} \ No newline at end of file +} diff --git a/src/test/run-pass/unique-fn-arg-mut.rs b/src/test/run-pass/unique-fn-arg-mut.rs index 82462c0c11c9b..ddf87707e36c2 100644 --- a/src/test/run-pass/unique-fn-arg-mut.rs +++ b/src/test/run-pass/unique-fn-arg-mut.rs @@ -16,4 +16,4 @@ pub fn main() { let mut i = ~100; f(&mut i); assert *i == 200; -} \ No newline at end of file +} diff --git a/src/test/run-pass/unique-fn-arg.rs b/src/test/run-pass/unique-fn-arg.rs index 2dbd924a6ade1..c35b40991df09 100644 --- a/src/test/run-pass/unique-fn-arg.rs +++ b/src/test/run-pass/unique-fn-arg.rs @@ -16,4 +16,4 @@ pub fn main() { f(~100); let i = ~100; f(i); -} \ No newline at end of file +} diff --git a/src/test/run-pass/unique-fn-ret.rs b/src/test/run-pass/unique-fn-ret.rs index b5127571a215a..427bd8966b851 100644 --- a/src/test/run-pass/unique-fn-ret.rs +++ b/src/test/run-pass/unique-fn-ret.rs @@ -14,4 +14,4 @@ fn f() -> ~int { pub fn main() { assert f() == ~100; -} \ No newline at end of file +} diff --git a/src/test/run-pass/unique-init.rs b/src/test/run-pass/unique-init.rs index 0d58e2fcd2eef..5514525584000 100644 --- a/src/test/run-pass/unique-init.rs +++ b/src/test/run-pass/unique-init.rs @@ -10,4 +10,4 @@ pub fn main() { let i = ~100; -} \ No newline at end of file +} diff --git a/src/test/run-pass/unique-log.rs b/src/test/run-pass/unique-log.rs index 27a4cbf8d4b33..b619140d50985 100644 --- a/src/test/run-pass/unique-log.rs +++ b/src/test/run-pass/unique-log.rs @@ -11,4 +11,4 @@ pub fn main() { let i = ~100; log(error, i); -} \ No newline at end of file +} diff --git a/src/test/run-pass/unique-move-drop.rs b/src/test/run-pass/unique-move-drop.rs index 6aac2ac39632f..fd86d5aa6fefa 100644 --- a/src/test/run-pass/unique-move-drop.rs +++ b/src/test/run-pass/unique-move-drop.rs @@ -13,4 +13,4 @@ pub fn main() { let j = ~200; let j = move i; assert *j == 100; -} \ No newline at end of file +} diff --git a/src/test/run-pass/unique-move-temp.rs b/src/test/run-pass/unique-move-temp.rs index df6ed48fa601c..eaa8a1cf7bd40 100644 --- a/src/test/run-pass/unique-move-temp.rs +++ b/src/test/run-pass/unique-move-temp.rs @@ -12,4 +12,4 @@ pub fn main() { let mut i; i = move ~100; assert *i == 100; -} \ No newline at end of file +} diff --git a/src/test/run-pass/unique-move.rs b/src/test/run-pass/unique-move.rs index 771e865287675..be0426edbe2e4 100644 --- a/src/test/run-pass/unique-move.rs +++ b/src/test/run-pass/unique-move.rs @@ -13,4 +13,4 @@ pub fn main() { let mut j; j = move i; assert *j == 100; -} \ No newline at end of file +} diff --git a/src/test/run-pass/unique-mutable.rs b/src/test/run-pass/unique-mutable.rs index 95ef19600e608..c52d3b563ac55 100644 --- a/src/test/run-pass/unique-mutable.rs +++ b/src/test/run-pass/unique-mutable.rs @@ -12,4 +12,4 @@ pub fn main() { let i = ~mut 0; *i = 1; assert *i == 1; -} \ No newline at end of file +} diff --git a/src/test/run-pass/unique-object.rs b/src/test/run-pass/unique-object.rs index 4ad8ab38e4b8d..031b17ceb8fdb 100644 --- a/src/test/run-pass/unique-object.rs +++ b/src/test/run-pass/unique-object.rs @@ -16,7 +16,7 @@ struct Bar { x: int } -impl Bar : Foo { +impl Foo for Bar { fn f(&self) -> int { self.x } diff --git a/src/test/run-pass/unique-pinned-nocopy-2.rs b/src/test/run-pass/unique-pinned-nocopy-2.rs index 089deeb20ac8f..7da21b1081eaf 100644 --- a/src/test/run-pass/unique-pinned-nocopy-2.rs +++ b/src/test/run-pass/unique-pinned-nocopy-2.rs @@ -12,7 +12,7 @@ struct r { i: @mut int, } -impl r : Drop { +impl Drop for r { fn finalize(&self) { *(self.i) = *(self.i) + 1; } diff --git a/src/test/run-pass/unique-send-2.rs b/src/test/run-pass/unique-send-2.rs index a79c7bd6d5b1d..a5398e7407b37 100644 --- a/src/test/run-pass/unique-send-2.rs +++ b/src/test/run-pass/unique-send-2.rs @@ -32,4 +32,4 @@ pub fn main() { } assert expected == actual; -} \ No newline at end of file +} diff --git a/src/test/run-pass/unique-send.rs b/src/test/run-pass/unique-send.rs index b6c5b2948a0d6..57b345c2d25ea 100644 --- a/src/test/run-pass/unique-send.rs +++ b/src/test/run-pass/unique-send.rs @@ -15,4 +15,4 @@ pub fn main() { c.send(~100); let v = p.recv(); assert v == ~100; -} \ No newline at end of file +} diff --git a/src/test/run-pass/unique-swap.rs b/src/test/run-pass/unique-swap.rs index d0e8c463f0081..a024cda75c38a 100644 --- a/src/test/run-pass/unique-swap.rs +++ b/src/test/run-pass/unique-swap.rs @@ -14,4 +14,4 @@ pub fn main() { i <-> j; assert i == ~200; assert j == ~100; -} \ No newline at end of file +} diff --git a/src/test/run-pass/unused-move.rs b/src/test/run-pass/unused-move.rs index 95b224fa2b7b3..785eb691459d6 100644 --- a/src/test/run-pass/unused-move.rs +++ b/src/test/run-pass/unused-move.rs @@ -16,4 +16,4 @@ pub fn main() { let y = ~1; move y; -} \ No newline at end of file +} diff --git a/src/test/run-pass/unwind-resource.rs b/src/test/run-pass/unwind-resource.rs index fbe0e4711e110..62673fc134d19 100644 --- a/src/test/run-pass/unwind-resource.rs +++ b/src/test/run-pass/unwind-resource.rs @@ -17,7 +17,7 @@ struct complainer { c: SharedChan, } -impl complainer : Drop { +impl Drop for complainer { fn finalize(&self) { error!("About to send!"); self.c.send(true); diff --git a/src/test/run-pass/unwind-resource2.rs b/src/test/run-pass/unwind-resource2.rs index 55b286aee7ea0..967ed727aa535 100644 --- a/src/test/run-pass/unwind-resource2.rs +++ b/src/test/run-pass/unwind-resource2.rs @@ -15,7 +15,7 @@ struct complainer { c: @int, } -impl complainer : Drop { +impl Drop for complainer { fn finalize(&self) {} } diff --git a/src/test/run-pass/use-trait-before-def.rs b/src/test/run-pass/use-trait-before-def.rs index 30646c4a35612..1bd68bfa4b6f9 100644 --- a/src/test/run-pass/use-trait-before-def.rs +++ b/src/test/run-pass/use-trait-before-def.rs @@ -10,6 +10,6 @@ // Issue #1761 -impl int: foo { fn foo() -> int { 10 } } +impl foo for int { fn foo() -> int { 10 } } trait foo { fn foo() -> int; } -pub fn main() {} \ No newline at end of file +pub fn main() {} diff --git a/src/test/run-pass/vec-slice-drop.rs b/src/test/run-pass/vec-slice-drop.rs index a73b12bef9408..3fcd69ce40a56 100644 --- a/src/test/run-pass/vec-slice-drop.rs +++ b/src/test/run-pass/vec-slice-drop.rs @@ -13,7 +13,7 @@ struct foo { x: @mut int, } -impl foo : Drop { +impl Drop for foo { fn finalize(&self) { *self.x += 1; }