diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-02-14 11:47:00 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-02-14 11:47:00 -0800 |
| commit | e8f36d5ea0a56250109d93656130b442d2e59e4c (patch) | |
| tree | d8b1be86a79e6b1c0a48141857421386cbbab34a /src/libstd | |
| parent | 36edd256397d250ce35204ba1a0954609c25a20a (diff) | |
| download | rust-e8f36d5ea0a56250109d93656130b442d2e59e4c.tar.gz rust-e8f36d5ea0a56250109d93656130b442d2e59e4c.zip | |
librustc: Replace `impl Type : Trait` with `impl Trait for Type`. rs=implflipping
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/arc.rs | 6 | ||||
| -rw-r--r-- | src/libstd/arena.rs | 2 | ||||
| -rw-r--r-- | src/libstd/base64.rs | 8 | ||||
| -rw-r--r-- | src/libstd/bigint.rs | 64 | ||||
| -rw-r--r-- | src/libstd/bitv.rs | 4 | ||||
| -rw-r--r-- | src/libstd/c_vec.rs | 2 | ||||
| -rw-r--r-- | src/libstd/cmp.rs | 8 | ||||
| -rw-r--r-- | src/libstd/comm.rs | 10 | ||||
| -rw-r--r-- | src/libstd/deque.rs | 2 | ||||
| -rw-r--r-- | src/libstd/ebml.rs | 6 | ||||
| -rw-r--r-- | src/libstd/flatpipes.rs | 10 | ||||
| -rw-r--r-- | src/libstd/future.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io_util.rs | 2 | ||||
| -rw-r--r-- | src/libstd/json.rs | 58 | ||||
| -rw-r--r-- | src/libstd/net_ip.rs | 2 | ||||
| -rw-r--r-- | src/libstd/net_tcp.rs | 8 | ||||
| -rw-r--r-- | src/libstd/net_url.rs | 6 | ||||
| -rw-r--r-- | src/libstd/oldmap.rs | 8 | ||||
| -rw-r--r-- | src/libstd/oldsmallintmap.rs | 6 | ||||
| -rw-r--r-- | src/libstd/priority_queue.rs | 6 | ||||
| -rw-r--r-- | src/libstd/sha1.rs | 2 | ||||
| -rw-r--r-- | src/libstd/smallintmap.rs | 10 | ||||
| -rw-r--r-- | src/libstd/sort.rs | 10 | ||||
| -rw-r--r-- | src/libstd/stats.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sync.rs | 20 | ||||
| -rw-r--r-- | src/libstd/time.rs | 6 | ||||
| -rw-r--r-- | src/libstd/treemap.rs | 28 | ||||
| -rw-r--r-- | src/libstd/uv_global_loop.rs | 2 | ||||
| -rw-r--r-- | src/libstd/uv_iotask.rs | 2 | ||||
| -rw-r--r-- | src/libstd/workcache.rs | 6 |
30 files changed, 154 insertions, 154 deletions
diff --git a/src/libstd/arc.rs b/src/libstd/arc.rs index 0a51a7ef191..59e278f1796 100644 --- a/src/libstd/arc.rs +++ b/src/libstd/arc.rs @@ -117,7 +117,7 @@ pub fn unwrap<T: Const Owned>(rc: ARC<T>) -> T { unsafe { unwrap_shared_mutable_state(move x) } } -impl<T: Const Owned> ARC<T>: Clone { +impl<T: Const Owned> Clone for ARC<T> { fn clone(&self) -> ARC<T> { clone(self) } @@ -148,7 +148,7 @@ pub fn mutex_arc_with_condvars<T: Owned>(user_data: T, MutexARC { x: unsafe { shared_mutable_state(move data) } } } -impl<T: Owned> MutexARC<T>: Clone { +impl<T: Owned> Clone for MutexARC<T> { /// Duplicate a mutex-protected ARC, as arc::clone. fn clone(&self) -> MutexARC<T> { // 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 9beb8e276ef..177932aa072 100644 --- a/src/libstd/arena.rs +++ b/src/libstd/arena.rs @@ -81,7 +81,7 @@ pub struct Arena { priv mut chunks: @List<Chunk>, } -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 10ea113f74e..5065e15bb5e 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 2c713e58e9a..ab622438511 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> { BigUint::from_str_radix(s, 10) } } -impl BigUint : Shl<uint, BigUint> { +impl Shl<uint, BigUint> 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<uint, BigUint> { } } -impl BigUint : Shr<uint, BigUint> { +impl Shr<uint, BigUint> 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<uint, BigUint> { } } -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<BigUint, BigUint> { +impl Add<BigUint, BigUint> 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<BigUint, BigUint> { } } -impl BigUint : Sub<BigUint, BigUint> { +impl Sub<BigUint, BigUint> 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<BigUint, BigUint> { } } -impl BigUint : Mul<BigUint, BigUint> { +impl Mul<BigUint, BigUint> 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<BigUint, BigUint> { } } -impl BigUint : Div<BigUint, BigUint> { +impl Div<BigUint, BigUint> for BigUint { pure fn div(&self, other: &BigUint) -> BigUint { let (d, _) = self.divmod(other); return d; } } -impl BigUint : Modulo<BigUint, BigUint> { +impl Modulo<BigUint, BigUint> for BigUint { pure fn modulo(&self, other: &BigUint) -> BigUint { let (_, m) = self.divmod(other); return m; } } -impl BigUint : Neg<BigUint> { +impl Neg<BigUint> 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> { BigInt::from_str_radix(s, 10) } } -impl BigInt : Shl<uint, BigInt> { +impl Shl<uint, BigInt> for BigInt { pure fn shl(&self, rhs: &uint) -> BigInt { BigInt::from_biguint(self.sign, self.data << *rhs) } } -impl BigInt : Shr<uint, BigInt> { +impl Shr<uint, BigInt> 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<BigInt, BigInt> { +impl Add<BigInt, BigInt> for BigInt { pure fn add(&self, other: &BigInt) -> BigInt { match (self.sign, other.sign) { (Zero, _) => copy *other, @@ -652,7 +652,7 @@ impl BigInt : Add<BigInt, BigInt> { } } -impl BigInt : Sub<BigInt, BigInt> { +impl Sub<BigInt, BigInt> for BigInt { pure fn sub(&self, other: &BigInt) -> BigInt { match (self.sign, other.sign) { (Zero, _) => -other, @@ -672,7 +672,7 @@ impl BigInt : Sub<BigInt, BigInt> { } } -impl BigInt : Mul<BigInt, BigInt> { +impl Mul<BigInt, BigInt> 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<BigInt, BigInt> { } } -impl BigInt : Div<BigInt, BigInt> { +impl Div<BigInt, BigInt> for BigInt { pure fn div(&self, other: &BigInt) -> BigInt { let (d, _) = self.divmod(other); return d; } } -impl BigInt : Modulo<BigInt, BigInt> { +impl Modulo<BigInt, BigInt> for BigInt { pure fn modulo(&self, other: &BigInt) -> BigInt { let (_, m) = self.divmod(other); return m; } } -impl BigInt : Neg<BigInt> { +impl Neg<BigInt> 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 d62fb2e8f6e..e6557d163f9 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<uint,bool> { +impl ops::Index<uint,bool> 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 5ea5418d988..696b2753ea4 100644 --- a/src/libstd/c_vec.rs +++ b/src/libstd/c_vec.rs @@ -56,7 +56,7 @@ struct DtorRes { dtor: Option<fn@()>, } -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 991953cccb7..a73b5f2a706 100644 --- a/src/libstd/cmp.rs +++ b/src/libstd/cmp.rs @@ -21,7 +21,7 @@ pub trait FuzzyEq<Eps> { pure fn fuzzy_eq_eps(&self, other: &Self, epsilon: &Eps) -> bool; } -impl float: FuzzyEq<float> { +impl FuzzyEq<float> for float { pure fn fuzzy_eq(&self, other: &float) -> bool { self.fuzzy_eq_eps(other, &FUZZY_EPSILON) } @@ -31,7 +31,7 @@ impl float: FuzzyEq<float> { } } -impl f32: FuzzyEq<f32> { +impl FuzzyEq<f32> 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<f32> { } } -impl f64: FuzzyEq<f64> { +impl FuzzyEq<f64> 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<float> { + impl FuzzyEq<float> 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 71eb29e26eb..47f3c70352c 100644 --- a/src/libstd/comm.rs +++ b/src/libstd/comm.rs @@ -25,19 +25,19 @@ pub struct DuplexStream<T, U> { priv port: Port<U>, } -impl<T: Owned, U: Owned> DuplexStream<T, U> : GenericChan<T> { +impl<T: Owned, U: Owned> GenericChan<T> for DuplexStream<T, U> { fn send(x: T) { self.chan.send(move x) } } -impl<T: Owned, U: Owned> DuplexStream<T, U> : GenericSmartChan<T> { +impl<T: Owned, U: Owned> GenericSmartChan<T> for DuplexStream<T, U> { fn try_send(x: T) -> bool { self.chan.try_send(move x) } } -impl<T: Owned, U: Owned> DuplexStream<T, U> : GenericPort<U> { +impl<T: Owned, U: Owned> GenericPort<U> for DuplexStream<T, U> { fn recv() -> U { self.port.recv() } @@ -47,13 +47,13 @@ impl<T: Owned, U: Owned> DuplexStream<T, U> : GenericPort<U> { } } -impl<T: Owned, U: Owned> DuplexStream<T, U> : Peekable<U> { +impl<T: Owned, U: Owned> Peekable<U> for DuplexStream<T, U> { pure fn peek() -> bool { self.port.peek() } } -impl<T: Owned, U: Owned> DuplexStream<T, U> : Selectable { +impl<T: Owned, U: Owned> Selectable for DuplexStream<T, U> { pure fn header() -> *pipes::PacketHeader { self.port.header() } diff --git a/src/libstd/deque.rs b/src/libstd/deque.rs index 7d819ba0b3f..772cacf47a1 100644 --- a/src/libstd/deque.rs +++ b/src/libstd/deque.rs @@ -67,7 +67,7 @@ pub fn create<T: Copy>() -> Deque<T> { elts: DVec<Cell<T>>, } - impl <T: Copy> Repr<T>: Deque<T> { + impl<T: Copy> Deque<T> for Repr<T> { 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 c332c7656b4..f691dfe6a62 100644 --- a/src/libstd/ebml.rs +++ b/src/libstd/ebml.rs @@ -74,7 +74,7 @@ pub mod reader { // ebml reading - impl Doc: ops::Index<uint,Doc> { + impl ops::Index<uint,Doc> 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 a7507a971c8..dad761ac20d 100644 --- a/src/libstd/flatpipes.rs +++ b/src/libstd/flatpipes.rs @@ -303,7 +303,7 @@ pub impl<T,U:Unflattener<T>,P:BytePort> FlatPort<T, U, P>: GenericPort<T> { } } -impl<T,F:Flattener<T>,C:ByteChan> FlatChan<T, F, C>: GenericChan<T> { +impl<T,F:Flattener<T>,C:ByteChan> GenericChan<T> for FlatChan<T, F, C> { 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 ec71c30242c..8659e3cbb10 100644 --- a/src/libstd/future.rs +++ b/src/libstd/future.rs @@ -36,7 +36,7 @@ pub struct Future<A> { // FIXME(#2829) -- futures should not be copyable, because they close // over fn~'s that have pipes and so forth within! -impl<A> Future<A> : Drop { +impl<A> Drop for Future<A> { fn finalize(&self) {} } diff --git a/src/libstd/io_util.rs b/src/libstd/io_util.rs index 9a90b811e44..3cc28563e12 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 95f9130fa37..fcdd2de5743 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: ToJson, B: ToJson> (A, B): ToJson { +impl<A: ToJson, B: ToJson> ToJson for (A, B) { fn to_json() -> Json { match self { (ref a, ref b) => { @@ -1160,7 +1160,7 @@ impl <A: ToJson, B: ToJson> (A, B): ToJson { } } -impl <A: ToJson, B: ToJson, C: ToJson> (A, B, C): ToJson { +impl<A: ToJson, B: ToJson, C: ToJson> ToJson for (A, B, C) { fn to_json() -> Json { match self { (ref a, ref b, ref c) => { @@ -1170,11 +1170,11 @@ impl <A: ToJson, B: ToJson, C: ToJson> (A, B, C): ToJson { } } -impl <A: ToJson> ~[A]: ToJson { +impl<A: ToJson> ToJson for ~[A] { fn to_json() -> Json { List(self.map(|elt| elt.to_json())) } } -impl <A: ToJson Copy> LinearMap<~str, A>: ToJson { +impl<A: ToJson Copy> ToJson for LinearMap<~str, A> { fn to_json() -> Json { let mut d = LinearMap::new(); for self.each |&(key, value)| { @@ -1184,7 +1184,7 @@ impl <A: ToJson Copy> LinearMap<~str, A>: ToJson { } } -impl <A: ToJson> Option<A>: ToJson { +impl<A: ToJson> ToJson for Option<A> { fn to_json() -> Json { match self { None => Null, @@ -1193,11 +1193,11 @@ impl <A: ToJson> Option<A>: 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 2f423f4c8d4..88bacf53e63 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 8addea9c30b..4e0b5494883 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 1da3a642514..7874899cb27 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<Url, ~str> { 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<Url> { 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 900b7068ce3..3ad45cf2d5b 100644 --- a/src/libstd/oldmap.rs +++ b/src/libstd/oldmap.rs @@ -156,12 +156,12 @@ pub mod chained { } } - impl<K: Eq IterBytes Hash, V> T<K, V>: Container { + impl<K: Eq IterBytes Hash, V> Container for T<K, V> { pure fn len(&self) -> uint { self.count } pure fn is_empty(&self) -> bool { self.count == 0 } } - impl<K: Eq IterBytes Hash, V> T<K, V>: Mutable { + impl<K: Eq IterBytes Hash, V> Mutable for T<K, V> { fn clear(&mut self) { self.count = 0u; self.chains = chains(initial_capacity); @@ -347,7 +347,7 @@ pub mod chained { } } - impl<K:Eq IterBytes Hash Copy ToStr, V: ToStr Copy> T<K, V>: ToStr { + impl<K:Eq IterBytes Hash Copy ToStr, V: ToStr Copy> ToStr for T<K, V> { pure fn to_str(&self) -> ~str { unsafe { // Meh -- this should be safe @@ -356,7 +356,7 @@ pub mod chained { } } - impl<K:Eq IterBytes Hash Copy, V: Copy> T<K, V>: ops::Index<K, V> { + impl<K:Eq IterBytes Hash Copy, V: Copy> ops::Index<K, V> for T<K, V> { pure fn index(&self, k: K) -> V { self.get(&k) } diff --git a/src/libstd/oldsmallintmap.rs b/src/libstd/oldsmallintmap.rs index c9e739e3c8b..5c347766070 100644 --- a/src/libstd/oldsmallintmap.rs +++ b/src/libstd/oldsmallintmap.rs @@ -78,7 +78,7 @@ pub pure fn contains_key<T: Copy>(self: SmallIntMap<T>, key: uint) -> bool { return !find(self, key).is_none(); } -impl<V> SmallIntMap<V>: Container { +impl<V> Container for SmallIntMap<V> { /// Return the number of elements in the map pure fn len(&self) -> uint { let mut sz = 0u; @@ -95,7 +95,7 @@ impl<V> SmallIntMap<V>: Container { pure fn is_empty(&self) -> bool { self.len() == 0 } } -impl<V> SmallIntMap<V>: Mutable { +impl<V> Mutable for SmallIntMap<V> { fn clear(&mut self) { self.v.set(~[]) } } @@ -162,7 +162,7 @@ impl<V: Copy> SmallIntMap<V> { } } -impl<V: Copy> SmallIntMap<V>: ops::Index<uint, V> { +impl<V: Copy> ops::Index<uint, V> for SmallIntMap<V> { 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 a64aa5e9687..a25a4196b4c 100644 --- a/src/libstd/priority_queue.rs +++ b/src/libstd/priority_queue.rs @@ -27,7 +27,7 @@ pub struct PriorityQueue<T> { priv data: ~[T], } -impl <T: Ord> PriorityQueue<T>: BaseIter<T> { +impl<T: Ord> BaseIter<T> for PriorityQueue<T> { /// Visit all values in the underlying vector. /// /// The values are **not** visited in order. @@ -35,7 +35,7 @@ impl <T: Ord> PriorityQueue<T>: BaseIter<T> { pure fn size_hint(&self) -> Option<uint> { self.data.size_hint() } } -impl <T: Ord> PriorityQueue<T>: Container { +impl<T: Ord> Container for PriorityQueue<T> { /// Returns the length of the queue pure fn len(&self) -> uint { self.data.len() } @@ -43,7 +43,7 @@ impl <T: Ord> PriorityQueue<T>: Container { pure fn is_empty(&self) -> bool { self.data.is_empty() } } -impl <T: Ord> PriorityQueue<T>: Mutable { +impl<T: Ord> Mutable for PriorityQueue<T> { /// 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 e89f3787830..1d91fafa4f9 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 2e5cd8956cd..382cd658663 100644 --- a/src/libstd/smallintmap.rs +++ b/src/libstd/smallintmap.rs @@ -22,7 +22,7 @@ pub struct SmallIntMap<T> { priv v: ~[Option<T>], } -impl<V> SmallIntMap<V>: BaseIter<(uint, &V)> { +impl<V> BaseIter<(uint, &V)> for SmallIntMap<V> { /// 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<V> SmallIntMap<V>: BaseIter<(uint, &V)> { pure fn size_hint(&self) -> Option<uint> { Some(self.len()) } } -impl<V> SmallIntMap<V>: ReverseIter<(uint, &V)> { +impl<V> ReverseIter<(uint, &V)> for SmallIntMap<V> { /// 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<V> SmallIntMap<V>: ReverseIter<(uint, &V)> { } } -impl<V> SmallIntMap<V>: Container { +impl<V> Container for SmallIntMap<V> { /// Return the number of elements in the map pure fn len(&self) -> uint { let mut sz = 0; @@ -64,12 +64,12 @@ impl<V> SmallIntMap<V>: Container { pure fn is_empty(&self) -> bool { self.len() == 0 } } -impl<V> SmallIntMap<V>: Mutable { +impl<V> Mutable for SmallIntMap<V> { /// Clear the map, removing all key-value pairs. fn clear(&mut self) { self.v.clear() } } -impl<V> SmallIntMap<V>: Map<uint, V> { +impl<V> Map<uint, V> for SmallIntMap<V> { /// 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 f8acbe84180..98a451dc8ab 100644 --- a/src/libstd/sort.rs +++ b/src/libstd/sort.rs @@ -169,7 +169,7 @@ pub trait Sort { fn qsort(self); } -impl<T: Copy Ord Eq> &mut [T] : Sort { +impl<T: Copy Ord Eq> 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 2048cb6c59f..fb6f80a6500 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 8a5741201c0..af773f5bf4e 100644 --- a/src/libstd/sync.rs +++ b/src/libstd/sync.rs @@ -167,7 +167,7 @@ type SemRelease = SemReleaseGeneric<()>; type SemAndSignalRelease = SemReleaseGeneric<~[Waitqueue]>; struct SemReleaseGeneric<Q> { sem: &Sem<Q> } -impl<Q: Owned> SemReleaseGeneric<Q> : Drop { +impl<Q: Owned> Drop for SemReleaseGeneric<Q> { 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 622e1ea65d8..77e7e3c3054 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 2fdaeb545a2..282ecf086e4 100644 --- a/src/libstd/treemap.rs +++ b/src/libstd/treemap.rs @@ -39,7 +39,7 @@ pub struct TreeMap<K, V> { priv length: uint } -impl <K: Eq Ord, V: Eq> TreeMap<K, V>: Eq { +impl<K: Eq Ord, V: Eq> Eq for TreeMap<K, V> { pure fn eq(&self, other: &TreeMap<K, V>) -> bool { if self.len() != other.len() { false @@ -85,7 +85,7 @@ pure fn lt<K: Ord, V>(a: &TreeMap<K, V>, b: &TreeMap<K, V>) -> bool { return a_len < b_len; } -impl <K: Ord, V> TreeMap<K, V>: Ord { +impl<K: Ord, V> Ord for TreeMap<K, V> { #[inline(always)] pure fn lt(&self, other: &TreeMap<K, V>) -> bool { lt(self, other) @@ -104,7 +104,7 @@ impl <K: Ord, V> TreeMap<K, V>: Ord { } } -impl <K: Ord, V> TreeMap<K, V>: BaseIter<(&K, &V)> { +impl<K: Ord, V> BaseIter<(&K, &V)> for TreeMap<K, V> { /// 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 <K: Ord, V> TreeMap<K, V>: BaseIter<(&K, &V)> { pure fn size_hint(&self) -> Option<uint> { Some(self.len()) } } -impl <K: Ord, V> TreeMap<K, V>: ReverseIter<(&K, &V)> { +impl<K: Ord, V> ReverseIter<(&K, &V)> for TreeMap<K, V> { /// 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 <K: Ord, V> TreeMap<K, V>: Container { +impl<K: Ord, V> Container for TreeMap<K, V> { /// Return the number of elements in the map pure fn len(&self) -> uint { self.length } @@ -127,7 +127,7 @@ impl <K: Ord, V> TreeMap<K, V>: Container { pure fn is_empty(&self) -> bool { self.root.is_none() } } -impl <K: Ord, V> TreeMap<K, V>: Mutable { +impl<K: Ord, V> Mutable for TreeMap<K, V> { /// Clear the map, removing all key-value pairs. fn clear(&mut self) { self.root = None; @@ -135,7 +135,7 @@ impl <K: Ord, V> TreeMap<K, V>: Mutable { } } -impl <K: Ord, V> TreeMap<K, V>: Map<K, V> { +impl<K: Ord, V> Map<K, V> for TreeMap<K, V> { /// 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<T> { priv map: TreeMap<T, ()> } -impl <T: Ord> TreeSet<T>: BaseIter<T> { +impl<T: Ord> BaseIter<T> for TreeSet<T> { /// Visit all values in order pure fn each(&self, f: fn(&T) -> bool) { self.map.each_key(f) } pure fn size_hint(&self) -> Option<uint> { Some(self.len()) } } -impl <T: Ord> TreeSet<T>: ReverseIter<T> { +impl<T: Ord> ReverseIter<T> for TreeSet<T> { /// Visit all values in reverse order pure fn each_reverse(&self, f: fn(&T) -> bool) { self.map.each_key_reverse(f) } } -impl <T: Eq Ord> TreeSet<T>: Eq { +impl<T: Eq Ord> Eq for TreeSet<T> { pure fn eq(&self, other: &TreeSet<T>) -> bool { self.map == other.map } pure fn ne(&self, other: &TreeSet<T>) -> bool { self.map != other.map } } -impl <T: Ord> TreeSet<T>: Ord { +impl<T: Ord> Ord for TreeSet<T> { #[inline(always)] pure fn lt(&self, other: &TreeSet<T>) -> bool { self.map < other.map } #[inline(always)] @@ -275,7 +275,7 @@ impl <T: Ord> TreeSet<T>: Ord { pure fn gt(&self, other: &TreeSet<T>) -> bool { self.map > other.map } } -impl <T: Ord> TreeSet<T>: Container { +impl<T: Ord> Container for TreeSet<T> { /// Return the number of elements in the set pure fn len(&self) -> uint { self.map.len() } @@ -283,12 +283,12 @@ impl <T: Ord> TreeSet<T>: Container { pure fn is_empty(&self) -> bool { self.map.is_empty() } } -impl <T: Ord> TreeSet<T>: Mutable { +impl<T: Ord> Mutable for TreeSet<T> { /// Clear the set, removing all values. fn clear(&mut self) { self.map.clear() } } -impl <T: Ord> TreeSet<T>: Set<T> { +impl<T: Ord> Set<T> for TreeSet<T> { /// 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 6621eef8b0b..3152f0b5405 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 ccb3175eef4..a93bdf86a64 100644 --- a/src/libstd/uv_iotask.rs +++ b/src/libstd/uv_iotask.rs @@ -31,7 +31,7 @@ pub struct IoTask { op_chan: SharedChan<IoTaskMsg> } -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 d78761b70e3..d652b18cfad 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<json::Decoder>>(&self, blk: ~fn(&Exec) -> T) -> Work<T>; } -impl @Mut<Prep> : TPrep { +impl TPrep for @Mut<Prep> { fn declare_input(&self, kind:&str, name:&str, val:&str) { do self.borrow_mut |p| { p.declared_inputs.insert(WorkKey::new(kind, name), |
