Use #[prelude_import]
in libstd
.
This commit is contained in:
parent
e2ad3be178
commit
9a2c8783d9
@ -12,8 +12,6 @@
|
||||
|
||||
#![stable(feature = "rust1", since = "1.0.0")]
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use mem;
|
||||
use ops::Range;
|
||||
use iter::FusedIterator;
|
||||
@ -454,7 +452,6 @@ static ASCII_UPPERCASE_MAP: [u8; 256] = [
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
use super::*;
|
||||
use char::from_u32;
|
||||
|
||||
|
@ -2059,8 +2059,6 @@ fn assert_covariance() {
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_map {
|
||||
use prelude::v1::*;
|
||||
|
||||
use super::HashMap;
|
||||
use super::Entry::{Occupied, Vacant};
|
||||
use cell::RefCell;
|
||||
|
@ -1067,8 +1067,6 @@ fn assert_covariance() {
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_set {
|
||||
use prelude::v1::*;
|
||||
|
||||
use super::HashSet;
|
||||
|
||||
#[test]
|
||||
|
@ -16,8 +16,6 @@
|
||||
|
||||
#![stable(feature = "env", since = "1.0.0")]
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use error::Error;
|
||||
use ffi::{OsStr, OsString};
|
||||
use fmt;
|
||||
@ -950,7 +948,6 @@ mod arch {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
use super::*;
|
||||
|
||||
use iter::repeat;
|
||||
|
@ -48,16 +48,15 @@
|
||||
// reconsider what crate these items belong in.
|
||||
|
||||
use any::TypeId;
|
||||
use boxed::Box;
|
||||
use cell;
|
||||
use char;
|
||||
use fmt::{self, Debug, Display};
|
||||
use marker::{Send, Sync, Reflect};
|
||||
use marker::Reflect;
|
||||
use mem::transmute;
|
||||
use num;
|
||||
use raw::TraitObject;
|
||||
use str;
|
||||
use string::{self, String};
|
||||
use string;
|
||||
|
||||
/// Base functionality for all errors in Rust.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
@ -454,7 +453,6 @@ impl Error + Send + Sync {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
use super::Error;
|
||||
use fmt;
|
||||
|
||||
|
@ -9,25 +9,18 @@
|
||||
// except according to those terms.
|
||||
|
||||
use ascii;
|
||||
use borrow::{Cow, ToOwned, Borrow};
|
||||
use boxed::Box;
|
||||
use convert::{Into, From};
|
||||
use cmp::{PartialEq, Eq, PartialOrd, Ord, Ordering};
|
||||
use borrow::{Cow, Borrow};
|
||||
use cmp::Ordering;
|
||||
use error::Error;
|
||||
use fmt::{self, Write};
|
||||
use io;
|
||||
use iter::Iterator;
|
||||
use libc;
|
||||
use mem;
|
||||
use memchr;
|
||||
use ops;
|
||||
use option::Option::{self, Some, None};
|
||||
use os::raw::c_char;
|
||||
use result::Result::{self, Ok, Err};
|
||||
use slice;
|
||||
use str::{self, Utf8Error};
|
||||
use string::String;
|
||||
use vec::Vec;
|
||||
|
||||
/// A type representing an owned C-compatible string
|
||||
///
|
||||
@ -700,7 +693,6 @@ impl AsRef<CStr> for CString {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
use super::*;
|
||||
use os::raw::c_char;
|
||||
use borrow::Cow::{Borrowed, Owned};
|
||||
|
@ -8,14 +8,12 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use borrow::{Borrow, Cow, ToOwned};
|
||||
use borrow::{Borrow, Cow};
|
||||
use fmt::{self, Debug};
|
||||
use mem;
|
||||
use string::String;
|
||||
use ops;
|
||||
use cmp;
|
||||
use hash::{Hash, Hasher};
|
||||
use vec::Vec;
|
||||
|
||||
use sys::os_str::{Buf, Slice};
|
||||
use sys_common::{AsInner, IntoInner, FromInner};
|
||||
|
@ -23,7 +23,6 @@ use io::{self, SeekFrom, Seek, Read, Write};
|
||||
use path::{Path, PathBuf};
|
||||
use sys::fs as fs_imp;
|
||||
use sys_common::{AsInnerMut, FromInner, AsInner, IntoInner};
|
||||
use vec::Vec;
|
||||
use time::SystemTime;
|
||||
|
||||
/// A reference to an open file on the filesystem.
|
||||
@ -1677,7 +1676,6 @@ impl AsInnerMut<fs_imp::DirBuilder> for DirBuilder {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
use io::prelude::*;
|
||||
|
||||
use fs::{self, File, OpenOptions};
|
||||
|
@ -10,7 +10,6 @@
|
||||
|
||||
//! Buffering wrappers for I/O traits
|
||||
|
||||
use prelude::v1::*;
|
||||
use io::prelude::*;
|
||||
|
||||
use marker::Reflect;
|
||||
@ -788,7 +787,6 @@ impl<W: Write> fmt::Debug for LineWriter<W> where W: fmt::Debug {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
use io::prelude::*;
|
||||
use io::{self, BufReader, BufWriter, LineWriter, SeekFrom};
|
||||
use sync::atomic::{AtomicUsize, Ordering};
|
||||
|
@ -8,7 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use prelude::v1::*;
|
||||
use io::prelude::*;
|
||||
|
||||
use cmp;
|
||||
@ -284,7 +283,6 @@ impl Write for Cursor<Box<[u8]>> {
|
||||
mod tests {
|
||||
use io::prelude::*;
|
||||
use io::{Cursor, SeekFrom};
|
||||
use vec::Vec;
|
||||
|
||||
#[test]
|
||||
fn test_vec_writer() {
|
||||
|
@ -8,12 +8,8 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use boxed::Box;
|
||||
use convert::Into;
|
||||
use error;
|
||||
use fmt;
|
||||
use marker::{Send, Sync};
|
||||
use option::Option::{self, Some, None};
|
||||
use result;
|
||||
use sys;
|
||||
|
||||
@ -522,7 +518,6 @@ fn _assert_error_is_sync_send() {
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use prelude::v1::*;
|
||||
use super::{Error, ErrorKind};
|
||||
use error;
|
||||
use fmt;
|
||||
|
@ -8,13 +8,10 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use boxed::Box;
|
||||
use cmp;
|
||||
use io::{self, SeekFrom, Read, Write, Seek, BufRead, Error, ErrorKind};
|
||||
use fmt;
|
||||
use mem;
|
||||
use string::String;
|
||||
use vec::Vec;
|
||||
|
||||
// =============================================================================
|
||||
// Forwarding implementations
|
||||
@ -228,7 +225,6 @@ impl Write for Vec<u8> {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use io::prelude::*;
|
||||
use vec::Vec;
|
||||
use test;
|
||||
|
||||
#[bench]
|
||||
|
@ -8,8 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use cell::Cell;
|
||||
use ptr;
|
||||
use sync::Arc;
|
||||
|
@ -253,15 +253,8 @@ use cmp;
|
||||
use rustc_unicode::str as core_str;
|
||||
use error as std_error;
|
||||
use fmt;
|
||||
use iter::{Iterator};
|
||||
use marker::Sized;
|
||||
use ops::{Drop, FnOnce};
|
||||
use option::Option::{self, Some, None};
|
||||
use result::Result::{Ok, Err};
|
||||
use result;
|
||||
use string::String;
|
||||
use str;
|
||||
use vec::Vec;
|
||||
use memchr;
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
@ -1734,7 +1727,6 @@ impl<B: BufRead> Iterator for Lines<B> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
use io::prelude::*;
|
||||
use io;
|
||||
use super::Cursor;
|
||||
|
@ -8,7 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use prelude::v1::*;
|
||||
use io::prelude::*;
|
||||
|
||||
use cell::{RefCell, BorrowState};
|
||||
|
@ -167,8 +167,6 @@ impl Write for Sink {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
|
||||
use io::prelude::*;
|
||||
use io::{copy, sink, empty, repeat};
|
||||
|
||||
|
@ -252,6 +252,7 @@
|
||||
#![feature(optin_builtin_traits)]
|
||||
#![feature(panic_unwind)]
|
||||
#![feature(placement_in_syntax)]
|
||||
#![feature(prelude_import)]
|
||||
#![feature(question_mark)]
|
||||
#![feature(rand)]
|
||||
#![feature(raw)]
|
||||
@ -292,6 +293,10 @@
|
||||
#![allow(unused_features)] // std may use features in a platform-specific way
|
||||
#![cfg_attr(not(stage0), deny(warnings))]
|
||||
|
||||
#[prelude_import]
|
||||
#[allow(unused)]
|
||||
use prelude::v1::*;
|
||||
|
||||
#[cfg(test)] extern crate test;
|
||||
|
||||
// We want to reexport a few macros from core but libcore has already been
|
||||
|
@ -8,8 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use fmt;
|
||||
use hash;
|
||||
use io;
|
||||
@ -523,7 +521,6 @@ impl<'a, T: ToSocketAddrs + ?Sized> ToSocketAddrs for &'a T {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
use net::*;
|
||||
use net::test::{tsa, sa6, sa4};
|
||||
|
||||
|
@ -653,7 +653,6 @@ impl From<[u8; 16]> for Ipv6Addr {
|
||||
// Tests for this module
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
use net::*;
|
||||
use net::Ipv6MulticastScope::*;
|
||||
use net::test::{tsa, sa6, sa4};
|
||||
|
@ -12,8 +12,6 @@
|
||||
|
||||
#![stable(feature = "rust1", since = "1.0.0")]
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use io::{self, Error, ErrorKind};
|
||||
use sys_common::net as net_imp;
|
||||
|
||||
|
@ -13,8 +13,6 @@
|
||||
//! This module is "publicly exported" through the `FromStr` implementations
|
||||
//! below.
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use error::Error;
|
||||
use fmt;
|
||||
use net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6};
|
||||
|
@ -8,7 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use prelude::v1::*;
|
||||
use io::prelude::*;
|
||||
|
||||
use fmt;
|
||||
@ -438,8 +437,6 @@ impl fmt::Debug for TcpListener {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
|
||||
use io::ErrorKind;
|
||||
use io::prelude::*;
|
||||
use net::*;
|
||||
|
@ -8,8 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use env;
|
||||
use net::{SocketAddr, SocketAddrV4, SocketAddrV6, Ipv4Addr, Ipv6Addr, ToSocketAddrs};
|
||||
use sync::atomic::{AtomicUsize, Ordering};
|
||||
|
@ -355,8 +355,6 @@ impl fmt::Debug for UdpSocket {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
|
||||
use io::ErrorKind;
|
||||
use net::*;
|
||||
use net::test::{next_test_ip4, next_test_ip6};
|
||||
|
@ -24,9 +24,7 @@ pub use core::num::{FpCategory, ParseIntError, ParseFloatError, TryFromIntError}
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub use core::num::Wrapping;
|
||||
|
||||
#[cfg(test)] use cmp::PartialEq;
|
||||
#[cfg(test)] use fmt;
|
||||
#[cfg(test)] use marker::Copy;
|
||||
#[cfg(test)] use ops::{Add, Sub, Mul, Div, Rem};
|
||||
|
||||
/// Helper function for testing numeric operations
|
||||
@ -52,7 +50,6 @@ mod tests {
|
||||
use u32;
|
||||
use u64;
|
||||
use usize;
|
||||
use string::ToString;
|
||||
use ops::Mul;
|
||||
|
||||
#[test]
|
||||
@ -287,7 +284,6 @@ mod tests {
|
||||
mod bench {
|
||||
extern crate test;
|
||||
use self::test::Bencher;
|
||||
use prelude::v1::*;
|
||||
|
||||
#[bench]
|
||||
fn bench_pow_function(b: &mut Bencher) {
|
||||
|
@ -13,7 +13,6 @@
|
||||
#![stable(feature = "std_panic", since = "1.9.0")]
|
||||
|
||||
use any::Any;
|
||||
use boxed::Box;
|
||||
use cell::UnsafeCell;
|
||||
use ops::{Deref, DerefMut};
|
||||
use panicking;
|
||||
|
@ -17,7 +17,6 @@
|
||||
//! * Executing a panic up to doing the actual implementation
|
||||
//! * Shims around "try"
|
||||
|
||||
use prelude::v1::*;
|
||||
use io::prelude::*;
|
||||
|
||||
use any::Any;
|
||||
|
@ -100,7 +100,7 @@
|
||||
#![stable(feature = "rust1", since = "1.0.0")]
|
||||
|
||||
use ascii::*;
|
||||
use borrow::{Borrow, ToOwned, Cow};
|
||||
use borrow::{Borrow, Cow};
|
||||
use cmp;
|
||||
use error::Error;
|
||||
use fmt;
|
||||
@ -110,8 +110,6 @@ use io;
|
||||
use iter::{self, FusedIterator};
|
||||
use mem;
|
||||
use ops::{self, Deref};
|
||||
use string::String;
|
||||
use vec::Vec;
|
||||
|
||||
use ffi::{OsStr, OsString};
|
||||
|
||||
@ -2152,8 +2150,6 @@ impl Error for StripPrefixError {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use string::{ToString, String};
|
||||
use vec::Vec;
|
||||
|
||||
macro_rules! t(
|
||||
($path:expr, iter: $iter:expr) => (
|
||||
|
@ -12,7 +12,6 @@
|
||||
|
||||
#![stable(feature = "process", since = "1.0.0")]
|
||||
|
||||
use prelude::v1::*;
|
||||
use io::prelude::*;
|
||||
|
||||
use ffi::OsStr;
|
||||
@ -810,7 +809,6 @@ pub fn exit(code: i32) -> ! {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
use io::prelude::*;
|
||||
|
||||
use io::ErrorKind;
|
||||
|
@ -30,7 +30,6 @@ pub use panicking::{begin_panic, begin_panic_fmt, update_panic_count};
|
||||
#[cfg(not(test))]
|
||||
#[lang = "start"]
|
||||
fn lang_start(main: *const u8, argc: isize, argv: *const *const u8) -> isize {
|
||||
use borrow::ToOwned;
|
||||
use mem;
|
||||
use panic;
|
||||
use sys;
|
||||
|
@ -113,8 +113,6 @@ impl BarrierWaitResult {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
|
||||
use sync::{Arc, Barrier};
|
||||
use sync::mpsc::{channel, TryRecvError};
|
||||
use thread;
|
||||
|
@ -8,8 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use sync::atomic::{AtomicUsize, Ordering};
|
||||
use sync::{mutex, MutexGuard, PoisonError};
|
||||
use sys_common::condvar as sys;
|
||||
@ -245,8 +243,6 @@ impl Drop for Condvar {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
|
||||
use sync::mpsc::channel;
|
||||
use sync::{Condvar, Mutex, Arc};
|
||||
use thread;
|
||||
|
@ -13,9 +13,7 @@
|
||||
use thread::{self, Thread};
|
||||
use sync::atomic::{AtomicBool, Ordering};
|
||||
use sync::Arc;
|
||||
use marker::{Sync, Send};
|
||||
use mem;
|
||||
use clone::Clone;
|
||||
use time::Instant;
|
||||
|
||||
struct Inner {
|
||||
|
@ -1270,8 +1270,6 @@ impl error::Error for TryRecvError {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
|
||||
use env;
|
||||
use super::*;
|
||||
use thread;
|
||||
@ -1946,8 +1944,6 @@ mod tests {
|
||||
|
||||
#[cfg(test)]
|
||||
mod sync_tests {
|
||||
use prelude::v1::*;
|
||||
|
||||
use env;
|
||||
use thread;
|
||||
use super::*;
|
||||
|
@ -148,8 +148,6 @@ impl<T> Drop for Queue<T> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
|
||||
use sync::mpsc::channel;
|
||||
use super::{Queue, Data, Empty, Inconsistent};
|
||||
use sync::Arc;
|
||||
|
@ -369,8 +369,6 @@ impl<'rx, T:Send+'rx> fmt::Debug for Handle<'rx, T> {
|
||||
#[cfg(test)]
|
||||
#[allow(unused_imports)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
|
||||
use thread;
|
||||
use sync::mpsc::*;
|
||||
|
||||
|
@ -233,8 +233,6 @@ impl<T> Drop for Queue<T> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
|
||||
use sync::Arc;
|
||||
use super::Queue;
|
||||
use thread;
|
||||
|
@ -36,7 +36,6 @@
|
||||
pub use self::Failure::*;
|
||||
use self::Blocker::*;
|
||||
|
||||
use vec::Vec;
|
||||
use core::mem;
|
||||
use core::ptr;
|
||||
|
||||
|
@ -8,8 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use cell::UnsafeCell;
|
||||
use fmt;
|
||||
use marker;
|
||||
@ -355,8 +353,6 @@ pub fn guard_poison<'a, T: ?Sized>(guard: &MutexGuard<'a, T>) -> &'a poison::Fla
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
|
||||
use sync::mpsc::channel;
|
||||
use sync::{Arc, Mutex, Condvar};
|
||||
use sync::atomic::{AtomicUsize, Ordering};
|
||||
|
@ -369,8 +369,6 @@ impl OnceState {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
|
||||
use panic;
|
||||
use sync::mpsc::channel;
|
||||
use thread;
|
||||
|
@ -8,8 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use cell::UnsafeCell;
|
||||
use fmt;
|
||||
use marker;
|
||||
@ -385,8 +383,6 @@ impl<'a, T: ?Sized> Drop for RwLockWriteGuard<'a, T> {
|
||||
mod tests {
|
||||
#![allow(deprecated)] // rand
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use rand::{self, Rng};
|
||||
use sync::mpsc::channel;
|
||||
use thread;
|
||||
@ -552,8 +548,6 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_rwlock_try_write() {
|
||||
use mem::drop;
|
||||
|
||||
let lock = RwLock::new(0isize);
|
||||
let read_guard = lock.read().unwrap();
|
||||
|
||||
|
@ -21,8 +21,6 @@
|
||||
|
||||
#![allow(dead_code)] // different code on OSX/linux/etc
|
||||
|
||||
use vec::Vec;
|
||||
|
||||
/// One-time global initialization.
|
||||
pub unsafe fn init(argc: isize, argv: *const *const u8) { imp::init(argc, argv) }
|
||||
|
||||
@ -42,8 +40,6 @@ pub fn clone() -> Option<Vec<Vec<u8>>> { imp::clone() }
|
||||
target_os = "solaris",
|
||||
target_os = "emscripten"))]
|
||||
mod imp {
|
||||
use prelude::v1::*;
|
||||
|
||||
use libc::c_char;
|
||||
use mem;
|
||||
use ffi::CStr;
|
||||
@ -91,8 +87,6 @@ mod imp {
|
||||
target_os = "ios",
|
||||
target_os = "windows"))]
|
||||
mod imp {
|
||||
use vec::Vec;
|
||||
|
||||
pub unsafe fn init(_argc: isize, _argv: *const *const u8) {
|
||||
}
|
||||
|
||||
|
@ -13,10 +13,8 @@
|
||||
//! Documentation can be found on the `rt::at_exit` function.
|
||||
|
||||
use alloc::boxed::FnBox;
|
||||
use boxed::Box;
|
||||
use ptr;
|
||||
use sys_common::mutex::Mutex;
|
||||
use vec::Vec;
|
||||
|
||||
type Queue = Vec<Box<FnBox()>>;
|
||||
|
||||
|
@ -191,7 +191,6 @@ pub fn demangle(writer: &mut Write, s: &str) -> io::Result<()> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
use sys_common;
|
||||
macro_rules! t { ($a:expr, $b:expr) => ({
|
||||
let mut m = Vec::new();
|
||||
|
@ -7,7 +7,6 @@
|
||||
// <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 io;
|
||||
use io::ErrorKind;
|
||||
use io::Read;
|
||||
@ -53,7 +52,6 @@ pub unsafe fn read_to_end_uninitialized(r: &mut Read, buf: &mut Vec<u8>) -> io::
|
||||
|
||||
#[cfg(test)]
|
||||
pub mod test {
|
||||
use prelude::v1::*;
|
||||
use path::{Path, PathBuf};
|
||||
use env;
|
||||
use rand::{self, Rng};
|
||||
@ -93,7 +91,6 @@ pub mod test {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
use io::prelude::*;
|
||||
use super::*;
|
||||
use io;
|
||||
|
@ -10,7 +10,6 @@
|
||||
|
||||
#![allow(missing_docs)]
|
||||
|
||||
use boxed::Box;
|
||||
use sync::Once;
|
||||
use sys;
|
||||
|
||||
|
@ -8,7 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use marker::Sync;
|
||||
use sys::mutex as imp;
|
||||
|
||||
/// An OS-based mutual exclusion lock.
|
||||
|
@ -8,8 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use cmp;
|
||||
use ffi::CString;
|
||||
use fmt;
|
||||
@ -608,8 +606,6 @@ impl fmt::Debug for UdpSocket {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
|
||||
use super::*;
|
||||
use collections::HashMap;
|
||||
|
||||
|
@ -8,8 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use fmt;
|
||||
use marker;
|
||||
use ops::Deref;
|
||||
@ -160,7 +158,6 @@ impl<'a, T> Drop for ReentrantMutexGuard<'a, T> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
use sys_common::remutex::{ReentrantMutex, ReentrantMutexGuard};
|
||||
use cell::RefCell;
|
||||
use sync::Arc;
|
||||
|
@ -8,8 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use alloc::boxed::FnBox;
|
||||
use libc;
|
||||
use sys::stack_overflow;
|
||||
|
@ -11,7 +11,6 @@
|
||||
#![allow(dead_code)] // stack_guard isn't used right now on all platforms
|
||||
|
||||
use cell::RefCell;
|
||||
use string::String;
|
||||
use thread::Thread;
|
||||
use thread::LocalKeyState;
|
||||
|
||||
|
@ -233,7 +233,6 @@ impl Drop for Key {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
use super::{Key, StaticKey};
|
||||
|
||||
fn assert_sync<T: Sync>() {}
|
||||
|
@ -37,9 +37,7 @@ use mem;
|
||||
use ops;
|
||||
use slice;
|
||||
use str;
|
||||
use string::String;
|
||||
use sys_common::AsInner;
|
||||
use vec::Vec;
|
||||
|
||||
const UTF8_REPLACEMENT_CHARACTER: &'static [u8] = b"\xEF\xBF\xBD";
|
||||
|
||||
@ -807,7 +805,6 @@ impl AsciiExt for Wtf8 {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
use borrow::Cow;
|
||||
use super::*;
|
||||
|
||||
|
@ -14,7 +14,6 @@
|
||||
|
||||
use ffi::{OsStr, OsString};
|
||||
use mem;
|
||||
use prelude::v1::*;
|
||||
use sys::os_str::Buf;
|
||||
use sys_common::{FromInner, IntoInner, AsInner};
|
||||
|
||||
|
@ -14,7 +14,6 @@
|
||||
|
||||
use libc;
|
||||
|
||||
use prelude::v1::*;
|
||||
use ascii;
|
||||
use ffi::OsStr;
|
||||
use fmt;
|
||||
@ -789,7 +788,6 @@ impl IntoRawFd for UnixDatagram {
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use prelude::v1::*;
|
||||
use thread;
|
||||
use io;
|
||||
use io::prelude::*;
|
||||
|
@ -12,8 +12,6 @@
|
||||
|
||||
#![stable(feature = "rust1", since = "1.0.0")]
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use io;
|
||||
use os::unix::io::{FromRawFd, RawFd, AsRawFd, IntoRawFd};
|
||||
use process;
|
||||
|
@ -10,8 +10,6 @@
|
||||
|
||||
#![unstable(reason = "not public", issue = "0", feature = "fd")]
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use io::{self, Read};
|
||||
use libc::{self, c_int, size_t, c_void};
|
||||
use mem;
|
||||
|
@ -8,7 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use prelude::v1::*;
|
||||
use os::unix::prelude::*;
|
||||
|
||||
use ffi::{CString, CStr, OsString, OsStr};
|
||||
@ -534,7 +533,6 @@ impl fmt::Debug for File {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
#[cfg(target_os = "linux")]
|
||||
fn get_path(fd: c_int) -> Option<PathBuf> {
|
||||
use string::ToString;
|
||||
let mut p = PathBuf::from("/proc/self/fd");
|
||||
p.push(&fd.to_string());
|
||||
readlink(&p).ok()
|
||||
|
@ -8,8 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use ffi::CStr;
|
||||
use io;
|
||||
use libc::{self, c_int, size_t, sockaddr, socklen_t};
|
||||
|
@ -12,7 +12,6 @@
|
||||
|
||||
#![allow(unused_imports)] // lots of cfg code here
|
||||
|
||||
use prelude::v1::*;
|
||||
use os::unix::prelude::*;
|
||||
|
||||
use error::Error as StdError;
|
||||
|
@ -13,9 +13,7 @@
|
||||
|
||||
use borrow::Cow;
|
||||
use fmt::{self, Debug};
|
||||
use vec::Vec;
|
||||
use str;
|
||||
use string::String;
|
||||
use mem;
|
||||
use sys_common::{AsInner, IntoInner};
|
||||
|
||||
|
@ -8,8 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use cmp;
|
||||
use io;
|
||||
use libc::{self, c_int};
|
||||
|
@ -8,7 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use prelude::v1::*;
|
||||
use os::unix::prelude::*;
|
||||
|
||||
use collections::hash_map::{HashMap, Entry};
|
||||
@ -593,7 +592,6 @@ impl Process {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use prelude::v1::*;
|
||||
|
||||
use ffi::OsStr;
|
||||
use mem;
|
||||
|
@ -8,8 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use io;
|
||||
use libc;
|
||||
use sys::fd::FileDesc;
|
||||
|
@ -8,8 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use alloc::boxed::FnBox;
|
||||
use cmp;
|
||||
use ffi::CStr;
|
||||
@ -193,8 +191,6 @@ pub mod guard {
|
||||
target_os = "solaris"))]
|
||||
#[cfg_attr(test, allow(dead_code))]
|
||||
pub mod guard {
|
||||
use prelude::v1::*;
|
||||
|
||||
use libc;
|
||||
use libc::mmap;
|
||||
use libc::{PROT_NONE, MAP_PRIVATE, MAP_ANON, MAP_FAILED, MAP_FIXED};
|
||||
|
@ -21,8 +21,6 @@
|
||||
//! manner we pay a semi-large one-time cost up front for detecting whether a
|
||||
//! function is available but afterwards it's just a load and a jump.
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use ffi::CString;
|
||||
use sync::atomic::{AtomicUsize, Ordering};
|
||||
use sys::c;
|
||||
|
@ -8,7 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use prelude::v1::*;
|
||||
use os::windows::prelude::*;
|
||||
|
||||
use ffi::{CString, OsStr};
|
||||
|
@ -8,7 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use prelude::v1::*;
|
||||
use os::windows::prelude::*;
|
||||
|
||||
use ffi::OsString;
|
||||
|
@ -10,8 +10,6 @@
|
||||
|
||||
#![unstable(issue = "0", feature = "windows_handle")]
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use cmp;
|
||||
use io::{ErrorKind, Read};
|
||||
use io;
|
||||
|
@ -10,8 +10,6 @@
|
||||
|
||||
#![allow(missing_docs, bad_style)]
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use ffi::{OsStr, OsString};
|
||||
use io::{self, ErrorKind};
|
||||
use os::windows::ffi::{OsStrExt, OsStringExt};
|
||||
|
@ -29,8 +29,6 @@
|
||||
//! CriticalSection is used and we keep track of who's holding the mutex to
|
||||
//! detect recursive locks.
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use cell::UnsafeCell;
|
||||
use mem;
|
||||
use sync::atomic::{AtomicUsize, Ordering};
|
||||
|
@ -10,8 +10,6 @@
|
||||
|
||||
#![unstable(issue = "0", feature = "windows_net")]
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use cmp;
|
||||
use io::{self, Read};
|
||||
use libc::{c_int, c_void, c_ulong};
|
||||
|
@ -12,7 +12,6 @@
|
||||
|
||||
#![allow(bad_style)]
|
||||
|
||||
use prelude::v1::*;
|
||||
use os::windows::prelude::*;
|
||||
|
||||
use error::Error as StdError;
|
||||
|
@ -14,9 +14,6 @@
|
||||
use borrow::Cow;
|
||||
use fmt::{self, Debug};
|
||||
use sys_common::wtf8::{Wtf8, Wtf8Buf};
|
||||
use string::String;
|
||||
use result::Result;
|
||||
use option::Option;
|
||||
use mem;
|
||||
use sys_common::{AsInner, IntoInner};
|
||||
|
||||
|
@ -8,7 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use prelude::v1::*;
|
||||
use os::windows::prelude::*;
|
||||
|
||||
use ffi::OsStr;
|
||||
|
@ -8,8 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use ascii::*;
|
||||
use collections::HashMap;
|
||||
use collections;
|
||||
@ -491,7 +489,6 @@ fn make_dirp(d: Option<&OsString>) -> io::Result<(*const u16, Vec<u16>)> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
use ffi::{OsStr, OsString};
|
||||
use super::make_command_line;
|
||||
|
||||
|
@ -10,7 +10,6 @@
|
||||
|
||||
#![unstable(issue = "0", feature = "windows_stdio")]
|
||||
|
||||
use prelude::v1::*;
|
||||
use io::prelude::*;
|
||||
|
||||
use cmp;
|
||||
|
@ -8,8 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use alloc::boxed::FnBox;
|
||||
use io;
|
||||
use ffi::CStr;
|
||||
|
@ -8,8 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use ptr;
|
||||
use sys::c;
|
||||
use sys_common::mutex::Mutex;
|
||||
|
@ -369,7 +369,6 @@ pub mod elf {
|
||||
// Due to rust-lang/rust#18804, make sure this is not generic!
|
||||
#[cfg(target_os = "linux")]
|
||||
unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern fn(*mut u8)) {
|
||||
use prelude::v1::*;
|
||||
use mem;
|
||||
use libc;
|
||||
use sys_common::thread_local as os;
|
||||
@ -460,8 +459,6 @@ pub mod elf {
|
||||
|
||||
#[doc(hidden)]
|
||||
pub mod os {
|
||||
use prelude::v1::*;
|
||||
|
||||
use cell::{Cell, UnsafeCell};
|
||||
use marker;
|
||||
use ptr;
|
||||
@ -529,8 +526,6 @@ pub mod os {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
|
||||
use sync::mpsc::{channel, Sender};
|
||||
use cell::{Cell, UnsafeCell};
|
||||
use super::LocalKeyState;
|
||||
@ -693,8 +688,6 @@ mod tests {
|
||||
|
||||
#[cfg(test)]
|
||||
mod dynamic_tests {
|
||||
use prelude::v1::*;
|
||||
|
||||
use cell::RefCell;
|
||||
use collections::HashMap;
|
||||
|
||||
|
@ -161,8 +161,6 @@
|
||||
|
||||
#![stable(feature = "rust1", since = "1.0.0")]
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use any::Any;
|
||||
use cell::UnsafeCell;
|
||||
use ffi::{CStr, CString};
|
||||
@ -732,8 +730,6 @@ fn _assert_sync_and_send() {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
|
||||
use any::Any;
|
||||
use sync::mpsc::{channel, Sender};
|
||||
use result;
|
||||
@ -786,8 +782,6 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_spawn_sched() {
|
||||
use clone::Clone;
|
||||
|
||||
let (tx, rx) = channel();
|
||||
|
||||
fn f(i: i32, tx: Sender<()>) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user