diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-12-22 09:04:23 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-12-29 08:58:21 -0800 |
| commit | c32d03f4172580e3f33e4844ed3c01234dca2d53 (patch) | |
| tree | 70c57ebe6a3b5f6e8cb4609c918f9455671926be /src/libstd/sys/unix | |
| parent | 3dcc409fac18a258ba2a8af4345d9566ec8eebad (diff) | |
| download | rust-c32d03f4172580e3f33e4844ed3c01234dca2d53.tar.gz rust-c32d03f4172580e3f33e4844ed3c01234dca2d53.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/unix')
| -rw-r--r-- | src/libstd/sys/unix/fs.rs | 13 | ||||
| -rw-r--r-- | src/libstd/sys/unix/mod.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/unix/os.rs | 7 | ||||
| -rw-r--r-- | src/libstd/sys/unix/pipe.rs | 6 | ||||
| -rw-r--r-- | src/libstd/sys/unix/process.rs | 19 | ||||
| -rw-r--r-- | src/libstd/sys/unix/tcp.rs | 3 | ||||
| -rw-r--r-- | src/libstd/sys/unix/thread_local.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/unix/timer.rs | 6 | ||||
| -rw-r--r-- | src/libstd/sys/unix/tty.rs | 3 |
9 files changed, 32 insertions, 29 deletions
diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs index 98d860f9646..d537579d453 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 f3babca3287..15dad810756 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 cafe52f8403..a221a6bc15b 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 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 f1b078b4e80..6954866257e 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}; diff --git a/src/libstd/sys/unix/process.rs b/src/libstd/sys/unix/process.rs index 835f4279d9b..9824c9c7364 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 comm::{channel, Sender, Receiver}; +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 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}; 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 fe393b81e3d..903c4954f6f 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 comm::{mod, channel, Sender, Receiver}; +use io::IoResult; use libc; use mem; use os; use ptr; use sync::atomic; -use comm; 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/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; |
