about summary refs log tree commit diff
path: root/src/libnative/io
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2014-08-18 08:29:44 -0700
committerPatrick Walton <pcwalton@mimiga.net>2014-08-18 09:19:10 -0700
commit67deb2e65e150a1b9b2fcd457da47e3e13b2c4f7 (patch)
tree37fe9cab468b9f6757ca415f42a072a59012ee1e /src/libnative/io
parent7074592ee1ad1a155919268229b6464f2acc576e (diff)
downloadrust-67deb2e65e150a1b9b2fcd457da47e3e13b2c4f7.tar.gz
rust-67deb2e65e150a1b9b2fcd457da47e3e13b2c4f7.zip
libsyntax: Remove the `use foo = bar` syntax from the language in favor
of `use bar as foo`.

Change all uses of `use foo = bar` to `use bar as foo`.

Implements RFC #47.

Closes #16461.

[breaking-change]
Diffstat (limited to 'src/libnative/io')
-rw-r--r--src/libnative/io/mod.rs4
-rw-r--r--src/libnative/io/net.rs4
-rw-r--r--src/libnative/io/pipe_unix.rs4
-rw-r--r--src/libnative/io/process.rs8
-rw-r--r--src/libnative/io/util.rs16
5 files changed, 18 insertions, 18 deletions
diff --git a/src/libnative/io/mod.rs b/src/libnative/io/mod.rs
index afd818bd7d7..5d661007329 100644
--- a/src/libnative/io/mod.rs
+++ b/src/libnative/io/mod.rs
@@ -79,8 +79,8 @@ mod tty;
 #[cfg(windows)] #[path = "c_win32.rs"] mod c;
 
 fn unimpl() -> IoError {
-    #[cfg(unix)] use ERROR = libc::ENOSYS;
-    #[cfg(windows)] use ERROR = libc::ERROR_CALL_NOT_IMPLEMENTED;
+    #[cfg(unix)] use libc::ENOSYS as ERROR;
+    #[cfg(windows)] use libc::ERROR_CALL_NOT_IMPLEMENTED as ERROR;
     IoError {
         code: ERROR as uint,
         extra: 0,
diff --git a/src/libnative/io/net.rs b/src/libnative/io/net.rs
index a5332c8d077..2255578ba80 100644
--- a/src/libnative/io/net.rs
+++ b/src/libnative/io/net.rs
@@ -210,8 +210,8 @@ pub fn sockaddr_to_addr(storage: &libc::sockaddr_storage,
             })
         }
         _ => {
-            #[cfg(unix)] use ERROR = libc::EINVAL;
-            #[cfg(windows)] use ERROR = libc::WSAEINVAL;
+            #[cfg(unix)] use libc::EINVAL as ERROR;
+            #[cfg(windows)] use libc::WSAEINVAL as ERROR;
             Err(IoError {
                 code: ERROR as uint,
                 extra: 0,
diff --git a/src/libnative/io/pipe_unix.rs b/src/libnative/io/pipe_unix.rs
index bc3f917a3dc..895b8b5929c 100644
--- a/src/libnative/io/pipe_unix.rs
+++ b/src/libnative/io/pipe_unix.rs
@@ -39,8 +39,8 @@ fn addr_to_sockaddr_un(addr: &CString,
 
     let len = addr.len();
     if len > s.sun_path.len() - 1 {
-        #[cfg(unix)] use ERROR = libc::EINVAL;
-        #[cfg(windows)] use ERROR = libc::WSAEINVAL;
+        #[cfg(unix)] use libc::EINVAL as ERROR;
+        #[cfg(windows)] use libc::WSAEINVAL as ERROR;
         return Err(IoError {
             code: ERROR as uint,
             extra: 0,
diff --git a/src/libnative/io/process.rs b/src/libnative/io/process.rs
index 4b832a4a97e..443d7645388 100644
--- a/src/libnative/io/process.rs
+++ b/src/libnative/io/process.rs
@@ -148,8 +148,8 @@ impl rtio::RtioProcess for Process {
     }
 
     fn kill(&mut self, signum: int) -> IoResult<()> {
-        #[cfg(unix)] use ERROR = libc::EINVAL;
-        #[cfg(windows)] use ERROR = libc::ERROR_NOTHING_TO_TERMINATE;
+        #[cfg(unix)] use libc::EINVAL as ERROR;
+        #[cfg(windows)] use libc::ERROR_NOTHING_TO_TERMINATE as ERROR;
 
         // On linux (and possibly other unices), a process that has exited will
         // continue to accept signals because it is "defunct". The delivery of
@@ -192,8 +192,8 @@ impl Drop for Process {
 }
 
 fn pipe() -> IoResult<(file::FileDesc, file::FileDesc)> {
-    #[cfg(unix)] use ERROR = libc::EMFILE;
-    #[cfg(windows)] use ERROR = libc::WSAEMFILE;
+    #[cfg(unix)] use libc::EMFILE as ERROR;
+    #[cfg(windows)] use libc::WSAEMFILE as ERROR;
     struct Closer { fd: libc::c_int }
 
     let os::Pipe { reader, writer } = match unsafe { os::pipe() } {
diff --git a/src/libnative/io/util.rs b/src/libnative/io/util.rs
index 97518bbf199..356805d91de 100644
--- a/src/libnative/io/util.rs
+++ b/src/libnative/io/util.rs
@@ -25,8 +25,8 @@ pub enum SocketStatus {
 }
 
 pub fn timeout(desc: &'static str) -> IoError {
-    #[cfg(unix)] use ERROR = libc::ETIMEDOUT;
-    #[cfg(windows)] use ERROR = libc::ERROR_OPERATION_ABORTED;
+    #[cfg(unix)] use libc::ETIMEDOUT as ERROR;
+    #[cfg(windows)] use libc::ERROR_OPERATION_ABORTED as ERROR;
     IoError {
         code: ERROR as uint,
         extra: 0,
@@ -35,8 +35,8 @@ pub fn timeout(desc: &'static str) -> IoError {
 }
 
 pub fn short_write(n: uint, desc: &'static str) -> IoError {
-    #[cfg(unix)] use ERROR = libc::EAGAIN;
-    #[cfg(windows)] use ERROR = libc::ERROR_OPERATION_ABORTED;
+    #[cfg(unix)] use libc::EAGAIN as ERROR;
+    #[cfg(windows)] use libc::ERROR_OPERATION_ABORTED as ERROR;
     IoError {
         code: ERROR as uint,
         extra: n,
@@ -102,10 +102,10 @@ pub fn connect_timeout(fd: net::sock_t,
                        len: libc::socklen_t,
                        timeout_ms: u64) -> IoResult<()> {
     use std::os;
-    #[cfg(unix)]    use INPROGRESS = libc::EINPROGRESS;
-    #[cfg(windows)] use INPROGRESS = libc::WSAEINPROGRESS;
-    #[cfg(unix)]    use WOULDBLOCK = libc::EWOULDBLOCK;
-    #[cfg(windows)] use WOULDBLOCK = libc::WSAEWOULDBLOCK;
+    #[cfg(unix)]    use libc::EINPROGRESS as INPROGRESS;
+    #[cfg(windows)] use libc::WSAEINPROGRESS as INPROGRESS;
+    #[cfg(unix)]    use libc::EWOULDBLOCK as WOULDBLOCK;
+    #[cfg(windows)] use libc::WSAEWOULDBLOCK as WOULDBLOCK;
 
     // Make sure the call to connect() doesn't block
     try!(set_nonblocking(fd, true));