about summary refs log tree commit diff
path: root/src/libstd/thread
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-06-18 19:14:52 +0000
committerbors <bors@rust-lang.org>2015-06-18 19:14:52 +0000
commit9cc0b2247509d61d6a246a5c5ad67f84b9a2d8b6 (patch)
treec9c5e9d32ccf0c44d331dc9fe139b8d82d912b15 /src/libstd/thread
parentf4518127636e6bffab0599ab4dad785a873c5bd8 (diff)
parentec333380e03eb1fb94c4938db888d5bed40b8fd6 (diff)
Auto merge of #26192 - alexcrichton:features-clean, r=aturon
This commit shards the all-encompassing `core`, `std_misc`, `collections`, and `alloc` features into finer-grained components that are much more easily opted into and tracked. This reflects the effort to push forward current unstable APIs to either stabilization or removal. Keeping track of unstable features on a much more fine-grained basis will enable the library subteam to quickly analyze a feature and help prioritize internally about what APIs should be stabilized.

A few assorted APIs were deprecated along the way, but otherwise this change is just changing the feature name associated with each API. Soon we will have a dashboard for keeping track of all the unstable APIs in the standard library, and I'll also start making issues for each unstable API after performing a first-pass for stabilization.
Diffstat (limited to 'src/libstd/thread')
-rw-r--r--src/libstd/thread/local.rs10
-rw-r--r--src/libstd/thread/mod.rs7
2 files changed, 11 insertions, 6 deletions
diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs
index 69a26cdc490..60563340d10 100644
--- a/src/libstd/thread/local.rs
+++ b/src/libstd/thread/local.rs
@@ -154,7 +154,7 @@ macro_rules! __thread_local_inner {
 }
 
 /// Indicator of the state of a thread local storage key.
-#[unstable(feature = "std_misc",
+#[unstable(feature = "thread_local_state",
            reason = "state querying was recently added")]
 #[derive(Eq, PartialEq, Copy, Clone)]
 pub enum LocalKeyState {
@@ -249,7 +249,7 @@ impl<T: 'static> LocalKey<T> {
     /// initialization does not panic. Keys in the `Valid` state are guaranteed
     /// to be able to be accessed. Keys in the `Destroyed` state will panic on
     /// any call to `with`.
-    #[unstable(feature = "std_misc",
+    #[unstable(feature = "thread_local_state",
                reason = "state querying was recently added")]
     pub fn state(&'static self) -> LocalKeyState {
         unsafe {
@@ -326,7 +326,6 @@ 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 boxed;
         use mem;
         use ptr;
         use libc;
@@ -360,7 +359,7 @@ mod imp {
         type List = Vec<(*mut u8, unsafe extern fn(*mut u8))>;
         if DTORS.get().is_null() {
             let v: Box<List> = box Vec::new();
-            DTORS.set(boxed::into_raw(v) as *mut u8);
+            DTORS.set(Box::into_raw(v) as *mut u8);
         }
         let list: &mut List = &mut *(DTORS.get() as *mut List);
         list.push((t, dtor));
@@ -406,7 +405,6 @@ mod imp {
 mod imp {
     use prelude::v1::*;
 
-    use alloc::boxed;
     use cell::{Cell, UnsafeCell};
     use marker;
     use ptr;
@@ -448,7 +446,7 @@ mod imp {
                 key: self,
                 value: UnsafeCell::new(None),
             };
-            let ptr = boxed::into_raw(ptr);
+            let ptr = Box::into_raw(ptr);
             self.os.set(ptr as *mut u8);
             Some(&(*ptr).value)
         }
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs
index 153b0436087..dbb7d3233bc 100644
--- a/src/libstd/thread/mod.rs
+++ b/src/libstd/thread/mod.rs
@@ -297,6 +297,9 @@ impl Builder {
     /// the OS level.
     #[unstable(feature = "scoped",
                reason = "memory unsafe if destructor is avoided, see #24292")]
+    #[deprecated(since = "1.2.0",
+                 reason = "this unsafe API is unlikely to ever be stabilized \
+                           in this form")]
     pub fn scoped<'a, T, F>(self, f: F) -> io::Result<JoinGuard<'a, T>> where
         T: Send + 'a, F: FnOnce() -> T, F: Send + 'a
     {
@@ -398,6 +401,10 @@ pub fn spawn<F, T>(f: F) -> JoinHandle<T> where
 /// to recover from such errors.
 #[unstable(feature = "scoped",
            reason = "memory unsafe if destructor is avoided, see #24292")]
+#[deprecated(since = "1.2.0",
+             reason = "this unsafe API is unlikely to ever be stabilized \
+                       in this form")]
+#[allow(deprecated)]
 pub fn scoped<'a, T, F>(f: F) -> JoinGuard<'a, T> where
     T: Send + 'a, F: FnOnce() -> T, F: Send + 'a
 {