From 6895311e859e1859f9b3f0adc9f1fbb4d2891534 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 9 Jun 2015 18:15:22 -0700 Subject: [PATCH] std: Split the `std_misc` feature --- src/libcollections/btree/map.rs | 2 +- src/liblog/lib.rs | 4 +++- src/librustc/lib.rs | 3 ++- src/librustc_trans/lib.rs | 2 +- src/libserialize/lib.rs | 4 ++-- src/libstd/ascii.rs | 6 +----- src/libstd/collections/hash/map.rs | 25 ++++++++++++------------- src/libstd/collections/hash/set.rs | 14 ++++++++------ src/libstd/collections/hash/state.rs | 4 ++-- src/libstd/collections/mod.rs | 2 +- src/libstd/dynamic_lib.rs | 4 +++- src/libstd/ffi/c_str.rs | 1 - src/libstd/io/error.rs | 2 +- src/libstd/lib.rs | 2 +- src/libstd/macros.rs | 6 ++---- src/libstd/num/f32.rs | 28 +++++++++++++++------------- src/libstd/num/f64.rs | 16 ++++++++-------- src/libstd/num/float_macros.rs | 1 - src/libstd/num/int_macros.rs | 1 - src/libstd/num/uint_macros.rs | 1 - src/libstd/panicking.rs | 2 -- src/libstd/rt/mod.rs | 4 +++- src/libstd/rtdeps.rs | 2 -- src/libstd/sync/future.rs | 2 +- src/libstd/sync/mpsc/mpsc_queue.rs | 2 -- src/libstd/sync/mpsc/select.rs | 6 +++--- src/libstd/sync/mpsc/spsc_queue.rs | 2 -- src/libstd/sync/mutex.rs | 19 ++++++------------- src/libstd/sync/once.rs | 2 +- src/libstd/sync/rwlock.rs | 22 ++++++---------------- src/libstd/sync/semaphore.rs | 2 +- src/libstd/sys/common/poison.rs | 8 ++++---- src/libstd/thread/local.rs | 4 ++-- src/libstd/thunk.rs | 2 +- src/libterm/lib.rs | 2 +- 35 files changed, 92 insertions(+), 117 deletions(-) diff --git a/src/libcollections/btree/map.rs b/src/libcollections/btree/map.rs index 127f470c9aa..95a6fe14ef6 100644 --- a/src/libcollections/btree/map.rs +++ b/src/libcollections/btree/map.rs @@ -1151,7 +1151,7 @@ fn next_back(&mut self) -> Option<(&'a K, &'a mut V)> { self.inner.next_back() } } impl<'a, K: Ord, V> Entry<'a, K, V> { - #[unstable(feature = "std_misc", + #[unstable(feature = "entry", reason = "will soon be replaced by or_insert")] #[deprecated(since = "1.0", reason = "replaced with more ergonomic `or_insert` and `or_insert_with`")] diff --git a/src/liblog/lib.rs b/src/liblog/lib.rs index 0238bf1f4be..246b5909865 100644 --- a/src/liblog/lib.rs +++ b/src/liblog/lib.rs @@ -173,8 +173,10 @@ #![feature(box_syntax)] #![feature(const_fn)] #![feature(iter_cmp)] +#![feature(once_new)] +#![feature(rt)] #![feature(staged_api)] -#![feature(std_misc)] +#![feature(static_mutex)] use std::boxed; use std::cell::RefCell; diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index 49667bf74cf..b557b0f5649 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -34,9 +34,11 @@ #![feature(const_fn)] #![feature(duration)] #![feature(duration_span)] +#![feature(dynamic_lib)] #![feature(enumset)] #![feature(fs_canonicalize)] #![feature(hash_default)] +#![feature(hashmap_hasher)] #![feature(into_cow)] #![feature(iter_sum)] #![feature(libc)] @@ -53,7 +55,6 @@ #![feature(slice_patterns)] #![feature(slice_position_elem)] #![feature(staged_api)] -#![feature(std_misc)] #![feature(str_char)] #![feature(str_matches)] #![feature(vec_push_all)] diff --git a/src/librustc_trans/lib.rs b/src/librustc_trans/lib.rs index 5ace7728495..978fa4e745b 100644 --- a/src/librustc_trans/lib.rs +++ b/src/librustc_trans/lib.rs @@ -33,6 +33,7 @@ #![feature(iter_sum)] #![feature(iter_unfold)] #![feature(libc)] +#![feature(once_new)] #![feature(path_ext)] #![feature(path_ext)] #![feature(path_relative_from)] @@ -42,7 +43,6 @@ #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] #![feature(staged_api)] -#![feature(std_misc)] #![feature(unicode)] #![feature(unicode)] #![feature(vec_push_all)] diff --git a/src/libserialize/lib.rs b/src/libserialize/lib.rs index 7fdab878915..5951e4f823e 100644 --- a/src/libserialize/lib.rs +++ b/src/libserialize/lib.rs @@ -29,15 +29,15 @@ #![feature(box_syntax)] #![feature(collections)] +#![feature(enumset)] +#![feature(hashmap_hasher)] #![feature(num_bits_bytes)] #![feature(num_wrapping)] #![feature(rustc_private)] #![feature(staged_api)] -#![feature(std_misc)] #![feature(str_char)] #![feature(unicode)] #![feature(vecmap)] -#![feature(enumset)] #![cfg_attr(test, feature(test))] // test harness access diff --git a/src/libstd/ascii.rs b/src/libstd/ascii.rs index b808acb73a1..9b94b7f7003 100644 --- a/src/libstd/ascii.rs +++ b/src/libstd/ascii.rs @@ -18,7 +18,7 @@ use mem; /// Extension methods for ASCII-subset only operations on owned strings -#[unstable(feature = "std_misc", +#[unstable(feature = "owned_ascii_ext", reason = "would prefer to do this in a more general way")] pub trait OwnedAsciiExt { /// Converts the string to ASCII upper case: @@ -189,8 +189,6 @@ fn make_ascii_lowercase(&mut self) { } } -#[unstable(feature = "std_misc", - reason = "would prefer to do this in a more general way")] impl OwnedAsciiExt for String { #[inline] fn into_ascii_uppercase(self) -> String { @@ -244,8 +242,6 @@ fn make_ascii_lowercase(&mut self) { } } -#[unstable(feature = "std_misc", - reason = "would prefer to do this in a more general way")] impl OwnedAsciiExt for Vec { #[inline] fn into_ascii_uppercase(mut self) -> Vec { diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs index e12814bf77c..1dca3b77f38 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -43,8 +43,7 @@ use super::state::HashState; const INITIAL_LOG2_CAP: usize = 5; -#[unstable(feature = "std_misc")] -pub const INITIAL_CAPACITY: usize = 1 << INITIAL_LOG2_CAP; // 2^5 +const INITIAL_CAPACITY: usize = 1 << INITIAL_LOG2_CAP; // 2^5 /// The default behavior of HashMap implements a load factor of 90.9%. /// This behavior is characterized by the following condition: @@ -544,7 +543,7 @@ impl HashMap /// # Examples /// /// ``` - /// # #![feature(std_misc)] + /// # #![feature(hashmap_hasher)] /// use std::collections::HashMap; /// use std::collections::hash_map::RandomState; /// @@ -553,7 +552,7 @@ impl HashMap /// map.insert(1, 2); /// ``` #[inline] - #[unstable(feature = "std_misc", reason = "hasher stuff is unclear")] + #[unstable(feature = "hashmap_hasher", reason = "hasher stuff is unclear")] pub fn with_hash_state(hash_state: S) -> HashMap { HashMap { hash_state: hash_state, @@ -573,7 +572,7 @@ pub fn with_hash_state(hash_state: S) -> HashMap { /// # Examples /// /// ``` - /// # #![feature(std_misc)] + /// # #![feature(hashmap_hasher)] /// use std::collections::HashMap; /// use std::collections::hash_map::RandomState; /// @@ -582,7 +581,7 @@ pub fn with_hash_state(hash_state: S) -> HashMap { /// map.insert(1, 2); /// ``` #[inline] - #[unstable(feature = "std_misc", reason = "hasher stuff is unclear")] + #[unstable(feature = "hashmap_hasher", reason = "hasher stuff is unclear")] pub fn with_capacity_and_hash_state(capacity: usize, hash_state: S) -> HashMap { let resize_policy = DefaultResizePolicy::new(); @@ -980,7 +979,7 @@ pub fn is_empty(&self) -> bool { self.len() == 0 } /// # Examples /// /// ``` - /// # #![feature(std_misc)] + /// # #![feature(drain)] /// use std::collections::HashMap; /// /// let mut a = HashMap::new(); @@ -995,7 +994,7 @@ pub fn is_empty(&self) -> bool { self.len() == 0 } /// assert!(a.is_empty()); /// ``` #[inline] - #[unstable(feature = "std_misc", + #[unstable(feature = "drain", reason = "matches collection reform specification, waiting for dust to settle")] pub fn drain(&mut self) -> Drain { fn last_two((_, b, c): (A, B, C)) -> (B, C) { (b, c) } @@ -1308,7 +1307,7 @@ fn clone(&self) -> Values<'a, K, V> { } /// HashMap drain iterator. -#[unstable(feature = "std_misc", +#[unstable(feature = "drain", reason = "matches collection reform specification, waiting for dust to settle")] pub struct Drain<'a, K: 'a, V: 'a> { inner: iter::Map, fn((SafeHash, K, V)) -> (K, V)> @@ -1480,7 +1479,7 @@ impl<'a, K, V> ExactSizeIterator for Drain<'a, K, V> { } impl<'a, K, V> Entry<'a, K, V> { - #[unstable(feature = "std_misc", + #[unstable(feature = "entry", reason = "will soon be replaced by or_insert")] #[deprecated(since = "1.0", reason = "replaced with more ergonomic `or_insert` and `or_insert_with`")] @@ -1596,14 +1595,14 @@ fn extend>(&mut self, iter: T) { /// `Hasher`, but the hashers created by two different `RandomState` /// instances are unlikely to produce the same result for the same values. #[derive(Clone)] -#[unstable(feature = "std_misc", +#[unstable(feature = "hashmap_hasher", reason = "hashing an hash maps may be altered")] pub struct RandomState { k0: u64, k1: u64, } -#[unstable(feature = "std_misc", +#[unstable(feature = "hashmap_hasher", reason = "hashing an hash maps may be altered")] impl RandomState { /// Constructs a new `RandomState` that is initialized with random keys. @@ -1615,7 +1614,7 @@ pub fn new() -> RandomState { } } -#[unstable(feature = "std_misc", +#[unstable(feature = "hashmap_hasher", reason = "hashing an hash maps may be altered")] impl HashState for RandomState { type Hasher = SipHasher; diff --git a/src/libstd/collections/hash/set.rs b/src/libstd/collections/hash/set.rs index c31a46ada32..ba50b156ab2 100644 --- a/src/libstd/collections/hash/set.rs +++ b/src/libstd/collections/hash/set.rs @@ -20,9 +20,11 @@ use ops::{BitOr, BitAnd, BitXor, Sub}; use option::Option::{Some, None, self}; -use super::map::{self, HashMap, Keys, INITIAL_CAPACITY, RandomState}; +use super::map::{self, HashMap, Keys, RandomState}; use super::state::HashState; +const INITIAL_CAPACITY: usize = 32; + // Future Optimization (FIXME!) // ============================= // @@ -152,7 +154,7 @@ impl HashSet /// # Examples /// /// ``` - /// # #![feature(std_misc)] + /// # #![feature(hashmap_hasher)] /// use std::collections::HashSet; /// use std::collections::hash_map::RandomState; /// @@ -161,7 +163,7 @@ impl HashSet /// set.insert(2); /// ``` #[inline] - #[unstable(feature = "std_misc", reason = "hasher stuff is unclear")] + #[unstable(feature = "hashmap_hasher", reason = "hasher stuff is unclear")] pub fn with_hash_state(hash_state: S) -> HashSet { HashSet::with_capacity_and_hash_state(INITIAL_CAPACITY, hash_state) } @@ -177,7 +179,7 @@ pub fn with_hash_state(hash_state: S) -> HashSet { /// # Examples /// /// ``` - /// # #![feature(std_misc)] + /// # #![feature(hashmap_hasher)] /// use std::collections::HashSet; /// use std::collections::hash_map::RandomState; /// @@ -186,7 +188,7 @@ pub fn with_hash_state(hash_state: S) -> HashSet { /// set.insert(1); /// ``` #[inline] - #[unstable(feature = "std_misc", reason = "hasher stuff is unclear")] + #[unstable(feature = "hashmap_hasher", reason = "hasher stuff is unclear")] pub fn with_capacity_and_hash_state(capacity: usize, hash_state: S) -> HashSet { HashSet { @@ -406,7 +408,7 @@ pub fn is_empty(&self) -> bool { self.map.is_empty() } /// Clears the set, returning all elements in an iterator. #[inline] - #[unstable(feature = "std_misc", + #[unstable(feature = "drain", reason = "matches collection reform specification, waiting for dust to settle")] pub fn drain(&mut self) -> Drain { fn first((a, _): (A, B)) -> A { a } diff --git a/src/libstd/collections/hash/state.rs b/src/libstd/collections/hash/state.rs index 3a06d2d03bf..365e6268b3b 100644 --- a/src/libstd/collections/hash/state.rs +++ b/src/libstd/collections/hash/state.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![unstable(feature = "hashmap_hasher", reason = "hasher stuff is unclear")] + use clone::Clone; use default::Default; use hash; @@ -25,7 +27,6 @@ /// algorithm can implement the `Default` trait and create hash maps with the /// `DefaultState` structure. This state is 0-sized and will simply delegate /// to `Default` when asked to create a hasher. -#[unstable(feature = "std_misc", reason = "hasher stuff is unclear")] pub trait HashState { /// Type of the hasher that will be created. type Hasher: hash::Hasher; @@ -38,7 +39,6 @@ pub trait HashState { /// default trait. /// /// This struct has is 0-sized and does not need construction. -#[unstable(feature = "std_misc", reason = "hasher stuff is unclear")] pub struct DefaultState(marker::PhantomData); impl HashState for DefaultState { diff --git a/src/libstd/collections/mod.rs b/src/libstd/collections/mod.rs index 4781f2b4754..3f0b223b997 100644 --- a/src/libstd/collections/mod.rs +++ b/src/libstd/collections/mod.rs @@ -410,7 +410,7 @@ pub mod hash_set { /// Experimental support for providing custom hash algorithms to a HashMap and /// HashSet. -#[unstable(feature = "std_misc", reason = "module was recently added")] +#[unstable(feature = "hashmap_hasher", reason = "module was recently added")] pub mod hash_state { pub use super::hash::state::*; } diff --git a/src/libstd/dynamic_lib.rs b/src/libstd/dynamic_lib.rs index 1c8e52f1b53..ddafe416305 100644 --- a/src/libstd/dynamic_lib.rs +++ b/src/libstd/dynamic_lib.rs @@ -12,7 +12,9 @@ //! //! A simple wrapper over the platform's dynamic library facilities -#![unstable(feature = "std_misc")] +#![unstable(feature = "dynamic_lib", + reason = "API has not been scrutinized and is highly likely to \ + either disappear or change")] #![allow(missing_docs)] use prelude::v1::*; diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs index 433bb335a80..d5df9b3aa72 100644 --- a/src/libstd/ffi/c_str.rs +++ b/src/libstd/ffi/c_str.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![unstable(feature = "std_misc")] use borrow::{Cow, ToOwned}; use boxed::{self, Box}; diff --git a/src/libstd/io/error.rs b/src/libstd/io/error.rs index c4e472f158e..b43ac0daf51 100644 --- a/src/libstd/io/error.rs +++ b/src/libstd/io/error.rs @@ -123,7 +123,7 @@ pub enum ErrorKind { Other, /// Any I/O error not part of this list. - #[unstable(feature = "std_misc", + #[unstable(feature = "io_error_internals", reason = "better expressed through extensible enums that this \ enum cannot be exhaustively matched against")] #[doc(hidden)] diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 20211f87689..fb510ed6782 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -150,7 +150,7 @@ #![feature(wrapping)] #![feature(zero_one)] #![cfg_attr(test, feature(float_from_str_radix))] -#![cfg_attr(test, feature(test, rustc_private, std_misc))] +#![cfg_attr(test, feature(test, rustc_private))] // Don't link to std. We are std. #![no_std] diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index 706571b67c9..749974c7afa 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -14,8 +14,6 @@ //! library. Each macro is available for use when linking against the standard //! library. -#![unstable(feature = "std_misc")] - /// The entry point for panic of Rust threads. /// /// This macro is used to inject panic into a Rust thread, causing the thread to @@ -165,7 +163,7 @@ macro_rules! try { /// # Examples /// /// ``` -/// # #![feature(std_misc)] +/// # #![feature(mpsc_select)] /// use std::thread; /// use std::sync::mpsc; /// @@ -191,7 +189,7 @@ macro_rules! try { /// /// For more information about select, see the `std::sync::mpsc::Select` structure. #[macro_export] -#[unstable(feature = "std_misc")] +#[unstable(feature = "mpsc_select")] macro_rules! select { ( $($name:pat = $rx:ident.$meth:ident() => $code:expr),+ diff --git a/src/libstd/num/f32.rs b/src/libstd/num/f32.rs index c22f5d073de..0c40f6c1fc8 100644 --- a/src/libstd/num/f32.rs +++ b/src/libstd/num/f32.rs @@ -194,7 +194,7 @@ pub fn classify(self) -> FpCategory { num::Float::classify(self) } /// The floating point encoding is documented in the [Reference][floating-point]. /// /// ``` - /// # #![feature(std_misc)] + /// # #![feature(float_extras)] /// use std::f32; /// /// let num = 2.0f32; @@ -211,9 +211,11 @@ pub fn classify(self) -> FpCategory { num::Float::classify(self) } /// assert!(abs_difference <= f32::EPSILON); /// ``` /// [floating-point]: ../../../../../reference.html#machine-types - #[unstable(feature = "std_misc", reason = "signature is undecided")] + #[unstable(feature = "float_extras", reason = "signature is undecided")] #[inline] - pub fn integer_decode(self) -> (u64, i16, i8) { num::Float::integer_decode(self) } + pub fn integer_decode(self) -> (u64, i16, i8) { + num::Float::integer_decode(self) + } /// Returns the largest integer less than or equal to a number. /// @@ -555,7 +557,7 @@ pub fn log10(self) -> f32 { num::Float::log10(self) } /// Converts radians to degrees. /// /// ``` - /// # #![feature(std_misc)] + /// # #![feature(float_extras)] /// use std::f32::{self, consts}; /// /// let angle = consts::PI; @@ -564,14 +566,14 @@ pub fn log10(self) -> f32 { num::Float::log10(self) } /// /// assert!(abs_difference <= f32::EPSILON); /// ``` - #[unstable(feature = "std_misc", reason = "desirability is unclear")] + #[unstable(feature = "float_extras", reason = "desirability is unclear")] #[inline] pub fn to_degrees(self) -> f32 { num::Float::to_degrees(self) } /// Converts degrees to radians. /// /// ``` - /// # #![feature(std_misc)] + /// # #![feature(float_extras)] /// use std::f32::{self, consts}; /// /// let angle = 180.0f32; @@ -580,21 +582,21 @@ pub fn to_degrees(self) -> f32 { num::Float::to_degrees(self) } /// /// assert!(abs_difference <= f32::EPSILON); /// ``` - #[unstable(feature = "std_misc", reason = "desirability is unclear")] + #[unstable(feature = "float_extras", reason = "desirability is unclear")] #[inline] pub fn to_radians(self) -> f32 { num::Float::to_radians(self) } /// Constructs a floating point number of `x*2^exp`. /// /// ``` - /// # #![feature(std_misc)] + /// # #![feature(float_extras)] /// use std::f32; /// // 3*2^2 - 12 == 0 /// let abs_difference = (f32::ldexp(3.0, 2) - 12.0).abs(); /// /// assert!(abs_difference <= f32::EPSILON); /// ``` - #[unstable(feature = "std_misc", + #[unstable(feature = "float_extras", reason = "pending integer conventions")] #[inline] pub fn ldexp(x: f32, exp: isize) -> f32 { @@ -608,7 +610,7 @@ pub fn ldexp(x: f32, exp: isize) -> f32 { /// * `0.5 <= abs(x) < 1.0` /// /// ``` - /// # #![feature(std_misc)] + /// # #![feature(float_extras)] /// use std::f32; /// /// let x = 4.0f32; @@ -621,7 +623,7 @@ pub fn ldexp(x: f32, exp: isize) -> f32 { /// assert!(abs_difference_0 <= f32::EPSILON); /// assert!(abs_difference_1 <= f32::EPSILON); /// ``` - #[unstable(feature = "std_misc", + #[unstable(feature = "float_extras", reason = "pending integer conventions")] #[inline] pub fn frexp(self) -> (f32, isize) { @@ -636,7 +638,7 @@ pub fn frexp(self) -> (f32, isize) { /// `other`. /// /// ``` - /// # #![feature(std_misc)] + /// # #![feature(float_extras)] /// use std::f32; /// /// let x = 1.0f32; @@ -645,7 +647,7 @@ pub fn frexp(self) -> (f32, isize) { /// /// assert!(abs_diff <= f32::EPSILON); /// ``` - #[unstable(feature = "std_misc", + #[unstable(feature = "float_extras", reason = "unsure about its place in the world")] #[inline] pub fn next_after(self, other: f32) -> f32 { diff --git a/src/libstd/num/f64.rs b/src/libstd/num/f64.rs index cde0b567ade..41c0fcb9797 100644 --- a/src/libstd/num/f64.rs +++ b/src/libstd/num/f64.rs @@ -190,7 +190,7 @@ pub fn classify(self) -> FpCategory { num::Float::classify(self) } /// The floating point encoding is documented in the [Reference][floating-point]. /// /// ``` - /// # #![feature(std_misc)] + /// # #![feature(float_extras)] /// let num = 2.0f64; /// /// // (8388608, -22, 1) @@ -205,7 +205,7 @@ pub fn classify(self) -> FpCategory { num::Float::classify(self) } /// assert!(abs_difference < 1e-10); /// ``` /// [floating-point]: ../../../../../reference.html#machine-types - #[unstable(feature = "std_misc", reason = "signature is undecided")] + #[unstable(feature = "float_extras", reason = "signature is undecided")] #[inline] pub fn integer_decode(self) -> (u64, i16, i8) { num::Float::integer_decode(self) } @@ -567,13 +567,13 @@ pub fn to_radians(self) -> f64 { num::Float::to_radians(self) } /// Constructs a floating point number of `x*2^exp`. /// /// ``` - /// # #![feature(std_misc)] + /// # #![feature(float_extras)] /// // 3*2^2 - 12 == 0 /// let abs_difference = (f64::ldexp(3.0, 2) - 12.0).abs(); /// /// assert!(abs_difference < 1e-10); /// ``` - #[unstable(feature = "std_misc", + #[unstable(feature = "float_extras", reason = "pending integer conventions")] #[inline] pub fn ldexp(x: f64, exp: isize) -> f64 { @@ -587,7 +587,7 @@ pub fn ldexp(x: f64, exp: isize) -> f64 { /// * `0.5 <= abs(x) < 1.0` /// /// ``` - /// # #![feature(std_misc)] + /// # #![feature(float_extras)] /// let x = 4.0_f64; /// /// // (1/2)*2^3 -> 1 * 8/2 -> 4.0 @@ -598,7 +598,7 @@ pub fn ldexp(x: f64, exp: isize) -> f64 { /// assert!(abs_difference_0 < 1e-10); /// assert!(abs_difference_1 < 1e-10); /// ``` - #[unstable(feature = "std_misc", + #[unstable(feature = "float_extras", reason = "pending integer conventions")] #[inline] pub fn frexp(self) -> (f64, isize) { @@ -613,7 +613,7 @@ pub fn frexp(self) -> (f64, isize) { /// `other`. /// /// ``` - /// # #![feature(std_misc)] + /// # #![feature(float_extras)] /// /// let x = 1.0f32; /// @@ -621,7 +621,7 @@ pub fn frexp(self) -> (f64, isize) { /// /// assert!(abs_diff < 1e-10); /// ``` - #[unstable(feature = "std_misc", + #[unstable(feature = "float_extras", reason = "unsure about its place in the world")] #[inline] pub fn next_after(self, other: f64) -> f64 { diff --git a/src/libstd/num/float_macros.rs b/src/libstd/num/float_macros.rs index 60a548b596b..16ad21a07d7 100644 --- a/src/libstd/num/float_macros.rs +++ b/src/libstd/num/float_macros.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![unstable(feature = "std_misc")] #![doc(hidden)] macro_rules! assert_approx_eq { diff --git a/src/libstd/num/int_macros.rs b/src/libstd/num/int_macros.rs index af1976d5750..178fad09f98 100644 --- a/src/libstd/num/int_macros.rs +++ b/src/libstd/num/int_macros.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![unstable(feature = "std_misc")] #![doc(hidden)] macro_rules! int_module { ($T:ty) => ( diff --git a/src/libstd/num/uint_macros.rs b/src/libstd/num/uint_macros.rs index 96b0ba1c77f..555a5cc3e20 100644 --- a/src/libstd/num/uint_macros.rs +++ b/src/libstd/num/uint_macros.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![unstable(feature = "std_misc")] #![doc(hidden)] #![allow(unsigned_negation)] diff --git a/src/libstd/panicking.rs b/src/libstd/panicking.rs index 01588843591..b584658fb07 100644 --- a/src/libstd/panicking.rs +++ b/src/libstd/panicking.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![unstable(feature = "std_misc")] - use prelude::v1::*; use io::prelude::*; diff --git a/src/libstd/rt/mod.rs b/src/libstd/rt/mod.rs index 0d26206f26b..1b8e81e2b79 100644 --- a/src/libstd/rt/mod.rs +++ b/src/libstd/rt/mod.rs @@ -16,7 +16,9 @@ //! and should be considered as private implementation details for the //! time being. -#![unstable(feature = "std_misc")] +#![unstable(feature = "rt", + reason = "this public module should not exist and is highly likely \ + to disappear")] #![allow(missing_docs)] use prelude::v1::*; diff --git a/src/libstd/rtdeps.rs b/src/libstd/rtdeps.rs index a7f3bc2bdc8..be674c83e22 100644 --- a/src/libstd/rtdeps.rs +++ b/src/libstd/rtdeps.rs @@ -12,8 +12,6 @@ //! the standard library This varies per-platform, but these libraries are //! necessary for running libstd. -#![unstable(feature = "std_misc")] - // All platforms need to link to rustrt #[cfg(not(test))] #[link(name = "rust_builtin", kind = "static")] diff --git a/src/libstd/sync/future.rs b/src/libstd/sync/future.rs index 2d281eb4e24..76b07999280 100644 --- a/src/libstd/sync/future.rs +++ b/src/libstd/sync/future.rs @@ -28,7 +28,7 @@ //! ``` #![allow(missing_docs)] -#![unstable(feature = "std_misc", +#![unstable(feature = "future", reason = "futures as-is have yet to be deeply reevaluated with recent \ core changes to Rust's synchronization story, and will likely \ become stable in the future but are unstable until that time")] diff --git a/src/libstd/sync/mpsc/mpsc_queue.rs b/src/libstd/sync/mpsc/mpsc_queue.rs index 2c0da938cbf..f3edf0d68c7 100644 --- a/src/libstd/sync/mpsc/mpsc_queue.rs +++ b/src/libstd/sync/mpsc/mpsc_queue.rs @@ -35,8 +35,6 @@ //! method, and see the method for more information about it. Due to this //! caveat, this queue may not be appropriate for all use-cases. -#![unstable(feature = "std_misc")] - // http://www.1024cores.net/home/lock-free-algorithms // /queues/non-intrusive-mpsc-node-based-queue diff --git a/src/libstd/sync/mpsc/select.rs b/src/libstd/sync/mpsc/select.rs index 679cc550454..a67138742ae 100644 --- a/src/libstd/sync/mpsc/select.rs +++ b/src/libstd/sync/mpsc/select.rs @@ -27,7 +27,7 @@ //! # Examples //! //! ```rust -//! # #![feature(std_misc)] +//! # #![feature(mpsc_select)] //! use std::sync::mpsc::channel; //! //! let (tx1, rx1) = channel(); @@ -47,7 +47,7 @@ //! ``` #![allow(dead_code)] -#![unstable(feature = "std_misc", +#![unstable(feature = "mpsc_select", reason = "This implementation, while likely sufficient, is unsafe and \ likely to be error prone. At some point in the future this \ module will likely be replaced, and it is currently \ @@ -124,7 +124,7 @@ impl Select { /// # Examples /// /// ``` - /// # #![feature(std_misc)] + /// # #![feature(mpsc_select)] /// use std::sync::mpsc::Select; /// /// let select = Select::new(); diff --git a/src/libstd/sync/mpsc/spsc_queue.rs b/src/libstd/sync/mpsc/spsc_queue.rs index a0ed52d4d3c..770068a66be 100644 --- a/src/libstd/sync/mpsc/spsc_queue.rs +++ b/src/libstd/sync/mpsc/spsc_queue.rs @@ -33,8 +33,6 @@ //! concurrently between two threads. This data structure is safe to use and //! enforces the semantics that there is one pusher and one popper. -#![unstable(feature = "std_misc")] - use core::prelude::*; use alloc::boxed; diff --git a/src/libstd/sync/mutex.rs b/src/libstd/sync/mutex.rs index fd22d723ebd..5f77ee20545 100644 --- a/src/libstd/sync/mutex.rs +++ b/src/libstd/sync/mutex.rs @@ -85,7 +85,6 @@ /// To recover from a poisoned mutex: /// /// ``` -/// # #![feature(std_misc)] /// use std::sync::{Arc, Mutex}; /// use std::thread; /// @@ -139,7 +138,7 @@ unsafe impl Sync for Mutex { } /// # Examples /// /// ``` -/// # #![feature(std_misc)] +/// # #![feature(static_mutex)] /// use std::sync::{StaticMutex, MUTEX_INIT}; /// /// static LOCK: StaticMutex = MUTEX_INIT; @@ -150,7 +149,7 @@ unsafe impl Sync for Mutex { } /// } /// // lock is unlocked here. /// ``` -#[unstable(feature = "std_misc", +#[unstable(feature = "static_mutex", reason = "may be merged with Mutex in the future")] pub struct StaticMutex { lock: sys::Mutex, @@ -176,7 +175,7 @@ impl<'a, T: ?Sized> !marker::Send for MutexGuard<'a, T> {} /// Static initialization of a mutex. This constant can be used to initialize /// other mutex constants. -#[unstable(feature = "std_misc", +#[unstable(feature = "static_mutex", reason = "may be merged with Mutex in the future")] pub const MUTEX_INIT: StaticMutex = StaticMutex::new(); @@ -237,7 +236,7 @@ pub fn try_lock(&self) -> TryLockResult> { /// time. You should not trust a `false` value for program correctness /// without additional synchronization. #[inline] - #[unstable(feature = "std_misc")] + #[unstable(feature = "sync_poison")] pub fn is_poisoned(&self) -> bool { self.inner.poison.get() } @@ -270,10 +269,10 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { unsafe impl Sync for Dummy {} static DUMMY: Dummy = Dummy(UnsafeCell::new(())); +#[unstable(feature = "static_mutex", + reason = "may be merged with Mutex in the future")] impl StaticMutex { /// Creates a new mutex in an unlocked state ready for use. - #[unstable(feature = "std_misc", - reason = "may be merged with Mutex in the future")] pub const fn new() -> StaticMutex { StaticMutex { lock: sys::Mutex::new(), @@ -283,8 +282,6 @@ pub const fn new() -> StaticMutex { /// Acquires this lock, see `Mutex::lock` #[inline] - #[unstable(feature = "std_misc", - reason = "may be merged with Mutex in the future")] pub fn lock(&'static self) -> LockResult> { unsafe { self.lock.lock() } MutexGuard::new(self, &DUMMY.0) @@ -292,8 +289,6 @@ pub fn lock(&'static self) -> LockResult> { /// Attempts to grab this lock, see `Mutex::try_lock` #[inline] - #[unstable(feature = "std_misc", - reason = "may be merged with Mutex in the future")] pub fn try_lock(&'static self) -> TryLockResult> { if unsafe { self.lock.try_lock() } { Ok(try!(MutexGuard::new(self, &DUMMY.0))) @@ -312,8 +307,6 @@ pub fn try_lock(&'static self) -> TryLockResult> { /// *all* platforms. It may be the case that some platforms do not leak /// memory if this method is not called, but this is not guaranteed to be /// true on all platforms. - #[unstable(feature = "std_misc", - reason = "may be merged with Mutex in the future")] pub unsafe fn destroy(&'static self) { self.lock.destroy() } diff --git a/src/libstd/sync/once.rs b/src/libstd/sync/once.rs index 269affff208..1e0aa271b4d 100644 --- a/src/libstd/sync/once.rs +++ b/src/libstd/sync/once.rs @@ -48,7 +48,7 @@ pub struct Once { impl Once { /// Creates a new `Once` value. - #[unstable(feature = "std_misc")] + #[unstable(feature = "once_new")] pub const fn new() -> Once { Once { mutex: StaticMutex::new(), diff --git a/src/libstd/sync/rwlock.rs b/src/libstd/sync/rwlock.rs index 857d8889b7c..5a6bf987fd7 100644 --- a/src/libstd/sync/rwlock.rs +++ b/src/libstd/sync/rwlock.rs @@ -81,7 +81,7 @@ unsafe impl Sync for RwLock {} /// # Examples /// /// ``` -/// # #![feature(std_misc)] +/// # #![feature(static_rwlock)] /// use std::sync::{StaticRwLock, RW_LOCK_INIT}; /// /// static LOCK: StaticRwLock = RW_LOCK_INIT; @@ -96,7 +96,7 @@ unsafe impl Sync for RwLock {} /// } /// unsafe { LOCK.destroy() } // free all resources /// ``` -#[unstable(feature = "std_misc", +#[unstable(feature = "static_rwlock", reason = "may be merged with RwLock in the future")] pub struct StaticRwLock { lock: sys::RWLock, @@ -104,7 +104,7 @@ pub struct StaticRwLock { } /// Constant initialization for a statically-initialized rwlock. -#[unstable(feature = "std_misc", +#[unstable(feature = "static_rwlock", reason = "may be merged with RwLock in the future")] pub const RW_LOCK_INIT: StaticRwLock = StaticRwLock::new(); @@ -253,7 +253,7 @@ pub fn try_write(&self) -> TryLockResult> { /// time. You should not trust a `false` value for program correctness /// without additional synchronization. #[inline] - #[unstable(feature = "std_misc")] + #[unstable(feature = "sync_poison")] pub fn is_poisoned(&self) -> bool { self.inner.poison.get() } @@ -283,10 +283,10 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { unsafe impl Sync for Dummy {} static DUMMY: Dummy = Dummy(UnsafeCell::new(())); +#[unstable(feature = "static_rwlock", + reason = "may be merged with RwLock in the future")] impl StaticRwLock { /// Creates a new rwlock. - #[unstable(feature = "std_misc", - reason = "may be merged with RwLock in the future")] pub const fn new() -> StaticRwLock { StaticRwLock { lock: sys::RWLock::new(), @@ -299,8 +299,6 @@ pub const fn new() -> StaticRwLock { /// /// See `RwLock::read`. #[inline] - #[unstable(feature = "std_misc", - reason = "may be merged with RwLock in the future")] pub fn read(&'static self) -> LockResult> { unsafe { self.lock.read() } RwLockReadGuard::new(self, &DUMMY.0) @@ -310,8 +308,6 @@ pub fn read(&'static self) -> LockResult> { /// /// See `RwLock::try_read`. #[inline] - #[unstable(feature = "std_misc", - reason = "may be merged with RwLock in the future")] pub fn try_read(&'static self) -> TryLockResult> { if unsafe { self.lock.try_read() } { @@ -326,8 +322,6 @@ pub fn try_read(&'static self) /// /// See `RwLock::write`. #[inline] - #[unstable(feature = "std_misc", - reason = "may be merged with RwLock in the future")] pub fn write(&'static self) -> LockResult> { unsafe { self.lock.write() } RwLockWriteGuard::new(self, &DUMMY.0) @@ -337,8 +331,6 @@ pub fn write(&'static self) -> LockResult> { /// /// See `RwLock::try_write`. #[inline] - #[unstable(feature = "std_misc", - reason = "may be merged with RwLock in the future")] pub fn try_write(&'static self) -> TryLockResult> { if unsafe { self.lock.try_write() } { @@ -354,8 +346,6 @@ pub fn try_write(&'static self) /// active users of the lock, and this also doesn't prevent any future users /// of this lock. This method is required to be called to not leak memory on /// all platforms. - #[unstable(feature = "std_misc", - reason = "may be merged with RwLock in the future")] pub unsafe fn destroy(&'static self) { self.lock.destroy() } diff --git a/src/libstd/sync/semaphore.rs b/src/libstd/sync/semaphore.rs index 776b3c5064c..0278a6c95b9 100644 --- a/src/libstd/sync/semaphore.rs +++ b/src/libstd/sync/semaphore.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![unstable(feature = "std_misc", +#![unstable(feature = "semaphore", reason = "the interaction between semaphores and the acquisition/release \ of resources is currently unclear")] diff --git a/src/libstd/sys/common/poison.rs b/src/libstd/sys/common/poison.rs index 48c81982725..75f85879fd1 100644 --- a/src/libstd/sys/common/poison.rs +++ b/src/libstd/sys/common/poison.rs @@ -120,24 +120,24 @@ fn description(&self) -> &str { impl PoisonError { /// Creates a `PoisonError`. - #[unstable(feature = "std_misc")] + #[unstable(feature = "sync_poison")] pub fn new(guard: T) -> PoisonError { PoisonError { guard: guard } } /// Consumes this error indicating that a lock is poisoned, returning the /// underlying guard to allow access regardless. - #[unstable(feature = "std_misc")] + #[unstable(feature = "sync_poison")] pub fn into_inner(self) -> T { self.guard } /// Reaches into this error indicating that a lock is poisoned, returning a /// reference to the underlying guard to allow access regardless. - #[unstable(feature = "std_misc")] + #[unstable(feature = "sync_poison")] pub fn get_ref(&self) -> &T { &self.guard } /// Reaches into this error indicating that a lock is poisoned, returning a /// mutable reference to the underlying guard to allow access regardless. - #[unstable(feature = "std_misc")] + #[unstable(feature = "sync_poi")] pub fn get_mut(&mut self) -> &mut T { &mut self.guard } } diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs index 69a26cdc490..2b5e3fb18eb 100644 --- a/src/libstd/thread/local.rs +++ b/src/libstd/thread/local.rs @@ -154,7 +154,7 @@ fn __getit() -> &'static ::std::thread::__LocalKeyInner<$t> { &__KEY } } /// 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 @@ unsafe fn init(&self, slot: &UnsafeCell>) -> &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 { diff --git a/src/libstd/thunk.rs b/src/libstd/thunk.rs index 6091794ed42..084893314a8 100644 --- a/src/libstd/thunk.rs +++ b/src/libstd/thunk.rs @@ -10,7 +10,7 @@ // Because this module is temporary... #![allow(missing_docs)] -#![unstable(feature = "std_misc")] +#![unstable(feature = "thunk")] use alloc::boxed::{Box, FnBox}; use core::marker::Send; diff --git a/src/libterm/lib.rs b/src/libterm/lib.rs index 3affb37ba5b..5131e0b34e3 100644 --- a/src/libterm/lib.rs +++ b/src/libterm/lib.rs @@ -56,10 +56,10 @@ #![deny(missing_docs)] #![feature(box_syntax)] +#![feature(owned_ascii_ext)] #![feature(path_ext)] #![feature(rustc_private)] #![feature(staged_api)] -#![feature(std_misc)] #![feature(str_char)] #![feature(vec_push_all)] #![cfg_attr(windows, feature(libc))] -- 2.44.0