Skip to content

Commit

Permalink
core: Fill out issues for unstable features
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Aug 16, 2015
1 parent 6634777 commit b7dcf27
Show file tree
Hide file tree
Showing 29 changed files with 174 additions and 101 deletions.
3 changes: 2 additions & 1 deletion src/libcore/any.rs
Expand Up @@ -91,7 +91,8 @@ use marker::{Reflect, Sized};
pub trait Any: Reflect + 'static {
/// Gets the `TypeId` of `self`.
#[unstable(feature = "get_type_id",
reason = "this method will likely be replaced by an associated static")]
reason = "this method will likely be replaced by an associated static",
issue = "27745")]
fn get_type_id(&self) -> TypeId;
}

Expand Down
3 changes: 2 additions & 1 deletion src/libcore/array.rs
Expand Up @@ -16,7 +16,8 @@

#![unstable(feature = "fixed_size_array",
reason = "traits and impls are better expressed through generic \
integer constants")]
integer constants",
issue = "27778")]

use clone::Clone;
use cmp::{PartialEq, Eq, PartialOrd, Ord, Ordering};
Expand Down
23 changes: 14 additions & 9 deletions src/libcore/cell.rs
Expand Up @@ -230,7 +230,7 @@ impl<T:Copy> Cell<T> {
/// let uc = unsafe { c.as_unsafe_cell() };
/// ```
#[inline]
#[unstable(feature = "as_unsafe_cell")]
#[unstable(feature = "as_unsafe_cell", issue = "27708")]
pub unsafe fn as_unsafe_cell<'a>(&'a self) -> &'a UnsafeCell<T> {
&self.value
}
Expand Down Expand Up @@ -278,7 +278,7 @@ pub struct RefCell<T: ?Sized> {

/// An enumeration of values returned from the `state` method on a `RefCell<T>`.
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
#[unstable(feature = "borrow_state")]
#[unstable(feature = "borrow_state", issue = "27733")]
pub enum BorrowState {
/// The cell is currently being read, there is at least one active `borrow`.
Reading,
Expand Down Expand Up @@ -340,7 +340,7 @@ impl<T: ?Sized> RefCell<T> {
///
/// The returned value can be dispatched on to determine if a call to
/// `borrow` or `borrow_mut` would succeed.
#[unstable(feature = "borrow_state")]
#[unstable(feature = "borrow_state", issue = "27733")]
#[inline]
pub fn borrow_state(&self) -> BorrowState {
match self.borrow.get() {
Expand Down Expand Up @@ -449,7 +449,7 @@ impl<T: ?Sized> RefCell<T> {
///
/// This function is `unsafe` because `UnsafeCell`'s field is public.
#[inline]
#[unstable(feature = "as_unsafe_cell")]
#[unstable(feature = "as_unsafe_cell", issue = "27708")]
pub unsafe fn as_unsafe_cell<'a>(&'a self) -> &'a UnsafeCell<T> {
&self.value
}
Expand Down Expand Up @@ -556,7 +556,8 @@ impl<'b, T: ?Sized> Ref<'b, T> {
/// with the widespread use of `r.borrow().clone()` to clone the contents of
/// a `RefCell`.
#[unstable(feature = "cell_extras",
reason = "likely to be moved to a method, pending language changes")]
reason = "likely to be moved to a method, pending language changes",
issue = "27746")]
#[inline]
pub fn clone(orig: &Ref<'b, T>) -> Ref<'b, T> {
Ref {
Expand Down Expand Up @@ -585,7 +586,8 @@ impl<'b, T: ?Sized> Ref<'b, T> {
/// let b2: Ref<u32> = Ref::map(b1, |t| &t.0);
/// assert_eq!(*b2, 5)
/// ```
#[unstable(feature = "cell_extras", reason = "recently added")]
#[unstable(feature = "cell_extras", reason = "recently added",
issue = "27746")]
#[inline]
pub fn map<U: ?Sized, F>(orig: Ref<'b, T>, f: F) -> Ref<'b, U>
where F: FnOnce(&T) -> &U
Expand Down Expand Up @@ -616,7 +618,8 @@ impl<'b, T: ?Sized> Ref<'b, T> {
/// let b2: Ref<u32> = Ref::filter_map(b1, |o| o.as_ref().ok()).unwrap();
/// assert_eq!(*b2, 5)
/// ```
#[unstable(feature = "cell_extras", reason = "recently added")]
#[unstable(feature = "cell_extras", reason = "recently added",
issue = "27746")]
#[inline]
pub fn filter_map<U: ?Sized, F>(orig: Ref<'b, T>, f: F) -> Option<Ref<'b, U>>
where F: FnOnce(&T) -> Option<&U>
Expand Down Expand Up @@ -653,7 +656,8 @@ impl<'b, T: ?Sized> RefMut<'b, T> {
/// }
/// assert_eq!(*c.borrow(), (42, 'b'));
/// ```
#[unstable(feature = "cell_extras", reason = "recently added")]
#[unstable(feature = "cell_extras", reason = "recently added",
issue = "27746")]
#[inline]
pub fn map<U: ?Sized, F>(orig: RefMut<'b, T>, f: F) -> RefMut<'b, U>
where F: FnOnce(&mut T) -> &mut U
Expand Down Expand Up @@ -690,7 +694,8 @@ impl<'b, T: ?Sized> RefMut<'b, T> {
/// }
/// assert_eq!(*c.borrow(), Ok(42));
/// ```
#[unstable(feature = "cell_extras", reason = "recently added")]
#[unstable(feature = "cell_extras", reason = "recently added",
issue = "27746")]
#[inline]
pub fn filter_map<U: ?Sized, F>(orig: RefMut<'b, T>, f: F) -> Option<RefMut<'b, U>>
where F: FnOnce(&mut T) -> Option<&mut U>
Expand Down
12 changes: 8 additions & 4 deletions src/libcore/char.rs
Expand Up @@ -91,7 +91,8 @@ pub fn from_u32(i: u32) -> Option<char> {
/// Converts a `u32` to an `char`, not checking whether it is a valid unicode
/// codepoint.
#[inline]
#[unstable(feature = "char_from_unchecked", reason = "recently added API")]
#[unstable(feature = "char_from_unchecked", reason = "recently added API",
issue = "27781")]
pub unsafe fn from_u32_unchecked(i: u32) -> char {
transmute(i)
}
Expand Down Expand Up @@ -139,7 +140,8 @@ pub fn from_digit(num: u32, radix: u32) -> Option<char> {
#[allow(missing_docs)] // docs in libunicode/u_char.rs
#[doc(hidden)]
#[unstable(feature = "core_char_ext",
reason = "the stable interface is `impl char` in later crate")]
reason = "the stable interface is `impl char` in later crate",
issue = "27701")]
pub trait CharExt {
fn is_digit(self, radix: u32) -> bool;
fn to_digit(self, radix: u32) -> Option<u32>;
Expand Down Expand Up @@ -230,7 +232,8 @@ impl CharExt for char {
/// and a `None` will be returned.
#[inline]
#[unstable(feature = "char_internals",
reason = "this function should not be exposed publicly")]
reason = "this function should not be exposed publicly",
issue = "0")]
#[doc(hidden)]
pub fn encode_utf8_raw(code: u32, dst: &mut [u8]) -> Option<usize> {
// Marked #[inline] to allow llvm optimizing it away
Expand Down Expand Up @@ -264,7 +267,8 @@ pub fn encode_utf8_raw(code: u32, dst: &mut [u8]) -> Option<usize> {
/// and a `None` will be returned.
#[inline]
#[unstable(feature = "char_internals",
reason = "this function should not be exposed publicly")]
reason = "this function should not be exposed publicly",
issue = "0")]
#[doc(hidden)]
pub fn encode_utf16_raw(mut ch: u32, dst: &mut [u16]) -> Option<usize> {
// Marked #[inline] to allow llvm optimizing it away
Expand Down
3 changes: 2 additions & 1 deletion src/libcore/fmt/builders.rs
Expand Up @@ -177,7 +177,8 @@ impl<'a, 'b: 'a> DebugTuple<'a, 'b> {
}

/// Returns the wrapped `Formatter`.
#[unstable(feature = "debug_builder_formatter", reason = "recently added")]
#[unstable(feature = "debug_builder_formatter", reason = "recently added",
issue = "27782")]
pub fn formatter(&mut self) -> &mut fmt::Formatter<'b> {
&mut self.fmt
}
Expand Down
30 changes: 20 additions & 10 deletions src/libcore/fmt/mod.rs
Expand Up @@ -33,7 +33,8 @@ pub use self::builders::{DebugStruct, DebugTuple, DebugSet, DebugList, DebugMap}
mod num;
mod builders;

#[unstable(feature = "fmt_internals", reason = "internal to format_args!")]
#[unstable(feature = "fmt_internals", reason = "internal to format_args!",
issue = "0")]
#[doc(hidden)]
pub mod rt {
pub mod v1;
Expand Down Expand Up @@ -146,7 +147,8 @@ enum Void {}
/// compile time it is ensured that the function and the value have the correct
/// types, and then this struct is used to canonicalize arguments to one type.
#[derive(Copy)]
#[unstable(feature = "fmt_internals", reason = "internal to format_args!")]
#[unstable(feature = "fmt_internals", reason = "internal to format_args!",
issue = "0")]
#[doc(hidden)]
pub struct ArgumentV1<'a> {
value: &'a Void,
Expand All @@ -166,7 +168,8 @@ impl<'a> ArgumentV1<'a> {
}

#[doc(hidden)]
#[unstable(feature = "fmt_internals", reason = "internal to format_args!")]
#[unstable(feature = "fmt_internals", reason = "internal to format_args!",
issue = "0")]
pub fn new<'b, T>(x: &'b T,
f: fn(&T, &mut Formatter) -> Result) -> ArgumentV1<'b> {
unsafe {
Expand All @@ -178,7 +181,8 @@ impl<'a> ArgumentV1<'a> {
}

#[doc(hidden)]
#[unstable(feature = "fmt_internals", reason = "internal to format_args!")]
#[unstable(feature = "fmt_internals", reason = "internal to format_args!",
issue = "0")]
pub fn from_usize(x: &usize) -> ArgumentV1 {
ArgumentV1::new(x, ArgumentV1::show_usize)
}
Expand All @@ -201,7 +205,8 @@ impl<'a> Arguments<'a> {
/// When using the format_args!() macro, this function is used to generate the
/// Arguments structure.
#[doc(hidden)] #[inline]
#[unstable(feature = "fmt_internals", reason = "internal to format_args!")]
#[unstable(feature = "fmt_internals", reason = "internal to format_args!",
issue = "0")]
pub fn new_v1(pieces: &'a [&'a str],
args: &'a [ArgumentV1<'a>]) -> Arguments<'a> {
Arguments {
Expand All @@ -218,7 +223,8 @@ impl<'a> Arguments<'a> {
/// created with `argumentusize`. However, failing to do so doesn't cause
/// unsafety, but will ignore invalid .
#[doc(hidden)] #[inline]
#[unstable(feature = "fmt_internals", reason = "internal to format_args!")]
#[unstable(feature = "fmt_internals", reason = "internal to format_args!",
issue = "0")]
pub fn new_v1_formatted(pieces: &'a [&'a str],
args: &'a [ArgumentV1<'a>],
fmt: &'a [rt::v1::Argument]) -> Arguments<'a> {
Expand Down Expand Up @@ -1077,19 +1083,23 @@ impl<'a> Formatter<'a> {
pub fn flags(&self) -> u32 { self.flags }

/// Character used as 'fill' whenever there is alignment
#[unstable(feature = "fmt_flags", reason = "method was just created")]
#[unstable(feature = "fmt_flags", reason = "method was just created",
issue = "27726")]
pub fn fill(&self) -> char { self.fill }

/// Flag indicating what form of alignment was requested
#[unstable(feature = "fmt_flags", reason = "method was just created")]
#[unstable(feature = "fmt_flags", reason = "method was just created",
issue = "27726")]
pub fn align(&self) -> Alignment { self.align }

/// Optionally specified integer width that the output should be
#[unstable(feature = "fmt_flags", reason = "method was just created")]
#[unstable(feature = "fmt_flags", reason = "method was just created",
issue = "27726")]
pub fn width(&self) -> Option<usize> { self.width }

/// Optionally specified precision for numeric types
#[unstable(feature = "fmt_flags", reason = "method was just created")]
#[unstable(feature = "fmt_flags", reason = "method was just created",
issue = "27726")]
pub fn precision(&self) -> Option<usize> { self.precision }

/// Creates a `DebugStruct` builder designed to assist with creation of
Expand Down
9 changes: 6 additions & 3 deletions src/libcore/fmt/num.rs
Expand Up @@ -133,7 +133,8 @@ radix! { UpperHex, 16, "0x", x @ 0 ... 9 => b'0' + x,
/// A radix with in the range of `2..36`.
#[derive(Clone, Copy, PartialEq)]
#[unstable(feature = "fmt_radix",
reason = "may be renamed or move to a different module")]
reason = "may be renamed or move to a different module",
issue = "27728")]
pub struct Radix {
base: u8,
}
Expand All @@ -158,7 +159,8 @@ impl GenericRadix for Radix {

/// A helper type for formatting radixes.
#[unstable(feature = "fmt_radix",
reason = "may be renamed or move to a different module")]
reason = "may be renamed or move to a different module",
issue = "27728")]
#[derive(Copy, Clone)]
pub struct RadixFmt<T, R>(T, R);

Expand All @@ -173,7 +175,8 @@ pub struct RadixFmt<T, R>(T, R);
/// assert_eq!(format!("{}", radix(55, 36)), "1j".to_string());
/// ```
#[unstable(feature = "fmt_radix",
reason = "may be renamed or move to a different module")]
reason = "may be renamed or move to a different module",
issue = "27728")]
pub fn radix<T>(x: T, base: u8) -> RadixFmt<T, Radix> {
RadixFmt(x, Radix::new(base))
}
Expand Down
3 changes: 2 additions & 1 deletion src/libcore/intrinsics.rs
Expand Up @@ -42,7 +42,8 @@
#![unstable(feature = "core_intrinsics",
reason = "intrinsics are unlikely to ever be stabilized, instead \
they should be used through stabilized interfaces \
in the rest of the standard library")]
in the rest of the standard library",
issue = "0")]
#![allow(missing_docs)]

use marker::Sized;
Expand Down

0 comments on commit b7dcf27

Please sign in to comment.