about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-01-02 21:56:13 +0000
committerbors <bors@rust-lang.org>2015-01-02 21:56:13 +0000
commitc89417130f042c58adc60012e7cddc4ef70b70b9 (patch)
tree344f3d621e187b41d23ef01f621ff68ebe810a03 /src/libstd/sys
parent4b40bc85cbc1d072179c92ce01655db0272aa598 (diff)
parent340f3fd7a909b30509a63916df06f2b885d113f7 (diff)
downloadrust-c89417130f042c58adc60012e7cddc4ef70b70b9.tar.gz
rust-c89417130f042c58adc60012e7cddc4ef70b70b9.zip
auto merge of #20436 : alexcrichton/rust/rollup, r=alexcrichton
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/common/backtrace.rs2
-rw-r--r--src/libstd/sys/common/helper_thread.rs7
-rw-r--r--src/libstd/sys/common/mod.rs2
-rw-r--r--src/libstd/sys/common/net.rs12
-rw-r--r--src/libstd/sys/common/thread_info.rs5
-rw-r--r--src/libstd/sys/common/thread_local.rs6
-rw-r--r--src/libstd/sys/unix/fs.rs13
-rw-r--r--src/libstd/sys/unix/mod.rs2
-rw-r--r--src/libstd/sys/unix/os.rs9
-rw-r--r--src/libstd/sys/unix/pipe.rs13
-rw-r--r--src/libstd/sys/unix/process.rs33
-rw-r--r--src/libstd/sys/unix/tcp.rs3
-rw-r--r--src/libstd/sys/unix/thread_local.rs2
-rw-r--r--src/libstd/sys/unix/timer.rs16
-rw-r--r--src/libstd/sys/unix/tty.rs3
-rw-r--r--src/libstd/sys/windows/c.rs5
-rw-r--r--src/libstd/sys/windows/fs.rs2
-rw-r--r--src/libstd/sys/windows/mod.rs7
-rw-r--r--src/libstd/sys/windows/mutex.rs4
-rw-r--r--src/libstd/sys/windows/os.rs2
-rw-r--r--src/libstd/sys/windows/pipe.rs6
-rw-r--r--src/libstd/sys/windows/process.rs8
-rw-r--r--src/libstd/sys/windows/tcp.rs2
-rw-r--r--src/libstd/sys/windows/thread_local.rs2
-rw-r--r--src/libstd/sys/windows/timer.rs12
-rw-r--r--src/libstd/sys/windows/tty.rs19
26 files changed, 101 insertions, 96 deletions
diff --git a/src/libstd/sys/common/backtrace.rs b/src/libstd/sys/common/backtrace.rs
index 866bf1d8a7d..d4039fd96ff 100644
--- a/src/libstd/sys/common/backtrace.rs
+++ b/src/libstd/sys/common/backtrace.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use prelude::*;
+use prelude::v1::*;
 
 use io::IoResult;
 
diff --git a/src/libstd/sys/common/helper_thread.rs b/src/libstd/sys/common/helper_thread.rs
index 9ef1c33312f..bdf1bf3dfd0 100644
--- a/src/libstd/sys/common/helper_thread.rs
+++ b/src/libstd/sys/common/helper_thread.rs
@@ -20,12 +20,13 @@
 //! can be created in the future and there must be no active timers at that
 //! time.
 
-use prelude::*;
+use prelude::v1::*;
 
 use cell::UnsafeCell;
 use mem;
-use sync::{StaticMutex, StaticCondvar};
 use rt;
+use sync::{StaticMutex, StaticCondvar};
+use sync::mpsc::{channel, Sender, Receiver};
 use sys::helper_signal;
 
 use thread::Thread;
@@ -117,7 +118,7 @@ impl<M: Send> Helper<M> {
             // message. Otherwise it could wake up and go to sleep before we
             // send the message.
             assert!(!self.chan.get().is_null());
-            (**self.chan.get()).send(msg);
+            (**self.chan.get()).send(msg).unwrap();
             helper_signal::signal(*self.signal.get() as helper_signal::signal);
         }
     }
diff --git a/src/libstd/sys/common/mod.rs b/src/libstd/sys/common/mod.rs
index dc0ad08cdbe..97015f74a4a 100644
--- a/src/libstd/sys/common/mod.rs
+++ b/src/libstd/sys/common/mod.rs
@@ -12,7 +12,7 @@
 #![allow(dead_code)]
 
 use io::{mod, IoError, IoResult};
-use prelude::*;
+use prelude::v1::*;
 use sys::{last_error, retry};
 use c_str::CString;
 use num::Int;
diff --git a/src/libstd/sys/common/net.rs b/src/libstd/sys/common/net.rs
index 259c15b5f06..cb0c5581abd 100644
--- a/src/libstd/sys/common/net.rs
+++ b/src/libstd/sys/common/net.rs
@@ -8,24 +8,24 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+use prelude::v1::*;
 use self::SocketStatus::*;
 use self::InAddr::*;
 
-use alloc::arc::Arc;
+use c_str::ToCStr;
+use io::net::addrinfo;
+use io::net::ip::{SocketAddr, IpAddr, Ipv4Addr, Ipv6Addr};
+use io::{IoResult, IoError};
 use libc::{mod, c_char, c_int};
 use c_str::CString;
 use mem;
 use num::Int;
 use ptr::{mod, null, null_mut};
-use io::net::ip::{SocketAddr, IpAddr, Ipv4Addr, Ipv6Addr};
-use io::net::addrinfo;
-use io::{IoResult, IoError};
 use sys::{mod, retry, c, sock_t, last_error, last_net_error, last_gai_error, close_sock,
           wrlen, msglen_t, os, wouldblock, set_nonblocking, timer, ms_to_timeval,
           decode_error_detailed};
-use sync::{Mutex, MutexGuard};
+use sync::{Arc, Mutex, MutexGuard};
 use sys_common::{mod, keep_going, short_write, timeout};
-use prelude::*;
 use cmp;
 use io;
 
diff --git a/src/libstd/sys/common/thread_info.rs b/src/libstd/sys/common/thread_info.rs
index 8c76eb1504d..92b936e74f6 100644
--- a/src/libstd/sys/common/thread_info.rs
+++ b/src/libstd/sys/common/thread_info.rs
@@ -10,9 +10,10 @@
 
 use core::prelude::*;
 
-use thread::Thread;
 use cell::RefCell;
 use string::String;
+use thread::Thread;
+use thread_local::State;
 
 struct ThreadInfo {
     // This field holds the known bounds of the stack in (lo, hi)
@@ -27,7 +28,7 @@ thread_local! { static THREAD_INFO: RefCell<Option<ThreadInfo>> = RefCell::new(N
 
 impl ThreadInfo {
     fn with<R, F>(f: F) -> R where F: FnOnce(&mut ThreadInfo) -> R {
-        if THREAD_INFO.destroyed() {
+        if THREAD_INFO.state() == State::Destroyed {
             panic!("Use of std::thread::Thread::current() is not possible after \
                     the thread's local data has been destroyed");
         }
diff --git a/src/libstd/sys/common/thread_local.rs b/src/libstd/sys/common/thread_local.rs
index fe7a7d8d037..9d7188a37bc 100644
--- a/src/libstd/sys/common/thread_local.rs
+++ b/src/libstd/sys/common/thread_local.rs
@@ -56,7 +56,7 @@
 
 #![allow(non_camel_case_types)]
 
-use prelude::*;
+use prelude::v1::*;
 
 use sync::atomic::{mod, AtomicUint};
 use sync::{Mutex, Once, ONCE_INIT};
@@ -137,7 +137,7 @@ pub const INIT: StaticKey = StaticKey {
 ///
 /// This value allows specific configuration of the destructor for a TLS key.
 pub const INIT_INNER: StaticKeyInner = StaticKeyInner {
-    key: atomic::INIT_ATOMIC_UINT,
+    key: atomic::ATOMIC_UINT_INIT,
 };
 
 static INIT_KEYS: Once = ONCE_INIT;
@@ -246,7 +246,7 @@ impl Drop for Key {
 
 #[cfg(test)]
 mod tests {
-    use prelude::*;
+    use prelude::v1::*;
     use super::{Key, StaticKey, INIT_INNER};
 
     fn assert_sync<T: Sync>() {}
diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs
index 8de4ffa7022..e3e0b279c12 100644
--- a/src/libstd/sys/unix/fs.rs
+++ b/src/libstd/sys/unix/fs.rs
@@ -10,16 +10,15 @@
 
 //! Blocking posix-based file I/O
 
-use libc::{mod, c_int, c_void};
-use c_str::CString;
-use mem;
-use io;
-
-use prelude::*;
+use prelude::v1::*;
 
+use c_str::{CString, ToCStr};
 use io::{FilePermission, Write, UnstableFileStat, Open, FileAccess, FileMode};
 use io::{IoResult, FileStat, SeekStyle};
 use io::{Read, Truncate, SeekCur, SeekSet, ReadWrite, SeekEnd, Append};
+use io;
+use libc::{mod, c_int, c_void};
+use mem;
 use sys::retry;
 use sys_common::{keep_going, eof, mkerr_libc};
 
@@ -360,7 +359,7 @@ mod tests {
     use super::FileDesc;
     use libc;
     use os;
-    use prelude::*;
+    use prelude::v1::*;
 
     #[cfg_attr(target_os = "freebsd", ignore)] // hmm, maybe pipes have a tiny buffer
     #[test]
diff --git a/src/libstd/sys/unix/mod.rs b/src/libstd/sys/unix/mod.rs
index c82dacf1e44..4199cbc1bb9 100644
--- a/src/libstd/sys/unix/mod.rs
+++ b/src/libstd/sys/unix/mod.rs
@@ -19,7 +19,7 @@ extern crate libc;
 
 use num;
 use num::{Int, SignedInt};
-use prelude::*;
+use prelude::v1::*;
 use io::{mod, IoResult, IoError};
 use sys_common::mkerr_libc;
 
diff --git a/src/libstd/sys/unix/os.rs b/src/libstd/sys/unix/os.rs
index 595191db3b2..6a8f55e79c8 100644
--- a/src/libstd/sys/unix/os.rs
+++ b/src/libstd/sys/unix/os.rs
@@ -10,17 +10,18 @@
 
 //! Implementation of `std::os` functionality for unix systems
 
-use prelude::*;
+use prelude::v1::*;
 
+use c_str::ToCStr;
 use error::{FromError, Error};
 use fmt;
 use io::{IoError, IoResult};
 use libc::{mod, c_int, c_char, c_void};
-use path::BytesContainer;
+use os;
+use path::{BytesContainer};
 use ptr;
-use sync::atomic::{AtomicInt, INIT_ATOMIC_INT, SeqCst};
+use sync::atomic::{AtomicInt, SeqCst};
 use sys::fs::FileDesc;
-use os;
 
 use os::TMPBUF_SZ;
 
diff --git a/src/libstd/sys/unix/pipe.rs b/src/libstd/sys/unix/pipe.rs
index 868b460aa5e..623f3f6a89c 100644
--- a/src/libstd/sys/unix/pipe.rs
+++ b/src/libstd/sys/unix/pipe.rs
@@ -8,13 +8,13 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use alloc::arc::Arc;
+use prelude::v1::*;
+
 use libc;
 use c_str::CString;
 use mem;
-use sync::{atomic, Mutex};
+use sync::{atomic, Arc, Mutex};
 use io::{mod, IoResult, IoError};
-use prelude::*;
 
 use sys::{mod, timer, retry, c, set_nonblocking, wouldblock};
 use sys::fs::{fd_t, FileDesc};
@@ -117,9 +117,6 @@ pub struct UnixStream {
     write_deadline: u64,
 }
 
-unsafe impl Send for UnixStream {}
-unsafe impl Sync for UnixStream {}
-
 impl UnixStream {
     pub fn connect(addr: &CString,
                    timeout: Option<u64>) -> IoResult<UnixStream> {
@@ -218,6 +215,7 @@ pub struct UnixListener {
     path: CString,
 }
 
+// we currently own the CString, so these impls should be safe
 unsafe impl Send for UnixListener {}
 unsafe impl Sync for UnixListener {}
 
@@ -265,9 +263,6 @@ struct AcceptorInner {
     closed: atomic::AtomicBool,
 }
 
-unsafe impl Send for AcceptorInner {}
-unsafe impl Sync for AcceptorInner {}
-
 impl UnixAcceptor {
     pub fn fd(&self) -> fd_t { self.inner.listener.fd() }
 
diff --git a/src/libstd/sys/unix/process.rs b/src/libstd/sys/unix/process.rs
index c1c28bd5fc4..af09bf4fbd0 100644
--- a/src/libstd/sys/unix/process.rs
+++ b/src/libstd/sys/unix/process.rs
@@ -7,22 +7,23 @@
 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
+
+use prelude::v1::*;
 use self::Req::*;
 
-use libc::{mod, pid_t, c_void, c_int};
-use c_str::CString;
+use c_str::{CString, ToCStr};
+use collections;
+use hash::Hash;
+use io::process::{ProcessExit, ExitStatus, ExitSignal};
 use io::{mod, IoResult, IoError, EndOfFile};
+use libc::{mod, pid_t, c_void, c_int};
 use mem;
 use os;
-use ptr;
-use prelude::*;
-use io::process::{ProcessExit, ExitStatus, ExitSignal};
-use collections;
 use path::BytesContainer;
-use hash::Hash;
-
-use sys::{mod, retry, c, wouldblock, set_nonblocking, ms_to_timeval};
+use ptr;
+use sync::mpsc::{channel, Sender, Receiver};
 use sys::fs::FileDesc;
+use sys::{mod, retry, c, wouldblock, set_nonblocking, ms_to_timeval};
 use sys_common::helper_thread::Helper;
 use sys_common::{AsInner, mkerr_libc, timeout};
 
@@ -276,8 +277,8 @@ impl Process {
     }
 
     pub fn wait(&self, deadline: u64) -> IoResult<ProcessExit> {
-        use std::cmp;
-        use std::comm;
+        use cmp;
+        use sync::mpsc::TryRecvError;
 
         static mut WRITE_FD: libc::c_int = 0;
 
@@ -336,9 +337,9 @@ impl Process {
 
         let (tx, rx) = channel();
         unsafe { HELPER.send(NewChild(self.pid, tx, deadline)); }
-        return match rx.recv_opt() {
+        return match rx.recv() {
             Ok(e) => Ok(e),
-            Err(()) => Err(timeout("wait timed out")),
+            Err(..) => Err(timeout("wait timed out")),
         };
 
         // Register a new SIGCHLD handler, returning the reading half of the
@@ -419,11 +420,11 @@ impl Process {
                             Ok(NewChild(pid, tx, deadline)) => {
                                 active.push((pid, tx, deadline));
                             }
-                            Err(comm::Disconnected) => {
+                            Err(TryRecvError::Disconnected) => {
                                 assert!(active.len() == 0);
                                 break 'outer;
                             }
-                            Err(comm::Empty) => break,
+                            Err(TryRecvError::Empty) => break,
                         }
                     }
                 }
@@ -459,7 +460,7 @@ impl Process {
                     active.retain(|&(pid, ref tx, _)| {
                         let pr = Process { pid: pid };
                         match pr.try_wait() {
-                            Some(msg) => { tx.send(msg); false }
+                            Some(msg) => { tx.send(msg).unwrap(); false }
                             None => true,
                         }
                     });
diff --git a/src/libstd/sys/unix/tcp.rs b/src/libstd/sys/unix/tcp.rs
index e2a78947e16..13ccf685fd7 100644
--- a/src/libstd/sys/unix/tcp.rs
+++ b/src/libstd/sys/unix/tcp.rs
@@ -8,12 +8,13 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+use prelude::v1::*;
+
 use io::net::ip;
 use io::IoResult;
 use libc;
 use mem;
 use ptr;
-use prelude::*;
 use super::{last_error, last_net_error, retry, sock_t};
 use sync::{Arc, atomic};
 use sys::fs::FileDesc;
diff --git a/src/libstd/sys/unix/thread_local.rs b/src/libstd/sys/unix/thread_local.rs
index b300e93eeb6..e507377a8fc 100644
--- a/src/libstd/sys/unix/thread_local.rs
+++ b/src/libstd/sys/unix/thread_local.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use prelude::*;
+use prelude::v1::*;
 use libc::c_int;
 
 pub type Key = pthread_key_t;
diff --git a/src/libstd/sys/unix/timer.rs b/src/libstd/sys/unix/timer.rs
index c0ef89666c0..80f93dd2f61 100644
--- a/src/libstd/sys/unix/timer.rs
+++ b/src/libstd/sys/unix/timer.rs
@@ -46,19 +46,19 @@
 //!
 //! Note that all time units in this file are in *milliseconds*.
 
+use prelude::v1::*;
 use self::Req::*;
 
+use io::IoResult;
 use libc;
 use mem;
 use os;
 use ptr;
 use sync::atomic;
-use comm;
+use sync::mpsc::{channel, Sender, Receiver, TryRecvError};
 use sys::c;
 use sys::fs::FileDesc;
 use sys_common::helper_thread::Helper;
-use prelude::*;
-use io::IoResult;
 
 helper_init! { static HELPER: Helper<Req> }
 
@@ -168,7 +168,7 @@ fn helper(input: libc::c_int, messages: Receiver<Req>, _: ()) {
             1 => {
                 loop {
                     match messages.try_recv() {
-                        Err(comm::Disconnected) => {
+                        Err(TryRecvError::Disconnected) => {
                             assert!(active.len() == 0);
                             break 'outer;
                         }
@@ -179,7 +179,7 @@ fn helper(input: libc::c_int, messages: Receiver<Req>, _: ()) {
                             match dead.iter().position(|&(i, _)| id == i) {
                                 Some(i) => {
                                     let (_, i) = dead.remove(i);
-                                    ack.send(i);
+                                    ack.send(i).unwrap();
                                     continue
                                 }
                                 None => {}
@@ -187,7 +187,7 @@ fn helper(input: libc::c_int, messages: Receiver<Req>, _: ()) {
                             let i = active.iter().position(|i| i.id == id);
                             let i = i.expect("no timer found");
                             let t = active.remove(i);
-                            ack.send(t);
+                            ack.send(t).unwrap();
                         }
                         Err(..) => break
                     }
@@ -211,7 +211,7 @@ impl Timer {
         // instead of ()
         HELPER.boot(|| {}, helper);
 
-        static ID: atomic::AtomicUint = atomic::INIT_ATOMIC_UINT;
+        static ID: atomic::AtomicUint = atomic::ATOMIC_UINT_INIT;
         let id = ID.fetch_add(1, atomic::Relaxed);
         Ok(Timer {
             id: id,
@@ -271,7 +271,7 @@ impl Timer {
             None => {
                 let (tx, rx) = channel();
                 HELPER.send(RemoveTimer(self.id, tx));
-                rx.recv()
+                rx.recv().unwrap()
             }
         }
     }
diff --git a/src/libstd/sys/unix/tty.rs b/src/libstd/sys/unix/tty.rs
index 28c17fd4966..4ef687d41d8 100644
--- a/src/libstd/sys/unix/tty.rs
+++ b/src/libstd/sys/unix/tty.rs
@@ -8,8 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+use prelude::v1::*;
+
 use sys::fs::FileDesc;
-use prelude::*;
 use libc::{mod, c_int};
 use io::{mod, IoResult, IoError};
 use sys_common;
diff --git a/src/libstd/sys/windows/c.rs b/src/libstd/sys/windows/c.rs
index 6cccefbe890..1ee57434fb9 100644
--- a/src/libstd/sys/windows/c.rs
+++ b/src/libstd/sys/windows/c.rs
@@ -15,7 +15,7 @@
 #![allow(non_camel_case_types)]
 
 use libc;
-use prelude::*;
+use prelude::v1::*;
 
 pub const WSADESCRIPTION_LEN: uint = 256;
 pub const WSASYS_STATUS_LEN: uint = 128;
@@ -132,7 +132,8 @@ extern "system" {
 pub mod compat {
     use intrinsics::{atomic_store_relaxed, transmute};
     use libc::types::os::arch::extra::{LPCWSTR, HMODULE, LPCSTR, LPVOID};
-    use prelude::*;
+    use prelude::v1::*;
+    use c_str::ToCStr;
 
     extern "system" {
         fn GetModuleHandleW(lpModuleName: LPCWSTR) -> HMODULE;
diff --git a/src/libstd/sys/windows/fs.rs b/src/libstd/sys/windows/fs.rs
index 3ad439078b9..523d60c71aa 100644
--- a/src/libstd/sys/windows/fs.rs
+++ b/src/libstd/sys/windows/fs.rs
@@ -21,7 +21,7 @@ use ptr;
 use str;
 use io;
 
-use prelude::*;
+use prelude::v1::*;
 use sys;
 use sys::os;
 use sys_common::{keep_going, eof, mkerr_libc};
diff --git a/src/libstd/sys/windows/mod.rs b/src/libstd/sys/windows/mod.rs
index 57c284ed6a3..1034f0615d9 100644
--- a/src/libstd/sys/windows/mod.rs
+++ b/src/libstd/sys/windows/mod.rs
@@ -18,9 +18,10 @@
 
 extern crate libc;
 
+use prelude::v1::*;
+
 use num;
 use mem;
-use prelude::*;
 use io::{mod, IoResult, IoError};
 use sync::{Once, ONCE_INIT};
 
@@ -28,7 +29,7 @@ macro_rules! helper_init { (static $name:ident: Helper<$m:ty>) => (
     static $name: Helper<$m> = Helper {
         lock: ::sync::MUTEX_INIT,
         cond: ::sync::CONDVAR_INIT,
-        chan: ::cell::UnsafeCell { value: 0 as *mut Sender<$m> },
+        chan: ::cell::UnsafeCell { value: 0 as *mut ::sync::mpsc::Sender<$m> },
         signal: ::cell::UnsafeCell { value: 0 },
         initialized: ::cell::UnsafeCell { value: false },
         shutdown: ::cell::UnsafeCell { value: false },
@@ -171,7 +172,7 @@ pub fn init_net() {
     unsafe {
         static START: Once = ONCE_INIT;
 
-        START.doit(|| {
+        START.call_once(|| {
             let mut data: c::WSADATA = mem::zeroed();
             let ret = c::WSAStartup(0x202, // version 2.2
                                     &mut data);
diff --git a/src/libstd/sys/windows/mutex.rs b/src/libstd/sys/windows/mutex.rs
index 3ac7c09154e..e0fa02b5599 100644
--- a/src/libstd/sys/windows/mutex.rs
+++ b/src/libstd/sys/windows/mutex.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use prelude::*;
+use prelude::v1::*;
 
 use sync::atomic;
 use alloc::{mod, heap};
@@ -20,7 +20,7 @@ const SPIN_COUNT: DWORD = 4000;
 
 pub struct Mutex { inner: atomic::AtomicUint }
 
-pub const MUTEX_INIT: Mutex = Mutex { inner: atomic::INIT_ATOMIC_UINT };
+pub const MUTEX_INIT: Mutex = Mutex { inner: atomic::ATOMIC_UINT_INIT };
 
 unsafe impl Sync for Mutex {}
 
diff --git a/src/libstd/sys/windows/os.rs b/src/libstd/sys/windows/os.rs
index 09003f87ff0..dfdee0e0385 100644
--- a/src/libstd/sys/windows/os.rs
+++ b/src/libstd/sys/windows/os.rs
@@ -13,7 +13,7 @@
 // FIXME: move various extern bindings from here into liblibc or
 // something similar
 
-use prelude::*;
+use prelude::v1::*;
 
 use fmt;
 use io::{IoResult, IoError};
diff --git a/src/libstd/sys/windows/pipe.rs b/src/libstd/sys/windows/pipe.rs
index fc3640f2604..f173d5fc6d4 100644
--- a/src/libstd/sys/windows/pipe.rs
+++ b/src/libstd/sys/windows/pipe.rs
@@ -84,14 +84,14 @@
 //! the test suite passing (the suite is in libstd), and that's good enough for
 //! me!
 
-use alloc::arc::Arc;
+use prelude::v1::*;
+
 use libc;
 use c_str::CString;
 use mem;
 use ptr;
-use sync::{atomic, Mutex};
+use sync::{atomic, Arc, Mutex};
 use io::{mod, IoError, IoResult};
-use prelude::*;
 
 use sys_common::{mod, eof};
 
diff --git a/src/libstd/sys/windows/process.rs b/src/libstd/sys/windows/process.rs
index b03c62395d1..cb99a886ce4 100644
--- a/src/libstd/sys/windows/process.rs
+++ b/src/libstd/sys/windows/process.rs
@@ -8,14 +8,15 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+use prelude::v1::*;
+
 use libc::{pid_t, c_void, c_int};
 use libc;
-use c_str::CString;
+use c_str::{CString, ToCStr};
 use io;
 use mem;
 use os;
 use ptr;
-use prelude::*;
 use io::process::{ProcessExit, ExitStatus, ExitSignal};
 use collections;
 use path::BytesContainer;
@@ -466,10 +467,11 @@ fn free_handle(handle: *mut ()) {
 
 #[cfg(test)]
 mod tests {
+    use c_str::ToCStr;
 
     #[test]
     fn test_make_command_line() {
-        use prelude::*;
+        use prelude::v1::*;
         use str;
         use c_str::CString;
         use super::make_command_line;
diff --git a/src/libstd/sys/windows/tcp.rs b/src/libstd/sys/windows/tcp.rs
index 513c1d38e36..5a929f6b2b5 100644
--- a/src/libstd/sys/windows/tcp.rs
+++ b/src/libstd/sys/windows/tcp.rs
@@ -13,7 +13,7 @@ use io::IoResult;
 use libc;
 use mem;
 use ptr;
-use prelude::*;
+use prelude::v1::*;
 use super::{last_error, last_net_error, retry, sock_t};
 use sync::{Arc, atomic};
 use sys::fs::FileDesc;
diff --git a/src/libstd/sys/windows/thread_local.rs b/src/libstd/sys/windows/thread_local.rs
index 60b0d584db3..b96e26c7a86 100644
--- a/src/libstd/sys/windows/thread_local.rs
+++ b/src/libstd/sys/windows/thread_local.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use prelude::*;
+use prelude::v1::*;
 
 use libc::types::os::arch::extra::{DWORD, LPVOID, BOOL};
 
diff --git a/src/libstd/sys/windows/timer.rs b/src/libstd/sys/windows/timer.rs
index 874838950cd..343b78543bf 100644
--- a/src/libstd/sys/windows/timer.rs
+++ b/src/libstd/sys/windows/timer.rs
@@ -21,16 +21,16 @@
 //! the other two implementations of timers with nothing *that* new showing up.
 
 use self::Req::*;
+use prelude::v1::*;
 
 use libc;
 use ptr;
-use comm;
 
+use io::IoResult;
+use sync::mpsc::{channel, Sender, Receiver, TryRecvError};
 use sys::c;
 use sys::fs::FileDesc;
 use sys_common::helper_thread::Helper;
-use prelude::*;
-use io::IoResult;
 
 helper_init! { static HELPER: Helper<Req> }
 
@@ -71,7 +71,7 @@ fn helper(input: libc::HANDLE, messages: Receiver<Req>, _: ()) {
                         chans.push((c, one));
                     }
                     Ok(RemoveTimer(obj, c)) => {
-                        c.send(());
+                        c.send(()).unwrap();
                         match objs.iter().position(|&o| o == obj) {
                             Some(i) => {
                                 drop(objs.remove(i));
@@ -80,7 +80,7 @@ fn helper(input: libc::HANDLE, messages: Receiver<Req>, _: ()) {
                             None => {}
                         }
                     }
-                    Err(comm::Disconnected) => {
+                    Err(TryRecvError::Disconnected) => {
                         assert_eq!(objs.len(), 1);
                         assert_eq!(chans.len(), 0);
                         break 'outer;
@@ -132,7 +132,7 @@ impl Timer {
 
         let (tx, rx) = channel();
         HELPER.send(RemoveTimer(self.obj, tx));
-        rx.recv();
+        rx.recv().unwrap();
 
         self.on_worker = false;
     }
diff --git a/src/libstd/sys/windows/tty.rs b/src/libstd/sys/windows/tty.rs
index a88d11eed22..7591025d76d 100644
--- a/src/libstd/sys/windows/tty.rs
+++ b/src/libstd/sys/windows/tty.rs
@@ -25,19 +25,20 @@
 //! wrapper that performs encoding/decoding, this implementation should switch
 //! to working in raw UTF-16, with such a wrapper around it.
 
-use super::c::{ReadConsoleW, WriteConsoleW, GetConsoleMode, SetConsoleMode};
-use super::c::{ERROR_ILLEGAL_CHARACTER};
-use super::c::{ENABLE_ECHO_INPUT, ENABLE_EXTENDED_FLAGS};
-use super::c::{ENABLE_INSERT_MODE, ENABLE_LINE_INPUT};
-use super::c::{ENABLE_PROCESSED_INPUT, ENABLE_QUICK_EDIT_MODE};
-use libc::{c_int, HANDLE, LPDWORD, DWORD, LPVOID};
-use libc::{get_osfhandle, CloseHandle};
-use libc::types::os::arch::extra::LPCVOID;
+use prelude::v1::*;
+
 use io::{mod, IoError, IoResult, MemReader};
 use iter::repeat;
-use prelude::*;
+use libc::types::os::arch::extra::LPCVOID;
+use libc::{c_int, HANDLE, LPDWORD, DWORD, LPVOID};
+use libc::{get_osfhandle, CloseHandle};
 use ptr;
 use str::from_utf8;
+use super::c::{ENABLE_ECHO_INPUT, ENABLE_EXTENDED_FLAGS};
+use super::c::{ENABLE_INSERT_MODE, ENABLE_LINE_INPUT};
+use super::c::{ENABLE_PROCESSED_INPUT, ENABLE_QUICK_EDIT_MODE};
+use super::c::{ERROR_ILLEGAL_CHARACTER};
+use super::c::{ReadConsoleW, WriteConsoleW, GetConsoleMode, SetConsoleMode};
 
 fn invalid_encoding() -> IoError {
     IoError {