From d10106e91961f7da392d33d82086d41d81d7682d Mon Sep 17 00:00:00 2001 From: reedlepee Date: Wed, 30 Oct 2013 06:40:40 +0530 Subject: [PATCH] changed all the impl to impl in rt::comm.rs and libstd::comm.rs #8180 --- src/libstd/comm.rs | 4 ++-- src/libstd/rt/comm.rs | 42 +++++++++++++++++++++--------------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/libstd/comm.rs b/src/libstd/comm.rs index 7212635233faf..d84b223f80f8f 100644 --- a/src/libstd/comm.rs +++ b/src/libstd/comm.rs @@ -188,7 +188,7 @@ impl SendDeferred for SharedChan { } } -impl Clone for SharedChan { +impl Clone for SharedChan { fn clone(&self) -> SharedChan { let &SharedChan { x: ref c } = self; SharedChan { x: c.clone() } @@ -216,7 +216,7 @@ impl GenericPort for SharedPort { } } -impl Clone for SharedPort { +impl Clone for SharedPort { fn clone(&self) -> SharedPort { let &SharedPort { x: ref p } = self; SharedPort { x: p.clone() } diff --git a/src/libstd/rt/comm.rs b/src/libstd/rt/comm.rs index a3fd4dca53480..96132860a88bd 100644 --- a/src/libstd/rt/comm.rs +++ b/src/libstd/rt/comm.rs @@ -78,7 +78,7 @@ pub fn oneshot() -> (PortOne, ChanOne) { } } -impl ChanOne { +impl ChanOne { #[inline] fn packet(&self) -> *mut Packet { unsafe { @@ -181,7 +181,7 @@ impl ChanOne { } } -impl PortOne { +impl PortOne { fn packet(&self) -> *mut Packet { unsafe { let p: *mut ~Packet = cast::transmute(&self.void_packet); @@ -218,7 +218,7 @@ impl PortOne { } } -impl SelectInner for PortOne { +impl SelectInner for PortOne { #[inline] #[cfg(not(test))] fn optimistic_check(&mut self) -> bool { unsafe { (*self.packet()).state.load(Acquire) == STATE_ONE } @@ -319,9 +319,9 @@ impl SelectInner for PortOne { } } -impl Select for PortOne { } +impl Select for PortOne { } -impl SelectPortInner for PortOne { +impl SelectPortInner for PortOne { fn recv_ready(mut self) -> Option { let packet = self.packet(); @@ -352,9 +352,9 @@ impl SelectPortInner for PortOne { } } -impl SelectPort for PortOne { } +impl SelectPort for PortOne { } -impl Peekable for PortOne { +impl Peekable for PortOne { fn peek(&self) -> bool { unsafe { let packet: *mut Packet = self.packet(); @@ -369,7 +369,7 @@ impl Peekable for PortOne { } #[unsafe_destructor] -impl Drop for ChanOne { +impl Drop for ChanOne { fn drop(&mut self) { if self.suppress_finalize { return } @@ -396,7 +396,7 @@ impl Drop for ChanOne { } #[unsafe_destructor] -impl Drop for PortOne { +impl Drop for PortOne { fn drop(&mut self) { if self.suppress_finalize { return } @@ -484,7 +484,7 @@ impl SendDeferred for Chan { } } -impl GenericPort for Port { +impl GenericPort for Port { fn recv(&self) -> T { match self.try_recv() { Some(val) => val, @@ -507,7 +507,7 @@ impl GenericPort for Port { } } -impl Peekable for Port { +impl Peekable for Port { fn peek(&self) -> bool { self.next.with_mut_ref(|p| p.peek()) } @@ -517,7 +517,7 @@ impl Peekable for Port { // of them, but a &Port should also be selectable so you can select2 on it // alongside a PortOne without passing the port by value in recv_ready. -impl<'self, T> SelectInner for &'self Port { +impl<'self, T: Send> SelectInner for &'self Port { #[inline] fn optimistic_check(&mut self) -> bool { do self.next.with_mut_ref |pone| { pone.optimistic_check() } @@ -535,9 +535,9 @@ impl<'self, T> SelectInner for &'self Port { } } -impl<'self, T> Select for &'self Port { } +impl<'self, T: Send> Select for &'self Port { } -impl SelectInner for Port { +impl SelectInner for Port { #[inline] fn optimistic_check(&mut self) -> bool { (&*self).optimistic_check() @@ -554,9 +554,9 @@ impl SelectInner for Port { } } -impl Select for Port { } +impl Select for Port { } -impl<'self, T> SelectPortInner for &'self Port { +impl<'self, T: Send> SelectPortInner for &'self Port { fn recv_ready(self) -> Option { match self.next.take().recv_ready() { Some(StreamPayload { val, next }) => { @@ -568,14 +568,14 @@ impl<'self, T> SelectPortInner for &'self Port { } } -impl<'self, T> SelectPort for &'self Port { } +impl<'self, T: Send> SelectPort for &'self Port { } pub struct SharedChan { // Just like Chan, but a shared AtomicOption instead of Cell priv next: UnsafeArc>> } -impl SharedChan { +impl SharedChan { pub fn new(chan: Chan) -> SharedChan { let next = chan.next.take(); let next = AtomicOption::new(~next); @@ -615,7 +615,7 @@ impl SendDeferred for SharedChan { } } -impl Clone for SharedChan { +impl Clone for SharedChan { fn clone(&self) -> SharedChan { SharedChan { next: self.next.clone() @@ -628,7 +628,7 @@ pub struct SharedPort { priv next_link: UnsafeArc>>> } -impl SharedPort { +impl SharedPort { pub fn new(port: Port) -> SharedPort { // Put the data port into a new link pipe let next_data_port = port.next.take(); @@ -670,7 +670,7 @@ impl GenericPort for SharedPort { } } -impl Clone for SharedPort { +impl Clone for SharedPort { fn clone(&self) -> SharedPort { SharedPort { next_link: self.next_link.clone()