Skip to content

Commit

Permalink
std: Add issues to all unstable features
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Aug 16, 2015
1 parent 377c11a commit 5f62562
Show file tree
Hide file tree
Showing 41 changed files with 272 additions and 223 deletions.
3 changes: 2 additions & 1 deletion src/libcore/num/dec2flt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@
#![doc(hidden)]
#![unstable(feature = "dec2flt",
reason = "internal routines only exposed for testing")]
reason = "internal routines only exposed for testing",
issue = "0")]

use prelude::v1::*;
use num::ParseFloatError as PFE;
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/ascii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ pub trait AsciiExt {
///
/// assert_eq!('A', ascii);
/// ```
#[unstable(feature = "ascii")]
#[unstable(feature = "ascii", issue = "27809")]
fn make_ascii_uppercase(&mut self);

/// Converts this type to its ASCII lower case equivalent in-place.
Expand All @@ -137,7 +137,7 @@ pub trait AsciiExt {
///
/// assert_eq!('a', ascii);
/// ```
#[unstable(feature = "ascii")]
#[unstable(feature = "ascii", issue = "27809")]
fn make_ascii_lowercase(&mut self);
}

Expand Down
21 changes: 14 additions & 7 deletions src/libstd/collections/hash/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,8 @@ impl<K, V, S> HashMap<K, V, S>
/// map.insert(1, 2);
/// ```
#[inline]
#[unstable(feature = "hashmap_hasher", reason = "hasher stuff is unclear")]
#[unstable(feature = "hashmap_hasher", reason = "hasher stuff is unclear",
issue = "27713")]
pub fn with_hash_state(hash_state: S) -> HashMap<K, V, S> {
HashMap {
hash_state: hash_state,
Expand Down Expand Up @@ -583,7 +584,8 @@ impl<K, V, S> HashMap<K, V, S>
/// map.insert(1, 2);
/// ```
#[inline]
#[unstable(feature = "hashmap_hasher", reason = "hasher stuff is unclear")]
#[unstable(feature = "hashmap_hasher", reason = "hasher stuff is unclear",
issue = "27713")]
pub fn with_capacity_and_hash_state(capacity: usize, hash_state: S)
-> HashMap<K, V, S> {
let resize_policy = DefaultResizePolicy::new();
Expand Down Expand Up @@ -998,7 +1000,8 @@ impl<K, V, S> HashMap<K, V, S>
/// ```
#[inline]
#[unstable(feature = "drain",
reason = "matches collection reform specification, waiting for dust to settle")]
reason = "matches collection reform specification, waiting for dust to settle",
issue = "27711")]
pub fn drain(&mut self) -> Drain<K, V> {
fn last_two<A, B, C>((_, b, c): (A, B, C)) -> (B, C) { (b, c) }
let last_two: fn((SafeHash, K, V)) -> (K, V) = last_two; // coerce to fn pointer
Expand Down Expand Up @@ -1311,7 +1314,8 @@ impl<'a, K, V> Clone for Values<'a, K, V> {

/// HashMap drain iterator.
#[unstable(feature = "drain",
reason = "matches collection reform specification, waiting for dust to settle")]
reason = "matches collection reform specification, waiting for dust to settle",
issue = "27711")]
pub struct Drain<'a, K: 'a, V: 'a> {
inner: iter::Map<table::Drain<'a, K, V>, fn((SafeHash, K, V)) -> (K, V)>
}
Expand Down Expand Up @@ -1587,14 +1591,16 @@ impl<K, V, S> Extend<(K, V)> for HashMap<K, V, S>
/// instances are unlikely to produce the same result for the same values.
#[derive(Clone)]
#[unstable(feature = "hashmap_hasher",
reason = "hashing an hash maps may be altered")]
reason = "hashing an hash maps may be altered",
issue = "27713")]
pub struct RandomState {
k0: u64,
k1: u64,
}

#[unstable(feature = "hashmap_hasher",
reason = "hashing an hash maps may be altered")]
reason = "hashing an hash maps may be altered",
issue = "27713")]
impl RandomState {
/// Constructs a new `RandomState` that is initialized with random keys.
#[inline]
Expand All @@ -1606,7 +1612,8 @@ impl RandomState {
}

#[unstable(feature = "hashmap_hasher",
reason = "hashing an hash maps may be altered")]
reason = "hashing an hash maps may be altered",
issue = "27713")]
impl HashState for RandomState {
type Hasher = SipHasher;
#[inline]
Expand Down
9 changes: 6 additions & 3 deletions src/libstd/collections/hash/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ impl<T, S> HashSet<T, S>
/// set.insert(2);
/// ```
#[inline]
#[unstable(feature = "hashmap_hasher", reason = "hasher stuff is unclear")]
#[unstable(feature = "hashmap_hasher", reason = "hasher stuff is unclear",
issue = "27713")]
pub fn with_hash_state(hash_state: S) -> HashSet<T, S> {
HashSet::with_capacity_and_hash_state(INITIAL_CAPACITY, hash_state)
}
Expand All @@ -190,7 +191,8 @@ impl<T, S> HashSet<T, S>
/// set.insert(1);
/// ```
#[inline]
#[unstable(feature = "hashmap_hasher", reason = "hasher stuff is unclear")]
#[unstable(feature = "hashmap_hasher", reason = "hasher stuff is unclear",
issue = "27713")]
pub fn with_capacity_and_hash_state(capacity: usize, hash_state: S)
-> HashSet<T, S> {
HashSet {
Expand Down Expand Up @@ -411,7 +413,8 @@ impl<T, S> HashSet<T, S>
/// Clears the set, returning all elements in an iterator.
#[inline]
#[unstable(feature = "drain",
reason = "matches collection reform specification, waiting for dust to settle")]
reason = "matches collection reform specification, waiting for dust to settle",
issue = "27711")]
pub fn drain(&mut self) -> Drain<T> {
fn first<A, B>((a, _): (A, B)) -> A { a }
let first: fn((T, ())) -> T = first; // coerce to fn pointer
Expand Down
3 changes: 2 additions & 1 deletion src/libstd/collections/hash/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +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")]
#![unstable(feature = "hashmap_hasher", reason = "hasher stuff is unclear",
issue = "27713")]

use clone::Clone;
use default::Default;
Expand Down
3 changes: 2 additions & 1 deletion src/libstd/collections/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,8 @@ pub mod hash_set {

/// Experimental support for providing custom hash algorithms to a HashMap and
/// HashSet.
#[unstable(feature = "hashmap_hasher", reason = "module was recently added")]
#[unstable(feature = "hashmap_hasher", reason = "module was recently added",
issue = "27713")]
pub mod hash_state {
pub use super::hash::state::*;
}
3 changes: 2 additions & 1 deletion src/libstd/dynamic_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
#![unstable(feature = "dynamic_lib",
reason = "API has not been scrutinized and is highly likely to \
either disappear or change")]
either disappear or change",
issue = "27810")]
#![allow(missing_docs)]

use prelude::v1::*;
Expand Down
3 changes: 2 additions & 1 deletion src/libstd/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ pub trait Error: Debug + Display + Reflect {
/// Get the `TypeId` of `self`
#[doc(hidden)]
#[unstable(feature = "error_type_id",
reason = "unclear whether to commit to this public implementation detail")]
reason = "unclear whether to commit to this public implementation detail",
issue = "27745")]
fn type_id(&self) -> TypeId where Self: 'static {
TypeId::of::<Self>()
}
Expand Down
19 changes: 12 additions & 7 deletions src/libstd/ffi/c_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ impl CString {
/// The only appropriate argument is a pointer obtained by calling
/// `into_ptr`. The length of the string will be recalculated
/// using the pointer.
#[unstable(feature = "cstr_memory", reason = "recently added")]
#[unstable(feature = "cstr_memory", reason = "recently added",
issue = "27769")]
// NB: may want to be called from_raw, needs to consider CStr::from_ptr,
// Box::from_raw (or whatever it's currently called), and
// slice::from_raw_parts
Expand All @@ -223,7 +224,8 @@ impl CString {
/// this string.
///
/// Failure to call `from_ptr` will lead to a memory leak.
#[unstable(feature = "cstr_memory", reason = "recently added")]
#[unstable(feature = "cstr_memory", reason = "recently added",
issue = "27769")]
// NB: may want to be called into_raw, see comments on from_ptr
pub fn into_ptr(self) -> *const libc::c_char {
// It is important that the bytes be sized to fit - we need
Expand Down Expand Up @@ -407,11 +409,13 @@ impl CStr {
/// > after a 0-cost cast, but it is planned to alter its definition in the
/// > future to perform the length calculation in addition to the UTF-8
/// > check whenever this method is called.
#[unstable(feature = "cstr_to_str", reason = "recently added")]
#[unstable(feature = "cstr_to_str", reason = "recently added",
issue = "27764")]
pub fn to_str(&self) -> Result<&str, str::Utf8Error> {
// NB: When CStr is changed to perform the length check in .to_bytes() instead of in
// from_ptr(), it may be worth considering if this should be rewritten to do the UTF-8
// check inline with the length calculation instead of doing it afterwards.
// NB: When CStr is changed to perform the length check in .to_bytes()
// instead of in from_ptr(), it may be worth considering if this should
// be rewritten to do the UTF-8 check inline with the length calculation
// instead of doing it afterwards.
str::from_utf8(self.to_bytes())
}

Expand All @@ -426,7 +430,8 @@ impl CStr {
/// > after a 0-cost cast, but it is planned to alter its definition in the
/// > future to perform the length calculation in addition to the UTF-8
/// > check whenever this method is called.
#[unstable(feature = "cstr_to_str", reason = "recently added")]
#[unstable(feature = "cstr_to_str", reason = "recently added",
issue = "27764")]
pub fn to_string_lossy(&self) -> Cow<str> {
String::from_utf8_lossy(self.to_bytes())
}
Expand Down
9 changes: 3 additions & 6 deletions src/libstd/ffi/os_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
//! for conversion to/from various other string types. Eventually these types
//! will offer a full-fledged string API.
#![unstable(feature = "os_str",
reason = "recently added as part of path/io reform")]

use borrow::{Borrow, Cow, ToOwned};
use ffi::CString;
use fmt::{self, Debug};
Expand Down Expand Up @@ -74,7 +71,7 @@ impl OsString {
///
/// On Windows system, only UTF-8 byte sequences will successfully
/// convert; non UTF-8 data will produce `None`.
#[unstable(feature = "convert", reason = "recently added")]
#[unstable(feature = "convert", reason = "recently added", issue = "27704")]
pub fn from_bytes<B>(bytes: B) -> Option<OsString> where B: Into<Vec<u8>> {
#[cfg(unix)]
fn from_bytes_inner(vec: Vec<u8>) -> Option<OsString> {
Expand Down Expand Up @@ -258,7 +255,7 @@ impl OsStr {
/// On Windows systems, this returns `None` unless the `OsStr` is
/// valid unicode, in which case it produces UTF-8-encoded
/// data. This may entail checking validity.
#[unstable(feature = "convert", reason = "recently added")]
#[unstable(feature = "convert", reason = "recently added", issue = "27704")]
pub fn to_bytes(&self) -> Option<&[u8]> {
if cfg!(windows) {
self.to_str().map(|s| s.as_bytes())
Expand All @@ -274,7 +271,7 @@ impl OsStr {
/// This is a convenience for creating a `CString` from
/// `self.to_bytes()`, and inherits the platform behavior of the
/// `to_bytes` method.
#[unstable(feature = "convert", reason = "recently added")]
#[unstable(feature = "convert", reason = "recently added", issue = "27704")]
pub fn to_cstring(&self) -> Option<CString> {
self.to_bytes().and_then(|b| CString::new(b).ok())
}
Expand Down
20 changes: 13 additions & 7 deletions src/libstd/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ pub struct DirEntry(fs_imp::DirEntry);
#[unstable(feature = "fs_walk",
reason = "the precise semantics and defaults for a recursive walk \
may change and this may end up accounting for files such \
as symlinks differently")]
as symlinks differently",
issue = "27707")]
pub struct WalkDir {
cur: Option<ReadDir>,
stack: Vec<io::Result<ReadDir>>,
Expand Down Expand Up @@ -154,7 +155,8 @@ pub struct FileType(fs_imp::FileType);
/// A builder used to create directories in various manners.
///
/// This builder also supports platform-specific options.
#[unstable(feature = "dir_builder", reason = "recently added API")]
#[unstable(feature = "dir_builder", reason = "recently added API",
issue = "27710")]
pub struct DirBuilder {
inner: fs_imp::DirBuilder,
recursive: bool,
Expand Down Expand Up @@ -949,7 +951,8 @@ pub fn read_link<P: AsRef<Path>>(path: P) -> io::Result<PathBuf> {

/// Returns the canonical form of a path with all intermediate components
/// normalized and symbolic links resolved.
#[unstable(feature = "fs_canonicalize", reason = "recently added API")]
#[unstable(feature = "fs_canonicalize", reason = "recently added API",
issue = "27706")]
pub fn canonicalize<P: AsRef<Path>>(path: P) -> io::Result<PathBuf> {
fs_imp::canonicalize(path.as_ref())
}
Expand Down Expand Up @@ -1107,13 +1110,14 @@ pub fn read_dir<P: AsRef<Path>>(path: P) -> io::Result<ReadDir> {
#[unstable(feature = "fs_walk",
reason = "the precise semantics and defaults for a recursive walk \
may change and this may end up accounting for files such \
as symlinks differently")]
as symlinks differently",
issue = "27707")]
pub fn walk_dir<P: AsRef<Path>>(path: P) -> io::Result<WalkDir> {
let start = try!(read_dir(path));
Ok(WalkDir { cur: Some(start), stack: Vec::new() })
}

#[unstable(feature = "fs_walk")]
#[unstable(feature = "fs_walk", issue = "27707")]
impl Iterator for WalkDir {
type Item = io::Result<DirEntry>;

Expand Down Expand Up @@ -1146,7 +1150,8 @@ impl Iterator for WalkDir {
#[unstable(feature = "path_ext",
reason = "The precise set of methods exposed on this trait may \
change and some methods may be removed. For stable code, \
see the std::fs::metadata function.")]
see the std::fs::metadata function.",
issue = "27725")]
pub trait PathExt {
/// Gets information on the file, directory, etc at this path.
///
Expand Down Expand Up @@ -1242,7 +1247,8 @@ pub fn set_permissions<P: AsRef<Path>>(path: P, perm: Permissions)
fs_imp::set_perm(path.as_ref(), perm.0)
}

#[unstable(feature = "dir_builder", reason = "recently added API")]
#[unstable(feature = "dir_builder", reason = "recently added API",
issue = "27710")]
impl DirBuilder {
/// Creates a new set of options with default mode/security settings for all
/// platforms and also non-recursive.
Expand Down
3 changes: 2 additions & 1 deletion src/libstd/io/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ pub enum ErrorKind {
/// Any I/O error not part of this list.
#[unstable(feature = "io_error_internals",
reason = "better expressed through extensible enums that this \
enum cannot be exhaustively matched against")]
enum cannot be exhaustively matched against",
issue = "0")]
#[doc(hidden)]
__Nonexhaustive,
}
Expand Down
Loading

0 comments on commit 5f62562

Please sign in to comment.