about summary refs log tree commit diff
path: root/src/libnative/io
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-03-08 18:21:49 -0800
committerAlex Crichton <alex@alexcrichton.com>2014-03-27 10:14:50 -0700
commitbb9172d7b512c36f34d34b024640f030d1fde2eb (patch)
tree0e4ea18ae30a12954db6b9fbe95f62222ade9301 /src/libnative/io
parentbdd24b2a56e8bf6b952bd8880364fb0a57c2c540 (diff)
downloadrust-bb9172d7b512c36f34d34b024640f030d1fde2eb.tar.gz
rust-bb9172d7b512c36f34d34b024640f030d1fde2eb.zip
Fix fallout of removing default bounds
This is all purely fallout of getting the previous commit to compile.
Diffstat (limited to 'src/libnative/io')
-rw-r--r--src/libnative/io/file_unix.rs4
-rw-r--r--src/libnative/io/mod.rs50
-rw-r--r--src/libnative/io/net.rs16
-rw-r--r--src/libnative/io/pipe_unix.rs12
4 files changed, 42 insertions, 40 deletions
diff --git a/src/libnative/io/file_unix.rs b/src/libnative/io/file_unix.rs
index b997aa4f11c..2e33110b700 100644
--- a/src/libnative/io/file_unix.rs
+++ b/src/libnative/io/file_unix.rs
@@ -176,8 +176,8 @@ impl rtio::RtioPipe for FileDesc {
     fn write(&mut self, buf: &[u8]) -> Result<(), IoError> {
         self.inner_write(buf)
     }
-    fn clone(&self) -> ~rtio::RtioPipe {
-        ~FileDesc { inner: self.inner.clone() } as ~rtio::RtioPipe
+    fn clone(&self) -> ~rtio::RtioPipe:Send {
+        ~FileDesc { inner: self.inner.clone() } as ~rtio::RtioPipe:Send
     }
 }
 
diff --git a/src/libnative/io/mod.rs b/src/libnative/io/mod.rs
index e802c8f0301..3536ec7dec6 100644
--- a/src/libnative/io/mod.rs
+++ b/src/libnative/io/mod.rs
@@ -227,20 +227,20 @@ impl IoFactory {
 
 impl rtio::IoFactory for IoFactory {
     // networking
-    fn tcp_connect(&mut self, addr: SocketAddr) -> IoResult<~RtioTcpStream> {
-        net::TcpStream::connect(addr).map(|s| ~s as ~RtioTcpStream)
+    fn tcp_connect(&mut self, addr: SocketAddr) -> IoResult<~RtioTcpStream:Send> {
+        net::TcpStream::connect(addr).map(|s| ~s as ~RtioTcpStream:Send)
     }
-    fn tcp_bind(&mut self, addr: SocketAddr) -> IoResult<~RtioTcpListener> {
-        net::TcpListener::bind(addr).map(|s| ~s as ~RtioTcpListener)
+    fn tcp_bind(&mut self, addr: SocketAddr) -> IoResult<~RtioTcpListener:Send> {
+        net::TcpListener::bind(addr).map(|s| ~s as ~RtioTcpListener:Send)
     }
-    fn udp_bind(&mut self, addr: SocketAddr) -> IoResult<~RtioUdpSocket> {
-        net::UdpSocket::bind(addr).map(|u| ~u as ~RtioUdpSocket)
+    fn udp_bind(&mut self, addr: SocketAddr) -> IoResult<~RtioUdpSocket:Send> {
+        net::UdpSocket::bind(addr).map(|u| ~u as ~RtioUdpSocket:Send)
     }
-    fn unix_bind(&mut self, path: &CString) -> IoResult<~RtioUnixListener> {
-        pipe::UnixListener::bind(path).map(|s| ~s as ~RtioUnixListener)
+    fn unix_bind(&mut self, path: &CString) -> IoResult<~RtioUnixListener:Send> {
+        pipe::UnixListener::bind(path).map(|s| ~s as ~RtioUnixListener:Send)
     }
-    fn unix_connect(&mut self, path: &CString) -> IoResult<~RtioPipe> {
-        pipe::UnixStream::connect(path).map(|s| ~s as ~RtioPipe)
+    fn unix_connect(&mut self, path: &CString) -> IoResult<~RtioPipe:Send> {
+        pipe::UnixStream::connect(path).map(|s| ~s as ~RtioPipe:Send)
     }
     fn get_host_addresses(&mut self, host: Option<&str>, servname: Option<&str>,
                           hint: Option<ai::Hint>) -> IoResult<~[ai::Info]> {
@@ -249,16 +249,16 @@ impl rtio::IoFactory for IoFactory {
 
     // filesystem operations
     fn fs_from_raw_fd(&mut self, fd: c_int,
-                      close: CloseBehavior) -> ~RtioFileStream {
+                      close: CloseBehavior) -> ~RtioFileStream:Send {
         let close = match close {
             rtio::CloseSynchronously | rtio::CloseAsynchronously => true,
             rtio::DontClose => false
         };
-        ~file::FileDesc::new(fd, close) as ~RtioFileStream
+        ~file::FileDesc::new(fd, close) as ~RtioFileStream:Send
     }
     fn fs_open(&mut self, path: &CString, fm: io::FileMode, fa: io::FileAccess)
-        -> IoResult<~RtioFileStream> {
-        file::open(path, fm, fa).map(|fd| ~fd as ~RtioFileStream)
+        -> IoResult<~RtioFileStream:Send> {
+        file::open(path, fm, fa).map(|fd| ~fd as ~RtioFileStream:Send)
     }
     fn fs_unlink(&mut self, path: &CString) -> IoResult<()> {
         file::unlink(path)
@@ -304,25 +304,27 @@ impl rtio::IoFactory for IoFactory {
     }
 
     // misc
-    fn timer_init(&mut self) -> IoResult<~RtioTimer> {
-        timer::Timer::new().map(|t| ~t as ~RtioTimer)
+    fn timer_init(&mut self) -> IoResult<~RtioTimer:Send> {
+        timer::Timer::new().map(|t| ~t as ~RtioTimer:Send)
     }
     fn spawn(&mut self, config: ProcessConfig)
-            -> IoResult<(~RtioProcess, ~[Option<~RtioPipe>])> {
+            -> IoResult<(~RtioProcess:Send, ~[Option<~RtioPipe:Send>])> {
         process::Process::spawn(config).map(|(p, io)| {
-            (~p as ~RtioProcess,
-             io.move_iter().map(|p| p.map(|p| ~p as ~RtioPipe)).collect())
+            (~p as ~RtioProcess:Send,
+             io.move_iter().map(|p| p.map(|p| ~p as ~RtioPipe:Send)).collect())
         })
     }
     fn kill(&mut self, pid: libc::pid_t, signum: int) -> IoResult<()> {
         process::Process::kill(pid, signum)
     }
-    fn pipe_open(&mut self, fd: c_int) -> IoResult<~RtioPipe> {
-        Ok(~file::FileDesc::new(fd, true) as ~RtioPipe)
+    fn pipe_open(&mut self, fd: c_int) -> IoResult<~RtioPipe:Send> {
+        Ok(~file::FileDesc::new(fd, true) as ~RtioPipe:Send)
     }
-    fn tty_open(&mut self, fd: c_int, _readable: bool) -> IoResult<~RtioTTY> {
+    fn tty_open(&mut self, fd: c_int, _readable: bool)
+        -> IoResult<~RtioTTY:Send>
+    {
         if unsafe { libc::isatty(fd) } != 0 {
-            Ok(~file::FileDesc::new(fd, true) as ~RtioTTY)
+            Ok(~file::FileDesc::new(fd, true) as ~RtioTTY:Send)
         } else {
             Err(IoError {
                 kind: io::MismatchedFileTypeForOperation,
@@ -332,7 +334,7 @@ impl rtio::IoFactory for IoFactory {
         }
     }
     fn signal(&mut self, _signal: Signum, _channel: Sender<Signum>)
-        -> IoResult<~RtioSignal> {
+        -> IoResult<~RtioSignal:Send> {
         Err(unimpl())
     }
 }
diff --git a/src/libnative/io/net.rs b/src/libnative/io/net.rs
index 6a711072942..6f6ddeec86b 100644
--- a/src/libnative/io/net.rs
+++ b/src/libnative/io/net.rs
@@ -348,8 +348,8 @@ impl rtio::RtioTcpStream for TcpStream {
         self.set_keepalive(None)
     }
 
-    fn clone(&self) -> ~rtio::RtioTcpStream {
-        ~TcpStream { inner: self.inner.clone() } as ~rtio::RtioTcpStream
+    fn clone(&self) -> ~rtio::RtioTcpStream:Send {
+        ~TcpStream { inner: self.inner.clone() } as ~rtio::RtioTcpStream:Send
     }
     fn close_write(&mut self) -> IoResult<()> {
         super::mkerr_libc(unsafe {
@@ -418,8 +418,8 @@ impl TcpListener {
 }
 
 impl rtio::RtioTcpListener for TcpListener {
-    fn listen(~self) -> IoResult<~rtio::RtioTcpAcceptor> {
-        self.native_listen(128).map(|a| ~a as ~rtio::RtioTcpAcceptor)
+    fn listen(~self) -> IoResult<~rtio::RtioTcpAcceptor:Send> {
+        self.native_listen(128).map(|a| ~a as ~rtio::RtioTcpAcceptor:Send)
     }
 }
 
@@ -461,8 +461,8 @@ impl rtio::RtioSocket for TcpAcceptor {
 }
 
 impl rtio::RtioTcpAcceptor for TcpAcceptor {
-    fn accept(&mut self) -> IoResult<~rtio::RtioTcpStream> {
-        self.native_accept().map(|s| ~s as ~rtio::RtioTcpStream)
+    fn accept(&mut self) -> IoResult<~rtio::RtioTcpStream:Send> {
+        self.native_accept().map(|s| ~s as ~rtio::RtioTcpStream:Send)
     }
 
     fn accept_simultaneously(&mut self) -> IoResult<()> { Ok(()) }
@@ -630,7 +630,7 @@ impl rtio::RtioUdpSocket for UdpSocket {
         self.set_broadcast(false)
     }
 
-    fn clone(&self) -> ~rtio::RtioUdpSocket {
-        ~UdpSocket { inner: self.inner.clone() } as ~rtio::RtioUdpSocket
+    fn clone(&self) -> ~rtio::RtioUdpSocket:Send {
+        ~UdpSocket { inner: self.inner.clone() } as ~rtio::RtioUdpSocket:Send
     }
 }
diff --git a/src/libnative/io/pipe_unix.rs b/src/libnative/io/pipe_unix.rs
index 9e81dc02cc5..e25571d02c9 100644
--- a/src/libnative/io/pipe_unix.rs
+++ b/src/libnative/io/pipe_unix.rs
@@ -150,8 +150,8 @@ impl rtio::RtioPipe for UnixStream {
         }
     }
 
-    fn clone(&self) -> ~rtio::RtioPipe {
-        ~UnixStream { inner: self.inner.clone() } as ~rtio::RtioPipe
+    fn clone(&self) -> ~rtio::RtioPipe:Send {
+        ~UnixStream { inner: self.inner.clone() } as ~rtio::RtioPipe:Send
     }
 }
 
@@ -250,8 +250,8 @@ impl UnixListener {
 }
 
 impl rtio::RtioUnixListener for UnixListener {
-    fn listen(~self) -> IoResult<~rtio::RtioUnixAcceptor> {
-        self.native_listen(128).map(|a| ~a as ~rtio::RtioUnixAcceptor)
+    fn listen(~self) -> IoResult<~rtio::RtioUnixAcceptor:Send> {
+        self.native_listen(128).map(|a| ~a as ~rtio::RtioUnixAcceptor:Send)
     }
 }
 
@@ -279,7 +279,7 @@ impl UnixAcceptor {
 }
 
 impl rtio::RtioUnixAcceptor for UnixAcceptor {
-    fn accept(&mut self) -> IoResult<~rtio::RtioPipe> {
-        self.native_accept().map(|s| ~s as ~rtio::RtioPipe)
+    fn accept(&mut self) -> IoResult<~rtio::RtioPipe:Send> {
+        self.native_accept().map(|s| ~s as ~rtio::RtioPipe:Send)
     }
 }