diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-12-22 09:04:23 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-01-02 08:54:06 -0800 |
| commit | 56290a004493a5d2e211f056601533253497df60 (patch) | |
| tree | ab0e7c227f9ba155ea5bfd0390cada43062924c1 /src/libstd/sys/windows | |
| parent | 71b46b18a274edc7f7fb60b490e5ebbb9c911462 (diff) | |
| download | rust-56290a004493a5d2e211f056601533253497df60.tar.gz rust-56290a004493a5d2e211f056601533253497df60.zip | |
std: Stabilize the prelude module
This commit is an implementation of [RFC 503][rfc] which is a stabilization story for the prelude. Most of the RFC was directly applied, removing reexports. Some reexports are kept around, however: * `range` remains until range syntax has landed to reduce churn. * `Path` and `GenericPath` remain until path reform lands. This is done to prevent many imports of `GenericPath` which will soon be removed. * All `io` traits remain until I/O reform lands so imports can be rewritten all at once to `std::io::prelude::*`. This is a breaking change because many prelude reexports have been removed, and the RFC can be consulted for the exact list of removed reexports, as well as to find the locations of where to import them. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0503-prelude-stabilization.md [breaking-change] Closes #20068
Diffstat (limited to 'src/libstd/sys/windows')
| -rw-r--r-- | src/libstd/sys/windows/c.rs | 6 | ||||
| -rw-r--r-- | src/libstd/sys/windows/fs.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/windows/mod.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sys/windows/mutex.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/windows/os.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/windows/pipe.rs | 6 | ||||
| -rw-r--r-- | src/libstd/sys/windows/process.rs | 7 | ||||
| -rw-r--r-- | src/libstd/sys/windows/tcp.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/windows/thread_local.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/windows/timer.rs | 5 | ||||
| -rw-r--r-- | src/libstd/sys/windows/tty.rs | 19 |
11 files changed, 32 insertions, 25 deletions
diff --git a/src/libstd/sys/windows/c.rs b/src/libstd/sys/windows/c.rs index 6cccefbe890..d28d0fe26b9 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,9 @@ 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..c354e7b3ece 100644 --- a/src/libstd/sys/windows/mod.rs +++ b/src/libstd/sys/windows/mod.rs @@ -18,11 +18,13 @@ extern crate libc; +use prelude::v1::*; + use num; use mem; -use prelude::*; use io::{mod, IoResult, IoError}; use sync::{Once, ONCE_INIT}; +use comm::Sender; macro_rules! helper_init { (static $name:ident: Helper<$m:ty>) => ( static $name: Helper<$m> = Helper { diff --git a/src/libstd/sys/windows/mutex.rs b/src/libstd/sys/windows/mutex.rs index 3ac7c09154e..c7b4a4cec09 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}; 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..00c1ca7fe1a 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; @@ -469,7 +470,7 @@ mod tests { #[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..485dc251050 100644 --- a/src/libstd/sys/windows/timer.rs +++ b/src/libstd/sys/windows/timer.rs @@ -21,16 +21,17 @@ //! 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 comm::{channel, Sender, Receiver}; +use io::IoResult; use sys::c; use sys::fs::FileDesc; use sys_common::helper_thread::Helper; -use prelude::*; -use io::IoResult; helper_init! { static HELPER: Helper<Req> } 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 { |
