about summary refs log tree commit diff
path: root/src/libstd/thread
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-08-05 02:00:46 +0000
committerbors <bors@rust-lang.org>2015-08-05 02:00:46 +0000
commitdbe415a4a7c3e10eff6d9a4b08128c341742e401 (patch)
treee1d3a1eac26b8adba127155b7c7d607dafe1908d /src/libstd/thread
parentefdbc0ec7e9bd8d2dadbe78b003fd7facf2a7aae (diff)
parent0d8340327c03f319b49cb91e2e64aa66dd1e76c7 (diff)
downloadrust-dbe415a4a7c3e10eff6d9a4b08128c341742e401.tar.gz
rust-dbe415a4a7c3e10eff6d9a4b08128c341742e401.zip
Auto merge of #27393 - alexcrichton:no-std-changes, r=brson
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

Closes #27394
Diffstat (limited to 'src/libstd/thread')
-rw-r--r--src/libstd/thread/local.rs3
-rw-r--r--src/libstd/thread/scoped_tls.rs3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs
index 9a6d68acb9f..0615033736e 100644
--- a/src/libstd/thread/local.rs
+++ b/src/libstd/thread/local.rs
@@ -12,6 +12,7 @@
 
 #![unstable(feature = "thread_local_internals")]
 
+#[cfg(stage0)]
 use prelude::v1::*;
 
 use cell::UnsafeCell;
@@ -271,6 +272,7 @@ impl<T: 'static> LocalKey<T> {
           not(no_elf_tls)))]
 #[doc(hidden)]
 mod imp {
+    #[cfg(stage0)]
     use prelude::v1::*;
 
     use cell::{Cell, UnsafeCell};
@@ -327,6 +329,7 @@ mod imp {
     // 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;
diff --git a/src/libstd/thread/scoped_tls.rs b/src/libstd/thread/scoped_tls.rs
index cf2c5db8277..1ea33a01791 100644
--- a/src/libstd/thread/scoped_tls.rs
+++ b/src/libstd/thread/scoped_tls.rs
@@ -42,6 +42,7 @@
 
 #![unstable(feature = "thread_local_internals")]
 
+#[cfg(stage0)]
 use prelude::v1::*;
 
 #[doc(hidden)]
@@ -249,6 +250,7 @@ mod imp {
           no_elf_tls))]
 #[doc(hidden)]
 mod imp {
+    #[cfg(stage0)]
     use prelude::v1::*;
 
     use cell::Cell;
@@ -278,6 +280,7 @@ mod imp {
 #[cfg(test)]
 mod tests {
     use cell::Cell;
+    #[cfg(stage0)]
     use prelude::v1::*;
 
     scoped_thread_local!(static FOO: u32);