syntax: Implement #![no_core]

This commit is an implementation of [RFC 1184][rfc] which tweaks the behavior of
the `#![no_std]` attribute and adds a new `#![no_core]` attribute. The
`#![no_std]` attribute now injects `extern crate core` at the top of the crate
as well as the libcore prelude into all modules (in the same manner as the
standard library's prelude). The `#![no_core]` attribute disables both std and
core injection.

[rfc]: https://github.com/rust-lang/rfcs/pull/1184
This commit is contained in:
Alex Crichton 2015-07-29 17:01:14 -07:00
parent ceded6adb3
commit 5cccf3cd25
157 changed files with 478 additions and 385 deletions

View File

@ -71,7 +71,8 @@
use boxed::Box;
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use core::atomic;
use core::atomic::Ordering::{Relaxed, Release, Acquire, SeqCst};

View File

@ -53,7 +53,8 @@
#![stable(feature = "rust1", since = "1.0.0")]
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use heap;
use raw_vec::RawVec;

View File

@ -75,7 +75,6 @@
#![feature(coerce_unsized)]
#![feature(core)]
#![feature(core_intrinsics)]
#![feature(core_prelude)]
#![feature(core_slice_ext)]
#![feature(custom_attribute)]
#![feature(fundamental)]
@ -93,17 +92,17 @@
#![feature(unsize)]
#![feature(core_slice_ext)]
#![feature(core_str_ext)]
#![cfg_attr(stage0, feature(core, core_prelude))]
#![cfg_attr(test, feature(test, alloc, rustc_private, box_raw))]
#![cfg_attr(all(not(feature = "external_funcs"), not(feature = "external_crate")),
feature(libc))]
#[macro_use]
extern crate core;
#[cfg(all(not(feature = "external_funcs"), not(feature = "external_crate")))]
extern crate libc;
#[cfg(stage0)] #[macro_use] extern crate core;
// Allow testing this library
#[cfg(test)] #[macro_use] extern crate std;

View File

@ -150,7 +150,8 @@
#![stable(feature = "rust1", since = "1.0.0")]
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
#[cfg(not(test))]
use boxed::Box;

View File

@ -151,7 +151,8 @@
#![allow(missing_docs)]
#![stable(feature = "rust1", since = "1.0.0")]
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use core::iter::{FromIterator};
use core::mem::swap;

View File

@ -86,7 +86,8 @@
//! println!("There are {} primes below {}", num_primes, max_prime);
//! ```
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use core::cmp::Ordering;
use core::cmp;

View File

@ -17,7 +17,8 @@
use self::Entry::*;
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use core::cmp::Ordering;
use core::fmt::Debug;
@ -530,7 +531,8 @@ enum Continuation<A, B> {
/// to nodes. By using this module much better safety guarantees can be made, and more search
/// boilerplate gets cut out.
mod stack {
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use core::marker;
use core::mem;
use core::ops::{Deref, DerefMut};

View File

@ -16,7 +16,8 @@ pub use self::SearchResult::*;
pub use self::ForceResult::*;
pub use self::TraversalItem::*;
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use core::cmp::Ordering::{Greater, Less, Equal};
use core::intrinsics::arith_offset;

View File

@ -11,7 +11,8 @@
// This is pretty much entirely stolen from TreeSet, since BTreeMap has an identical interface
// to TreeMap
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use core::cmp::Ordering::{self, Less, Greater, Equal};
use core::fmt::Debug;

View File

@ -17,7 +17,9 @@
reason = "matches collection reform specification, \
waiting for dust to settle")]
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use core::marker;
use core::fmt;
use core::iter::{FromIterator};

View File

@ -33,9 +33,7 @@
#![feature(alloc)]
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(core)]
#![feature(core_intrinsics)]
#![feature(core_prelude)]
#![feature(core_slice_ext)]
#![feature(core_str_ext)]
#![feature(heap_api)]
@ -62,12 +60,12 @@
#![feature(utf8_error)]
#![cfg_attr(test, feature(rand, test))]
#![cfg_attr(not(test), feature(str_words))]
#![cfg_attr(stage0, feature(core, core_prelude))]
#![feature(no_std)]
#![no_std]
#[macro_use]
extern crate core;
#[cfg(stage0)] #[macro_use] extern crate core;
extern crate rustc_unicode;
extern crate alloc;

View File

@ -21,7 +21,8 @@
#![stable(feature = "rust1", since = "1.0.0")]
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use alloc::boxed::Box;
use core::cmp::Ordering;

View File

@ -12,7 +12,8 @@
#![stable(feature = "rust1", since = "1.0.0")]
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use core::fmt;
use core::hash;

View File

@ -58,7 +58,9 @@
#![stable(feature = "rust1", since = "1.0.0")]
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use alloc::raw_vec::RawVec;
use alloc::boxed::Box;
use alloc::heap::EMPTY;

View File

@ -18,7 +18,8 @@
#![stable(feature = "rust1", since = "1.0.0")]
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use core::cmp::Ordering;
use core::fmt;

View File

@ -20,7 +20,8 @@
use self::Entry::*;
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use core::cmp::{max, Ordering};
use core::fmt;

View File

@ -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 fmt::{self, Write, FlagV1};
struct PadAdapter<'a, 'b: 'a> {

View File

@ -12,7 +12,7 @@
#![stable(feature = "rust1", since = "1.0.0")]
use prelude::*;
use prelude::v1::*;
use cell::{Cell, RefCell, Ref, RefMut, BorrowState};
use marker::PhantomData;

View File

@ -12,7 +12,7 @@
// FIXME: #6220 Implement floating point formatting
use prelude::*;
use prelude::v1::*;
use fmt;
use num::Zero;

View File

@ -62,7 +62,7 @@
#![stable(feature = "rust1", since = "1.0.0")]
use prelude::*;
use prelude::v1::*;
use mem;
@ -183,7 +183,7 @@ pub fn hash<T: Hash, H: Hasher + Default>(value: &T) -> u64 {
//////////////////////////////////////////////////////////////////////////////
mod impls {
use prelude::*;
use prelude::v1::*;
use slice;
use super::*;

View File

@ -10,8 +10,9 @@
//! An implementation of SipHash 2-4.
use prelude::v1::*;
use ptr;
use prelude::*;
use super::Hasher;
/// An implementation of SipHash 2-4.

View File

@ -60,8 +60,10 @@
html_playground_url = "http://play.rust-lang.org/")]
#![doc(test(no_crate_inject))]
#![feature(no_std)]
#![no_std]
#![cfg_attr(stage0, feature(no_std))]
#![cfg_attr(stage0, no_std)]
#![cfg_attr(not(stage0), feature(no_core))]
#![cfg_attr(not(stage0), no_core)]
#![allow(raw_pointer_derive)]
#![deny(missing_docs)]
@ -168,6 +170,7 @@ mod tuple;
// compiling the core library when it's compiling this library, so it expands
// all references to `::core::$foo`
#[doc(hidden)]
#[cfg(stage0)]
mod core {
pub use intrinsics; // derive(PartialOrd)
pub use fmt; // format_args!

View File

@ -15,7 +15,7 @@
#![stable(feature = "rust1", since = "1.0.0")]
use prelude::*;
use prelude::v1::*;
use intrinsics;
use mem;

View File

@ -15,7 +15,7 @@
#![stable(feature = "rust1", since = "1.0.0")]
use prelude::*;
use prelude::v1::*;
use intrinsics;
use mem;

View File

@ -21,7 +21,8 @@
#![macro_use]
use prelude::*;
use prelude::v1::*;
use mem;
use intrinsics;
@ -351,7 +352,7 @@ define_bignum!(Big32x36: type=Digit32, n=36);
// this one is used for testing only.
#[doc(hidden)]
pub mod tests {
use prelude::*;
use prelude::v1::*;
define_bignum!(Big8x3: type=u8, n=3);
}

View File

@ -10,7 +10,7 @@
//! Decodes a floating-point value into individual parts and error ranges.
use prelude::*;
use prelude::v1::*;
use {f32, f64};
use num::{Float, FpCategory};

View File

@ -129,7 +129,7 @@ functions.
#![unstable(feature = "flt2dec",
reason = "internal routines only exposed for testing")]
use prelude::*;
use prelude::v1::*;
use i16;
use num::Float;
use slice::bytes;

View File

@ -15,7 +15,8 @@ Almost direct (but slightly optimized) Rust translation of Figure 3 of [1].
quickly and accurately. SIGPLAN Not. 31, 5 (May. 1996), 108-116.
*/
use prelude::*;
use prelude::v1::*;
use num::Float;
use cmp::Ordering;

View File

@ -16,7 +16,8 @@ Rust adaptation of Grisu3 algorithm described in [1]. It uses about
accurately with integers. SIGPLAN Not. 45, 6 (June 2010), 233-243.
*/
use prelude::*;
use prelude::v1::*;
use num::Float;
use num::flt2dec::{Decoded, MAX_SIG_DIGITS, round_up};

View File

@ -0,0 +1,13 @@
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <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.
//! The libcore prelude
pub mod v1;

View File

@ -11,18 +11,8 @@
//! The core prelude
//!
//! This module is intended for users of libcore which do not link to libstd as
//! well. This module is not imported by default, but using the entire contents
//! of this module will provide all of the useful traits and types in libcore
//! that one would expect from the standard library as well.
//!
//! There is no method to automatically inject this prelude, and this prelude is
//! a subset of the standard library's prelude.
//!
//! # Example
//!
//! ```ignore
//! use core::prelude::*;
//! ```
//! well. This module is imported by default when `#![no_std]` is used in the
//! same manner as the standard library's prelude.
#![unstable(feature = "core_prelude",
reason = "the libcore prelude has not been scrutinized and \

View File

@ -16,7 +16,8 @@
#![unstable(feature = "pattern",
reason = "API not fully fleshed out and ready to be stabilized")]
use prelude::*;
use prelude::v1::*;
use cmp;
use usize;

View File

@ -14,7 +14,8 @@
#![crate_type = "rlib"]
#![cfg_attr(not(feature = "cargo-build"), unstable(feature = "libc",
reason = "use `libc` from crates.io"))]
#![cfg_attr(not(feature = "cargo-build"), feature(staged_api, core, no_std))]
#![cfg_attr(not(feature = "cargo-build"), feature(staged_api, no_std))]
#![cfg_attr(all(not(feature = "cargo-build"), stage0), feature(core))]
#![cfg_attr(not(feature = "cargo-build"), staged_api)]
#![cfg_attr(not(feature = "cargo-build"), no_std)]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
@ -78,7 +79,7 @@
#![allow(bad_style, raw_pointer_derive)]
#![cfg_attr(target_os = "nacl", allow(unused_imports))]
#[cfg(feature = "cargo-build")] extern crate std as core;
#[cfg(not(feature = "cargo-build"))] extern crate core;
#[cfg(all(stage0, not(feature = "cargo-build")))] extern crate core;
#[cfg(test)] extern crate std;
#[cfg(test)] extern crate test;

View File

@ -10,7 +10,9 @@
//! The ChaCha random number generator.
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use {Rng, SeedableRng, Rand};
const KEY_WORDS : usize = 8; // 8 words for the 256-bit key

View File

@ -17,7 +17,9 @@
//! internally. The `IndependentSample` trait is for generating values
//! that do not need to record state.
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use core::num::Float;
use core::marker::PhantomData;

View File

@ -12,7 +12,8 @@
// this is surprisingly complicated to be both generic & correct
use core::prelude::PartialOrd;
#[cfg(stage0)]
use core::prelude::v1::PartialOrd;
use Rng;
use distributions::{Sample, IndependentSample};

View File

@ -12,7 +12,9 @@
#![allow(non_camel_case_types)]
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use core::slice;
use core::iter::repeat;
use core::num::Wrapping as w;

View File

@ -28,26 +28,26 @@
#![staged_api]
#![unstable(feature = "rand",
reason = "use `rand` from crates.io")]
#![feature(core)]
#![feature(core_float)]
#![feature(core_prelude)]
#![feature(core_slice_ext)]
#![feature(no_std)]
#![feature(num_bits_bytes)]
#![feature(staged_api)]
#![feature(step_by)]
#![cfg_attr(stage0, feature(core, core_prelude))]
#![cfg_attr(test, feature(test, rand, rustc_private, iter_order))]
#![allow(deprecated)]
#[macro_use]
extern crate core;
#[cfg(stage0)] #[macro_use] extern crate core;
#[cfg(test)] #[macro_use] extern crate std;
#[cfg(test)] #[macro_use] extern crate log;
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use core::marker::PhantomData;
pub use isaac::{IsaacRng, Isaac64Rng};

View File

@ -10,7 +10,9 @@
//! The implementations of `Rand` for the built-in types.
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use core::char;
use core::isize;
use core::usize;

View File

@ -11,7 +11,8 @@
//! A wrapper around another RNG that reseeds it after it
//! generates a certain number of random bytes.
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use {Rng, SeedableRng};

View File

@ -290,13 +290,6 @@ macro_rules! bitflags {
};
}
// This is a no_std crate. So the test code's invocation of #[derive] etc, via
// bitflags!, will use names from the underlying crates.
#[cfg(test)]
mod core {
pub use std::{fmt, hash, clone, cmp, marker, option};
}
#[cfg(test)]
#[allow(non_upper_case_globals)]
mod tests {

View File

@ -46,7 +46,7 @@ struct RH<'a> {
sub: &'a [RH<'a>]
}
const EMPTY_SOURCE_STR: &'static str = "#![feature(no_std)] #![no_std]";
const EMPTY_SOURCE_STR: &'static str = "#![feature(no_core)] #![no_core]";
struct ExpectErrorEmitter {
messages: Vec<String>

View File

@ -33,17 +33,16 @@
test(no_crate_inject))]
#![no_std]
#![feature(core)]
#![feature(core_char_ext)]
#![feature(core_prelude)]
#![feature(core_slice_ext)]
#![feature(core_str_ext)]
#![feature(iter_arith)]
#![feature(lang_items)]
#![feature(no_std)]
#![feature(staged_api)]
#![cfg_attr(stage0, feature(core, core_prelude))]
extern crate core;
#[cfg(stage0)] extern crate core;
mod normalize;
mod tables;

View File

@ -14,7 +14,8 @@
//! unicode parts of the CharExt trait.
use self::GraphemeState::*;
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use core::char;
use core::cmp;

View File

@ -32,7 +32,8 @@
#![unstable(feature = "os_str",
reason = "recently added as part of path/io reform")]
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use borrow::{Borrow, Cow, ToOwned};
use ffi::CString;

View File

@ -17,7 +17,8 @@
#![stable(feature = "rust1", since = "1.0.0")]
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use fmt;
use ffi::OsString;

View File

@ -292,7 +292,8 @@ impl Write for Cursor<Vec<u8>> {
#[cfg(test)]
mod tests {
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use io::prelude::*;
use io::{Cursor, SeekFrom};

View File

@ -8,7 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use boxed::Box;
use cmp;

View File

@ -10,6 +10,7 @@
#![allow(missing_copy_implementations)]
#[cfg(stage0)]
use prelude::v1::*;
use io::{self, Read, Write, ErrorKind, BufRead};

View File

@ -213,7 +213,6 @@
#![feature(core)]
#![feature(core_float)]
#![feature(core_intrinsics)]
#![feature(core_prelude)]
#![feature(core_simd)]
#![feature(drain)]
#![feature(fnbox)]
@ -250,6 +249,7 @@
#![cfg_attr(test, feature(float_from_str_radix, range_inclusive, float_extras, hash_default))]
#![cfg_attr(test, feature(test, rustc_private, float_consts))]
#![cfg_attr(target_env = "msvc", feature(link_args))]
#![cfg_attr(stage0, feature(core, core_prelude))]
// Don't link to std. We are std.
#![no_std]
@ -257,13 +257,17 @@
#![allow(trivial_casts)]
#![deny(missing_docs)]
#[cfg(stage0)] #[macro_use] extern crate core;
#[cfg(test)] extern crate test;
#[cfg(test)] #[macro_use] extern crate log;
#[macro_use]
// We want to reexport a few macros from core but libcore has already been
// imported by the compiler (via our #[no_std] attribute) In this case we just
// add a new crate name so we can attach the reexports to it.
#[macro_reexport(assert, assert_eq, debug_assert, debug_assert_eq,
unreachable, unimplemented, write, writeln)]
extern crate core;
extern crate core as __core;
#[macro_use]
#[macro_reexport(vec, format)]

View File

@ -11,6 +11,7 @@
#![unstable(feature = "udp", reason = "remaining functions have not been \
scrutinized enough to be stabilized")]
#[cfg(stage0)]
use prelude::v1::*;
use fmt;

View File

@ -15,6 +15,7 @@
#![stable(feature = "rust1", since = "1.0.0")]
#![allow(missing_docs)]
#[cfg(stage0)]
use prelude::v1::*;
use core::num;

View File

@ -15,6 +15,7 @@
#![stable(feature = "rust1", since = "1.0.0")]
#![allow(missing_docs)]
#[cfg(stage0)]
use prelude::v1::*;
use core::num;

View File

@ -43,7 +43,8 @@ pub fn test_num<T>(ten: T, two: T) where
#[cfg(test)]
mod tests {
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use super::*;
use i8;
use i16;

View File

@ -98,7 +98,8 @@
#![stable(feature = "rust1", since = "1.0.0")]
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use ascii::*;
use borrow::{Borrow, IntoCow, ToOwned, Cow};
@ -134,7 +135,8 @@ use self::platform::{is_sep_byte, is_verbatim_sep, MAIN_SEP_STR, parse_prefix};
#[cfg(unix)]
mod platform {
use super::Prefix;
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use ffi::OsStr;
#[inline]
@ -157,7 +159,8 @@ mod platform {
#[cfg(windows)]
mod platform {
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use ascii::*;
use super::{os_str_as_u8_slice, u8_slice_as_os_str, Prefix};
@ -1747,7 +1750,8 @@ impl AsRef<Path> for PathBuf {
#[cfg(test)]
mod tests {
use super::*;
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use string::{ToString, String};
use vec::Vec;

View File

@ -57,6 +57,7 @@
#![unstable(feature = "rand")]
#[cfg(stage0)]
use prelude::v1::*;
use cell::RefCell;

View File

@ -15,7 +15,7 @@ pub use self::imp::OsRng;
#[cfg(all(unix, not(target_os = "ios")))]
mod imp {
use prelude::v1::*;
#[cfg(stage0)] use prelude::v1::*;
use self::OsRngInner::*;
use fs::File;
@ -251,6 +251,7 @@ mod imp {
#[cfg(windows)]
mod imp {
#[cfg(stage0)]
use prelude::v1::*;
use io;

View File

@ -12,7 +12,7 @@
#![allow(dead_code)]
use prelude::v1::*;
#[cfg(stage0)] use prelude::v1::*;
use io::prelude::*;
use rand::Rng;

View File

@ -19,7 +19,8 @@
//!
//! FIXME #7756: Would be nice for this to not exist.
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use vec::Vec;
/// One-time global initialization.
@ -140,7 +141,8 @@ mod imp {
target_os = "ios",
target_os = "windows"))]
mod imp {
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use vec::Vec;
pub unsafe fn init(_argc: isize, _argv: *const *const u8) {

View File

@ -12,6 +12,7 @@
#![allow(non_camel_case_types)]
#[cfg(stage0)]
use prelude::v1::*;
use env;

View File

@ -39,7 +39,8 @@
outside in crates.io first")]
#![allow(deprecated)]
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use core::mem::replace;
use boxed::Box;

View File

@ -265,6 +265,7 @@
// And now that you've seen all the races that I found and attempted to fix,
// here's the code for you to find some more!
#[cfg(stage0)]
use prelude::v1::*;
use sync::Arc;

View File

@ -40,7 +40,8 @@
pub use self::PopResult::*;
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use alloc::boxed::Box;
use core::ptr;

View File

@ -37,7 +37,8 @@ pub use self::UpgradeResult::*;
pub use self::SelectionResult::*;
use self::MyUpgrade::*;
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use sync::mpsc::Receiver;
use sync::mpsc::blocking::{self, SignalToken};

View File

@ -57,7 +57,8 @@
but no guarantees beyond this are being made")]
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use core::cell::{Cell, UnsafeCell};
use core::marker;

View File

@ -20,7 +20,8 @@
pub use self::Failure::*;
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use core::cmp;
use core::isize;

View File

@ -33,7 +33,8 @@
//! concurrently between two threads. This data structure is safe to use and
//! enforces the semantics that there is one pusher and one popper.
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use alloc::boxed::Box;
use core::ptr;

View File

@ -22,7 +22,8 @@ pub use self::UpgradeResult::*;
pub use self::SelectionResult::*;
use self::Message::*;
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use core::cmp;
use core::isize;

View File

@ -33,7 +33,8 @@
/// of a synchronous channel. There are a few branches for the unbuffered case,
/// but they're mostly just relevant to blocking senders.
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
pub use self::Failure::*;
use self::Blocker::*;

View File

@ -13,6 +13,7 @@
//! This primitive is meant to be used to run one-time initialization. An
//! example use case would be for initializing an FFI library.
#[cfg(stage0)]
use prelude::v1::*;
use isize;

View File

@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[cfg(stage0)]
use prelude::v1::*;
use io::prelude::*;

View File

@ -10,6 +10,7 @@
#![allow(missing_docs)]
#[cfg(stage0)]
use prelude::v1::*;
pub mod backtrace;

View File

@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[cfg(stage0)]
use prelude::v1::*;
use cell::Cell;

View File

@ -10,7 +10,8 @@
#![allow(dead_code)] // stack_guard isn't used right now on all platforms
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use cell::RefCell;
use string::String;

View File

@ -58,6 +58,7 @@
#![unstable(feature = "thread_local_internals")]
#![allow(dead_code)] // sys isn't exported yet
#[cfg(stage0)]
use prelude::v1::*;
use sync::atomic::{self, AtomicUsize, Ordering};

View File

@ -25,7 +25,8 @@
// unix (it's mostly used on windows), so don't worry about dead code here.
#![allow(dead_code)]
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use core::char::{encode_utf8_raw, encode_utf16_raw};
use core::str::next_code_point;

View File

@ -83,6 +83,7 @@
/// to symbols. This is a bit of a hokey implementation as-is, but it works for
/// all unix platforms we support right now, so it at least gets the job done.
#[cfg(stage0)]
use prelude::v1::*;
use io::prelude::*;

View File

@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[cfg(stage0)]
use prelude::v1::*;
use cell::UnsafeCell;

View File

@ -12,6 +12,7 @@
#![stable(feature = "rust1", since = "1.0.0")]
#[cfg(stage0)]
use prelude::v1::*;
use fs::{self, Permissions, OpenOptions};

View File

@ -14,6 +14,7 @@
use os::unix::raw::{uid_t, gid_t};
use os::unix::io::{FromRawFd, RawFd, AsRawFd, IntoRawFd};
#[cfg(stage0)]
use prelude::v1::*;
use process;
use sys;

View File

@ -8,7 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use io;
use libc::{self, c_int, size_t, c_void};

View File

@ -8,7 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use io::prelude::*;
use os::unix::prelude::*;

View File

@ -11,6 +11,7 @@
#![allow(missing_docs)]
#![allow(non_camel_case_types)]
#[cfg(stage0)]
use prelude::v1::*;
use io::{self, ErrorKind};

View File

@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[cfg(stage0)]
use prelude::v1::*;
use cell::UnsafeCell;

View File

@ -11,7 +11,8 @@
/// The underlying OsString/OsStr implementation on Unix systems: just
/// a `Vec<u8>`/`[u8]`.
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use borrow::Cow;
use fmt::{self, Debug};

View File

@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[cfg(stage0)]
use prelude::v1::*;
use sys::fd::FileDesc;

View File

@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[cfg(stage0)]
use prelude::v1::*;
use libc;

View File

@ -8,8 +8,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[cfg(stage0)]
use core::prelude::v1::*;
use libc;
use core::prelude::*;
use self::imp::{make_handler, drop_handler};
pub use self::imp::{init, cleanup};

View File

@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[cfg(stage0)]
use prelude::v1::*;
use io;

View File

@ -10,6 +10,7 @@
#![allow(dead_code)] // sys isn't exported yet
#[cfg(stage0)]
use prelude::v1::*;
use libc::c_int;

View File

@ -24,6 +24,7 @@
#![allow(dead_code)]
#[cfg(stage0)]
use prelude::v1::*;
use io::prelude::*;

View File

@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[cfg(stage0)]
use prelude::v1::*;
use cell::UnsafeCell;

View File

@ -12,6 +12,7 @@
#![stable(feature = "rust1", since = "1.0.0")]
#[cfg(stage0)]
use prelude::v1::*;
use fs::{OpenOptions, Metadata};

View File

@ -8,7 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use io::prelude::*;
use os::windows::prelude::*;

View File

@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[cfg(stage0)]
use prelude::v1::*;
use io::ErrorKind;

View File

@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[cfg(stage0)]
use prelude::v1::*;
use io;

View File

@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[cfg(stage0)]
use prelude::v1::*;
use io;

View File

@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[cfg(stage0)]
use prelude::v1::*;
use cell::UnsafeCell;

View File

@ -8,7 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use core::prelude::*;
#[cfg(stage0)]
use core::prelude::v1::*;
use libc::types::os::arch::extra::{LPVOID, DWORD, LONG};
use libc;

View File

@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[cfg(stage0)]
use prelude::v1::*;
use alloc::boxed::FnBox;

Some files were not shown because too many files have changed in this diff Show More