diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-07-29 17:01:14 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-08-03 17:23:01 -0700 |
| commit | 5cccf3cd256420d9f32c265e83036dea1d5f94d8 (patch) | |
| tree | 22904c7bb3df0872afa227638aa5e1e4ccb99fbc /src/libstd/sync/mpsc | |
| parent | ceded6adb3a4e172eabef09e1c78717a99c16b14 (diff) | |
| download | rust-5cccf3cd256420d9f32c265e83036dea1d5f94d8.tar.gz rust-5cccf3cd256420d9f32c265e83036dea1d5f94d8.zip | |
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
Diffstat (limited to 'src/libstd/sync/mpsc')
| -rw-r--r-- | src/libstd/sync/mpsc/mod.rs | 1 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/mpsc_queue.rs | 3 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/oneshot.rs | 3 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/select.rs | 3 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/shared.rs | 3 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/spsc_queue.rs | 3 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/stream.rs | 3 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/sync.rs | 3 |
8 files changed, 15 insertions, 7 deletions
diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index d80d858e7a9..954edefcc45 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -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; diff --git a/src/libstd/sync/mpsc/mpsc_queue.rs b/src/libstd/sync/mpsc/mpsc_queue.rs index d6d173e5e7e..f45032d327f 100644 --- a/src/libstd/sync/mpsc/mpsc_queue.rs +++ b/src/libstd/sync/mpsc/mpsc_queue.rs @@ -40,7 +40,8 @@ pub use self::PopResult::*; -use core::prelude::*; +#[cfg(stage0)] +use core::prelude::v1::*; use alloc::boxed::Box; use core::ptr; diff --git a/src/libstd/sync/mpsc/oneshot.rs b/src/libstd/sync/mpsc/oneshot.rs index 7e9c017617d..b84cb3b5472 100644 --- a/src/libstd/sync/mpsc/oneshot.rs +++ b/src/libstd/sync/mpsc/oneshot.rs @@ -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}; diff --git a/src/libstd/sync/mpsc/select.rs b/src/libstd/sync/mpsc/select.rs index ee1516342ad..1d31ac165f6 100644 --- a/src/libstd/sync/mpsc/select.rs +++ b/src/libstd/sync/mpsc/select.rs @@ -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; diff --git a/src/libstd/sync/mpsc/shared.rs b/src/libstd/sync/mpsc/shared.rs index 41c79dd52c8..8c019395d30 100644 --- a/src/libstd/sync/mpsc/shared.rs +++ b/src/libstd/sync/mpsc/shared.rs @@ -20,7 +20,8 @@ pub use self::Failure::*; -use core::prelude::*; +#[cfg(stage0)] +use core::prelude::v1::*; use core::cmp; use core::isize; diff --git a/src/libstd/sync/mpsc/spsc_queue.rs b/src/libstd/sync/mpsc/spsc_queue.rs index 3cf75de5a46..5c0db521007 100644 --- a/src/libstd/sync/mpsc/spsc_queue.rs +++ b/src/libstd/sync/mpsc/spsc_queue.rs @@ -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; diff --git a/src/libstd/sync/mpsc/stream.rs b/src/libstd/sync/mpsc/stream.rs index 404814b4cd4..a9514da4698 100644 --- a/src/libstd/sync/mpsc/stream.rs +++ b/src/libstd/sync/mpsc/stream.rs @@ -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; diff --git a/src/libstd/sync/mpsc/sync.rs b/src/libstd/sync/mpsc/sync.rs index 904eab1fd7e..7c9298fff2a 100644 --- a/src/libstd/sync/mpsc/sync.rs +++ b/src/libstd/sync/mpsc/sync.rs @@ -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::*; |
