1
Fork 0

std: Fill in all missing imports

Fallout from the previous commits
This commit is contained in:
Alex Crichton 2014-01-06 16:48:51 -08:00
parent 5350ee740e
commit 7e0443d6c4
29 changed files with 66 additions and 25 deletions

View file

@ -169,6 +169,7 @@ pub mod raw {
use at_vec::capacity;
use cast;
use cast::{transmute, transmute_copy};
use container::Container;
use option::None;
use ptr;
use mem;

View file

@ -238,7 +238,7 @@ use rt::local::Local;
use rt::task::{Task, BlockedTask};
use rt::thread::Thread;
use sync::atomics::{AtomicInt, AtomicBool, SeqCst, Relaxed};
use vec::{ImmutableVector, OwnedVector};
use vec::OwnedVector;
use spsc = sync::spsc_queue;
use mpsc = sync::mpsc_queue;

View file

@ -16,6 +16,7 @@
use iter::Iterator;
use option::Option;
use io::Reader;
use vec::OwnedVector;
/// An iterator that reads a single byte on each iteration,
/// until `.read_byte()` returns `None`.

View file

@ -10,9 +10,11 @@
use container::Container;
use from_str::FromStr;
use iter::Iterator;
use option::{Option, None, Some};
use str::StrSlice;
use to_str::ToStr;
use vec::{MutableCloneableVector, ImmutableVector};
use vec::{MutableCloneableVector, ImmutableVector, MutableVector};
pub type Port = u16;

View file

@ -26,6 +26,7 @@ out.write(bytes!("Hello, world!"));
*/
use container::Container;
use fmt;
use io::buffered::LineBufferedWriter;
use io::{Reader, Writer, io_error, IoError, OtherIoError,
@ -37,7 +38,9 @@ use result::{Ok, Err};
use rt::local::Local;
use rt::rtio::{DontClose, IoFactory, LocalIo, RtioFileStream, RtioTTY};
use rt::task::Task;
use str::StrSlice;
use util;
use vec::ImmutableVector;
// And so begins the tale of acquiring a uv handle to a stdio stream on all
// platforms in all situations. Our story begins by splitting the world into two

View file

@ -21,7 +21,7 @@ use str;
use vec::{CopyableVector, ImmutableVector, MutableVector};
use vec::OwnedVector;
use num::{NumCast, Zero, One, cast, pow_with_uint, Integer};
use num::{Round, Float, FPNaN, FPInfinite};
use num::{Round, Float, FPNaN, FPInfinite, ToPrimitive};
pub enum ExponentFormat {
ExpNone,

View file

@ -21,7 +21,8 @@ use str;
use str::Str;
use to_bytes::IterBytes;
use vec;
use vec::{CopyableVector, RSplitIterator, SplitIterator, Vector, VectorVector};
use vec::{CopyableVector, RSplitIterator, SplitIterator, Vector, VectorVector,
ImmutableEqVector, OwnedVector, ImmutableVector, OwnedCopyableVector};
use super::{BytesContainer, GenericPath, GenericPathUnsafe};
/// Iterator that yields successive components of a Path as &[u8]

View file

@ -13,14 +13,16 @@
use ascii::AsciiCast;
use c_str::{CString, ToCStr};
use cast;
use clone::Clone;
use container::Container;
use cmp::Eq;
use from_str::FromStr;
use iter::{AdditiveIterator, DoubleEndedIterator, Extendable, Invert, Iterator, Map};
use option::{Option, Some, None};
use str;
use str::{CharSplitIterator, OwnedStr, Str, StrVector};
use str::{CharSplitIterator, OwnedStr, Str, StrVector, StrSlice};
use to_bytes::IterBytes;
use vec::Vector;
use vec::{Vector, OwnedVector, ImmutableVector};
use super::{contains_nul, BytesContainer, GenericPath, GenericPathUnsafe};
/// Iterator that yields successive components of a Path as &str

View file

@ -10,6 +10,7 @@
//! The exponential distribution.
use num::Exponential;
use rand::{Rng, Rand};
use rand::distributions::{ziggurat, ziggurat_tables, Sample, IndependentSample};

View file

@ -10,10 +10,11 @@
//! The Gamma and derived distributions.
use rand::{Rng, Open01};
use super::{IndependentSample, Sample, Exp};
use super::normal::StandardNormal;
use num::Algebraic;
use num;
use rand::{Rng, Open01};
use super::normal::StandardNormal;
use super::{IndependentSample, Sample, Exp};
/// The Gamma distribution `Gamma(shape, scale)` distribution.
///

View file

@ -20,11 +20,14 @@ that do not need to record state.
*/
use iter::range;
use container::Container;
use iter::{range, Iterator};
use option::{Some, None};
use num;
use num::CheckedAdd;
use rand::{Rng, Rand};
use clone::Clone;
use vec::MutableVector;
pub use self::range::Range;
pub use self::gamma::{Gamma, ChiSquared, FisherF, StudentT};

View file

@ -10,6 +10,7 @@
//! The normal and derived distributions.
use num::Exponential;
use rand::{Rng, Rand, Open01};
use rand::distributions::{ziggurat, ziggurat_tables, Sample, IndependentSample};

View file

@ -12,8 +12,9 @@
use rand::{Rng, SeedableRng, OSRng};
use iter::{Iterator, range, range_step, Repeat};
use num::Times;
use option::{None, Some};
use vec::raw;
use vec::{raw, MutableVector, ImmutableVector};
use mem;
static RAND_SIZE_LEN: u32 = 8;

View file

@ -10,6 +10,7 @@
//! A wrapper around any Reader to treat it as an RNG.
use container::Container;
use option::{Some, None};
use io::Reader;

View file

@ -11,8 +11,9 @@
//! A wrapper around another RNG that reseeds it after it
//! generates a certain number of random bytes.
use rand::{Rng, SeedableRng};
use container::Container;
use default::Default;
use rand::{Rng, SeedableRng};
/// How many bytes of entropy the underling RNG is allowed to generate
/// before it is reseeded.

View file

@ -9,6 +9,8 @@
// except according to those terms.
use c_str::{ToCStr, CString};
use container::Container;
use iter::Iterator;
use libc::{c_char, size_t};
use option::{Option, None, Some};
use ptr::RawPtr;
@ -19,7 +21,7 @@ use str::OwnedStr;
use str;
use uint;
use unstable::raw;
use vec::ImmutableVector;
use vec::{ImmutableVector, OwnedVector};
pub static FROZEN_BIT: uint = 1 << (uint::bits - 1);
pub static MUT_BIT: uint = 1 << (uint::bits - 2);

View file

@ -10,7 +10,9 @@
use container::MutableSet;
use hashmap::HashSet;
use iter::Iterator;
use option::{Some, None, Option};
use ptr::RawPtr;
use vec::ImmutableVector;
use rt::rtio::EventLoop;

View file

@ -9,6 +9,7 @@
// except according to those terms.
use libc::{c_void, c_char, size_t, uintptr_t, free, malloc, realloc};
use ptr::RawPtr;
use unstable::intrinsics::TyDesc;
use unstable::raw;
use mem::size_of;

View file

@ -11,18 +11,21 @@
//! The local, garbage collected heap
use cast;
use iter::Iterator;
use libc::{c_void, uintptr_t};
use libc;
use mem;
use ops::Drop;
use option::{Option, None, Some};
use ptr;
use ptr::RawPtr;
use rt::env;
use rt::global_heap;
use rt::local::Local;
use rt::task::Task;
use unstable::intrinsics::TyDesc;
use unstable::raw;
use vec::ImmutableVector;
// This has no meaning with out rtdebug also turned on.
#[cfg(rtdebug)]

View file

@ -19,6 +19,7 @@
use cast;
use ops::Drop;
use ptr::RawPtr;
#[cfg(windows)] // mingw-w32 doesn't like thread_local things
#[cfg(target_os = "android")] // see #10686
@ -79,6 +80,7 @@ pub unsafe fn borrow<T>() -> Borrowed<T> {
pub mod compiled {
use cast;
use option::{Option, Some, None};
use ptr::RawPtr;
#[cfg(not(test))] use libc::c_void;
#[cfg(test)]
@ -177,6 +179,7 @@ pub mod native {
use libc::c_void;
use option::{Option, Some, None};
use ptr;
use ptr::RawPtr;
use tls = rt::thread_local_storage;
static mut RT_TLS_KEY: tls::Key = -1;

View file

@ -8,12 +8,15 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use container::Container;
use fmt;
use from_str::from_str;
use iter::Iterator;
use libc::exit;
use option::{Some, None, Option};
use rt::crate_map::{ModEntry, CrateMap, iter_crate_map, get_crate_map};
use str::StrSlice;
use vec::{ImmutableVector, MutableTotalOrdVector};
use vec::{ImmutableVector, MutableTotalOrdVector, OwnedVector};
#[cfg(test)] use cast::transmute;
struct LogDirective {

View file

@ -58,14 +58,9 @@ Several modules in `core` are clients of `rt`:
#[allow(missing_doc)];
use any::Any;
use clone::Clone;
use container::Container;
use iter::Iterator;
use option::Option;
use ptr::RawPtr;
use result::Result;
use task::TaskOpts;
use vec::{OwnedVector, MutableVector, ImmutableVector};
use self::task::{Task, BlockedTask};

View file

@ -17,6 +17,7 @@ use any::AnyOwnExt;
use borrow;
use cast;
use cleanup;
use clone::Clone;
use io::Writer;
use iter::{Iterator, Take};
use local_data;

View file

@ -62,6 +62,7 @@ use kinds::Send;
use libc::{c_void, c_char, size_t};
use option::{Some, None, Option};
use prelude::drop;
use ptr::RawPtr;
use result::{Err, Ok};
use rt::local::Local;
use rt::task::Task;

View file

@ -11,11 +11,13 @@
use container::Container;
use fmt;
use from_str::FromStr;
use iter::Iterator;
use libc;
use option::{Some, None, Option};
use os;
use str::StrSlice;
use unstable::running_on_valgrind;
use vec::ImmutableVector;
// Indicates whether we should perform expensive sanity checks, including rtassert!
// XXX: Once the runtime matures remove the `true` below to turn off rtassert, etc.

View file

@ -977,11 +977,13 @@ static TAG_CONT_U8: u8 = 128u8;
/// Unsafe operations
pub mod raw {
use cast;
use container::Container;
use libc;
use ptr;
use str::{is_utf8, OwnedStr};
use ptr::RawPtr;
use str::{is_utf8, OwnedStr, StrSlice};
use vec;
use vec::MutableVector;
use vec::{MutableVector, ImmutableVector, OwnedVector};
use unstable::raw::Slice;
/// Create a Rust string from a *u8 buffer of the given length
@ -1137,10 +1139,12 @@ Section: Trait implementations
#[cfg(not(test))]
#[allow(missing_doc)]
pub mod traits {
use ops::Add;
use container::Container;
use cmp::{TotalOrd, Ordering, Less, Equal, Greater, Eq, Ord, Equiv, TotalEq};
use super::{Str, eq_slice};
use iter::Iterator;
use ops::Add;
use option::{Some, None};
use str::{Str, StrSlice, OwnedStr, eq_slice};
impl<'a> Add<&'a str,~str> for &'a str {
#[inline]

View file

@ -167,6 +167,7 @@ mod imp {
use libc::c_void;
use libc;
use ptr;
use ptr::RawPtr;
type pthread_mutex_t = libc::c_void;
type pthread_mutexattr_t = libc::c_void;

View file

@ -24,6 +24,8 @@
//! detection is not guaranteed to continue in the future. Usage of this module
//! is discouraged unless absolutely necessary.
use str::Str;
static RED_ZONE: uint = 20 * 1024;
/// This function is invoked from rust's current __morestack function. Segmented

View file

@ -611,6 +611,7 @@ impl<'a, T> RandomAccessIterator<&'a [T]> for ChunkIter<'a, T> {
pub mod traits {
use super::*;
use container::Container;
use clone::Clone;
use cmp::{Eq, Ord, TotalEq, TotalOrd, Ordering, Equiv};
use iter::order;
@ -2520,7 +2521,7 @@ pub unsafe fn from_buf<T>(ptr: *T, elts: uint) -> ~[T] {
pub mod raw {
use cast;
use ptr;
use vec::{with_capacity, MutableVector};
use vec::{with_capacity, MutableVector, OwnedVector};
use unstable::raw::Slice;
/**
@ -2599,8 +2600,9 @@ pub mod raw {
/// Operations on `[u8]`.
pub mod bytes {
use container::Container;
use vec::MutableVector;
use vec::{MutableVector, OwnedVector, ImmutableVector};
use ptr;
use ptr::RawPtr;
/// A trait for operations on mutable `[u8]`s.
pub trait MutableByteVector {