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
This commit is contained in:
parent
3dcc409fac
commit
c32d03f417
314 changed files with 1616 additions and 1155 deletions
|
|
@ -37,7 +37,7 @@
|
|||
#![macro_escape]
|
||||
#![experimental]
|
||||
|
||||
use prelude::*;
|
||||
use prelude::v1::*;
|
||||
|
||||
use cell::UnsafeCell;
|
||||
|
||||
|
|
@ -258,7 +258,7 @@ impl<T: 'static> Key<T> {
|
|||
|
||||
#[cfg(any(target_os = "macos", target_os = "linux"))]
|
||||
mod imp {
|
||||
use prelude::*;
|
||||
use prelude::v1::*;
|
||||
|
||||
use cell::UnsafeCell;
|
||||
use intrinsics;
|
||||
|
|
@ -396,7 +396,7 @@ mod imp {
|
|||
|
||||
#[cfg(not(any(target_os = "macos", target_os = "linux")))]
|
||||
mod imp {
|
||||
use prelude::*;
|
||||
use prelude::v1::*;
|
||||
|
||||
use cell::UnsafeCell;
|
||||
use mem;
|
||||
|
|
@ -469,8 +469,9 @@ mod imp {
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::*;
|
||||
use prelude::v1::*;
|
||||
|
||||
use comm::{channel, Sender};
|
||||
use cell::UnsafeCell;
|
||||
use thread::Thread;
|
||||
|
||||
|
|
@ -492,7 +493,7 @@ mod tests {
|
|||
*f.get() = 2;
|
||||
});
|
||||
let (tx, rx) = channel();
|
||||
spawn(move|| {
|
||||
let _t = Thread::spawn(move|| {
|
||||
FOO.with(|f| unsafe {
|
||||
assert_eq!(*f.get(), 1);
|
||||
});
|
||||
|
|
@ -512,7 +513,7 @@ mod tests {
|
|||
});
|
||||
|
||||
let (tx, rx) = channel();
|
||||
spawn(move|| unsafe {
|
||||
let _t = Thread::spawn(move|| unsafe {
|
||||
let mut tx = Some(tx);
|
||||
FOO.with(|f| {
|
||||
*f.get() = Some(Foo(tx.take().unwrap()));
|
||||
|
|
@ -562,7 +563,7 @@ mod tests {
|
|||
|
||||
Thread::spawn(move|| {
|
||||
drop(S1);
|
||||
}).join();
|
||||
}).join().ok().unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
@ -580,7 +581,7 @@ mod tests {
|
|||
|
||||
Thread::spawn(move|| unsafe {
|
||||
K1.with(|s| *s.get() = Some(S1));
|
||||
}).join();
|
||||
}).join().ok().unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
@ -605,7 +606,7 @@ mod tests {
|
|||
}
|
||||
|
||||
let (tx, rx) = channel();
|
||||
spawn(move|| unsafe {
|
||||
let _t = Thread::spawn(move|| unsafe {
|
||||
let mut tx = Some(tx);
|
||||
K1.with(|s| *s.get() = Some(S1(tx.take().unwrap())));
|
||||
});
|
||||
|
|
@ -615,7 +616,7 @@ mod tests {
|
|||
|
||||
#[cfg(test)]
|
||||
mod dynamic_tests {
|
||||
use prelude::*;
|
||||
use prelude::v1::*;
|
||||
|
||||
use cell::RefCell;
|
||||
use collections::HashMap;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
|
||||
#![macro_escape]
|
||||
|
||||
use prelude::*;
|
||||
use prelude::v1::*;
|
||||
|
||||
// macro hygiene sure would be nice, wouldn't it?
|
||||
#[doc(hidden)] pub use self::imp::KeyInner;
|
||||
|
|
@ -238,7 +238,7 @@ mod imp {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use cell::Cell;
|
||||
use prelude::*;
|
||||
use prelude::v1::*;
|
||||
|
||||
#[test]
|
||||
fn smoke() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue