//! A pointer type for heap allocation.
//!
-//! `Box<T>`, casually referred to as a 'box', provides the simplest form of heap allocation in
-//! Rust. Boxes provide ownership for this allocation, and drop their contents when they go out of
-//! scope.
+//! `Box<T>`, casually referred to as a 'box', provides the simplest form of
+//! heap allocation in Rust. Boxes provide ownership for this allocation, and
+//! drop their contents when they go out of scope.
//!
//! # Examples
//!
//!
//! This will print `Cons(1, Cons(2, Nil))`.
//!
-//! Recursive structures must be boxed, because if the definition of `Cons` looked like this:
+//! Recursive structures must be boxed, because if the definition of `Cons`
+//! looked like this:
//!
//! ```rust,ignore
//! Cons(T, List<T>),
//! ```
//!
-//! It wouldn't work. This is because the size of a `List` depends on how many elements are in the
-//! list, and so we don't know how much memory to allocate for a `Cons`. By introducing a `Box`,
-//! which has a defined size, we know how big `Cons` needs to be.
+//! It wouldn't work. This is because the size of a `List` depends on how many
+//! elements are in the list, and so we don't know how much memory to allocate
+//! for a `Cons`. By introducing a `Box`, which has a defined size, we know how
+//! big `Cons` needs to be.
#![stable(feature = "rust1", since = "1.0.0")]
/// }
/// ```
#[rustc_paren_sugar]
-#[unstable(feature = "core", reason = "Newly introduced")]
+#[unstable(feature = "fnbox", reason = "Newly introduced")]
pub trait FnBox<A> {
type Output;
#![cfg_attr(stage0, feature(custom_attribute))]
#![crate_name = "alloc"]
#![unstable(feature = "alloc")]
-#![feature(staged_api)]
#![staged_api]
#![crate_type = "rlib"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
- html_root_url = "http://doc.rust-lang.org/nightly/")]
-#![doc(test(no_crate_inject))]
-
-#![feature(no_std)]
+ html_root_url = "http://doc.rust-lang.org/nightly/",
+ test(no_crate_inject))]
#![no_std]
+
#![feature(allocator)]
+#![feature(box_syntax)]
+#![feature(coerce_unsized)]
+#![feature(core)]
+#![feature(core_intrinsics)]
+#![feature(core_prelude)]
#![feature(custom_attribute)]
#![feature(fundamental)]
#![feature(lang_items)]
-#![feature(box_syntax)]
+#![feature(no_std)]
+#![feature(nonzero)]
#![feature(optin_builtin_traits)]
+#![feature(raw)]
+#![feature(staged_api)]
#![feature(unboxed_closures)]
-#![feature(unsafe_no_drop_flag, filling_drop)]
-#![feature(core)]
#![feature(unique)]
+#![feature(unsafe_no_drop_flag, filling_drop)]
+#![feature(unsize)]
#![cfg_attr(test, feature(test, alloc, rustc_private))]
#![cfg_attr(all(not(feature = "external_funcs"), not(feature = "external_crate")),
feature(libc))]
#![feature(alloc)]
#![feature(box_syntax)]
-#![feature(core)]
+#![feature(core_intrinsics)]
+#![feature(ptr_as_ref)]
+#![feature(raw)]
#![feature(staged_api)]
#![feature(unboxed_closures)]
#![cfg_attr(test, feature(test))]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
html_root_url = "http://doc.rust-lang.org/nightly/",
- html_playground_url = "http://play.rust-lang.org/")]
-#![doc(test(no_crate_inject))]
+ html_playground_url = "http://play.rust-lang.org/",
+ test(no_crate_inject))]
#![allow(trivial_casts)]
+#![cfg_attr(test, allow(deprecated))] // rand
+
#![feature(alloc)]
-#![feature(box_syntax)]
#![feature(box_patterns)]
+#![feature(box_syntax)]
+#![feature(copy_lifetime)]
#![feature(core)]
+#![feature(core_intrinsics)]
+#![feature(core_prelude)]
+#![feature(core_slice_ext)]
+#![feature(core_str_ext)]
+#![feature(iter_cmp)]
+#![feature(iter_idx)]
+#![feature(iter_order)]
+#![feature(iter_product)]
+#![feature(iter_sum)]
#![feature(lang_items)]
+#![feature(num_bits_bytes)]
+#![feature(pattern)]
+#![feature(ptr_as_ref)]
+#![feature(raw)]
+#![feature(slice_patterns)]
#![feature(staged_api)]
+#![feature(step_by)]
+#![feature(str_char)]
+#![feature(str_internals)]
#![feature(unboxed_closures)]
#![feature(unicode)]
#![feature(unique)]
#![feature(unsafe_no_drop_flag, filling_drop)]
-#![feature(step_by)]
-#![feature(str_char)]
-#![feature(slice_patterns)]
#![feature(utf8_error)]
#![cfg_attr(test, feature(rand, test))]
-#![cfg_attr(test, allow(deprecated))] // rand
#![cfg_attr(not(test), feature(str_words))]
#![feature(no_std)]
#[stable(feature = "rust1", since = "1.0.0")]
pub trait Any: Reflect + 'static {
/// Gets the `TypeId` of `self`.
- #[unstable(feature = "core",
+ #[unstable(feature = "get_type_id",
reason = "this method will likely be replaced by an associated static")]
fn get_type_id(&self) -> TypeId;
}
//! up to a certain length. Eventually we should able to generalize
//! to all lengths.
-#![unstable(feature = "core")] // not yet reviewed
-
#![doc(primitive = "array")]
+#![unstable(feature = "fixed_size_array",
+ reason = "traits and impls are better expressed through generic \
+ integer constants")]
use clone::Clone;
use cmp::{PartialEq, Eq, PartialOrd, Ord, Ordering};
///
/// This trait can be used to implement other traits on fixed-size arrays
/// without causing much metadata bloat.
-#[unstable(feature = "core")]
pub trait FixedSizeArray<T> {
/// Converts the array to immutable slice
fn as_slice(&self) -> &[T];
macro_rules! array_impls {
($($N:expr)+) => {
$(
- #[unstable(feature = "core")]
impl<T> FixedSizeArray<T> for [T; $N] {
#[inline]
fn as_slice(&self) -> &[T] {
}
}
- #[unstable(feature = "array_as_ref",
- reason = "should ideally be implemented for all fixed-sized arrays")]
impl<T> AsRef<[T]> for [T; $N] {
#[inline]
fn as_ref(&self) -> &[T] {
}
}
- #[unstable(feature = "array_as_ref",
- reason = "should ideally be implemented for all fixed-sized arrays")]
impl<T> AsMut<[T]> for [T; $N] {
#[inline]
fn as_mut(&mut self) -> &mut [T] {
/// let uc = unsafe { c.as_unsafe_cell() };
/// ```
#[inline]
- #[unstable(feature = "core")]
+ #[unstable(feature = "as_unsafe_cell")]
pub unsafe fn as_unsafe_cell<'a>(&'a self) -> &'a UnsafeCell<T> {
&self.value
}
/// An enumeration of values returned from the `state` method on a `RefCell<T>`.
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
-#[unstable(feature = "std_misc")]
+#[unstable(feature = "borrow_state")]
pub enum BorrowState {
/// The cell is currently being read, there is at least one active `borrow`.
Reading,
///
/// The returned value can be dispatched on to determine if a call to
/// `borrow` or `borrow_mut` would succeed.
- #[unstable(feature = "std_misc")]
+ #[unstable(feature = "borrow_state")]
#[inline]
pub fn borrow_state(&self) -> BorrowState {
match self.borrow.get() {
///
/// This function is `unsafe` because `UnsafeCell`'s field is public.
#[inline]
- #[unstable(feature = "core")]
+ #[unstable(feature = "as_unsafe_cell")]
pub unsafe fn as_unsafe_cell<'a>(&'a self) -> &'a UnsafeCell<T> {
&self.value
}
///
/// The `RefCell` is already immutably borrowed, so this cannot fail.
///
- /// This is an associated function that needs to be used as `Ref::clone(...)`.
- /// A `Clone` implementation or a method would interfere with the widespread
- /// use of `r.borrow().clone()` to clone the contents of a `RefCell`.
+ /// This is an associated function that needs to be used as
+ /// `Ref::clone(...)`. A `Clone` implementation or a method would interfere
+ /// 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")]
#[inline]
/// The `RefCell` is already immutably borrowed, so this cannot fail.
///
/// This is an associated function that needs to be used as `Ref::map(...)`.
- /// A method would interfere with methods of the same name on the contents of a `RefCell`
- /// used through `Deref`.
+ /// A method would interfere with methods of the same name on the contents
+ /// of a `RefCell` used through `Deref`.
///
/// # Example
///
}
}
- /// Make a new `Ref` for a optional component of the borrowed data, e.g. an enum variant.
+ /// Make a new `Ref` for a optional component of the borrowed data, e.g. an
+ /// enum variant.
///
/// The `RefCell` is already immutably borrowed, so this cannot fail.
///
- /// This is an associated function that needs to be used as `Ref::filter_map(...)`.
- /// A method would interfere with methods of the same name on the contents of a `RefCell`
- /// used through `Deref`.
+ /// This is an associated function that needs to be used as
+ /// `Ref::filter_map(...)`. A method would interfere with methods of the
+ /// same name on the contents of a `RefCell` used through `Deref`.
///
/// # Example
///
}
impl<'b, T: ?Sized> RefMut<'b, T> {
- /// Make a new `RefMut` for a component of the borrowed data, e.g. an enum variant.
+ /// Make a new `RefMut` for a component of the borrowed data, e.g. an enum
+ /// variant.
///
/// The `RefCell` is already mutably borrowed, so this cannot fail.
///
- /// This is an associated function that needs to be used as `RefMut::map(...)`.
- /// A method would interfere with methods of the same name on the contents of a `RefCell`
- /// used through `Deref`.
+ /// This is an associated function that needs to be used as
+ /// `RefMut::map(...)`. A method would interfere with methods of the same
+ /// name on the contents of a `RefCell` used through `Deref`.
///
/// # Example
///
}
}
- /// Make a new `RefMut` for a optional component of the borrowed data, e.g. an enum variant.
+ /// Make a new `RefMut` for a optional component of the borrowed data, e.g.
+ /// an enum variant.
///
/// The `RefCell` is already mutably borrowed, so this cannot fail.
///
- /// This is an associated function that needs to be used as `RefMut::filter_map(...)`.
- /// A method would interfere with methods of the same name on the contents of a `RefCell`
- /// used through `Deref`.
+ /// This is an associated function that needs to be used as
+ /// `RefMut::filter_map(...)`. A method would interfere with methods of the
+ /// same name on the contents of a `RefCell` used through `Deref`.
///
/// # Example
///
/// let c = RefCell::new(Ok(5));
/// {
/// let b1: RefMut<Result<u32, ()>> = c.borrow_mut();
- /// let mut b2: RefMut<u32> = RefMut::filter_map(b1, |o| o.as_mut().ok()).unwrap();
+ /// let mut b2: RefMut<u32> = RefMut::filter_map(b1, |o| {
+ /// o.as_mut().ok()
+ /// }).unwrap();
/// assert_eq!(*b2, 5);
/// *b2 = 42;
/// }
#![allow(non_snake_case)]
#![doc(primitive = "char")]
+#![stable(feature = "rust1", since = "1.0.0")]
use iter::Iterator;
use mem::transmute;
// unicode/char.rs, not here
#[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")]
pub trait CharExt {
fn is_digit(self, radix: u32) -> bool;
fn to_digit(self, radix: u32) -> Option<u32>;
/// If the buffer is not large enough, nothing will be written into it
/// and a `None` will be returned.
#[inline]
+#[unstable(feature = "char_internals",
+ reason = "this function should not be exposed publicly")]
pub fn encode_utf8_raw(code: u32, dst: &mut [u8]) -> Option<usize> {
// Marked #[inline] to allow llvm optimizing it away
if code < MAX_ONE_B && !dst.is_empty() {
/// If the buffer is not large enough, nothing will be written into it
/// and a `None` will be returned.
#[inline]
+#[unstable(feature = "char_internals",
+ reason = "this function should not be exposed publicly")]
pub fn encode_utf16_raw(mut ch: u32, dst: &mut [u16]) -> Option<usize> {
// Marked #[inline] to allow llvm optimizing it away
if (ch & 0xFFFF) == ch && !dst.is_empty() {
macro_rules! extern_fn_clone {
($($A:ident),*) => (
- #[unstable(feature = "core",
- reason = "this may not be sufficient for fns with region parameters")]
+ #[stable(feature = "rust1", since = "1.0.0")]
impl<$($A,)* ReturnType> Clone for extern "Rust" fn($($A),*) -> ReturnType {
/// Returns a copy of a function pointer.
#[inline]
fn clone(&self) -> extern "Rust" fn($($A),*) -> ReturnType { *self }
}
- #[unstable(feature = "core", reason = "brand new")]
+ #[stable(feature = "rust1", since = "1.0.0")]
impl<$($A,)* ReturnType> Clone for extern "C" fn($($A),*) -> ReturnType {
/// Returns a copy of a function pointer.
#[inline]
fn clone(&self) -> extern "C" fn($($A),*) -> ReturnType { *self }
}
- #[unstable(feature = "core", reason = "brand new")]
+ #[stable(feature = "rust1", since = "1.0.0")]
impl<$($A,)* ReturnType> Clone for unsafe extern "Rust" fn($($A),*) -> ReturnType {
/// Returns a copy of a function pointer.
#[inline]
fn clone(&self) -> unsafe extern "Rust" fn($($A),*) -> ReturnType { *self }
}
- #[unstable(feature = "core", reason = "brand new")]
+ #[stable(feature = "rust1", since = "1.0.0")]
impl<$($A,)* ReturnType> Clone for unsafe extern "C" fn($($A),*) -> ReturnType {
/// Returns a copy of a function pointer.
#[inline]
//! Functionality for ordering and comparison.
//!
-//! This module defines both `PartialOrd` and `PartialEq` traits which are used by the compiler to
-//! implement comparison operators. Rust programs may implement `PartialOrd` to overload the `<`,
-//! `<=`, `>`, and `>=` operators, and may implement `PartialEq` to overload the `==` and `!=`
-//! operators.
+//! This module defines both `PartialOrd` and `PartialEq` traits which are used
+//! by the compiler to implement comparison operators. Rust programs may
+//! implement `PartialOrd` to overload the `<`, `<=`, `>`, and `>=` operators,
+//! and may implement `PartialEq` to overload the `==` and `!=` operators.
#![stable(feature = "rust1", since = "1.0.0")]
use marker::Sized;
use option::Option::{self, Some, None};
-/// Trait for equality comparisons which are [partial equivalence relations](
-/// http://en.wikipedia.org/wiki/Partial_equivalence_relation).
+/// Trait for equality comparisons which are [partial equivalence
+/// relations](http://en.wikipedia.org/wiki/Partial_equivalence_relation).
///
-/// This trait allows for partial equality, for types that do not have a full equivalence relation.
-/// For example, in floating point numbers `NaN != NaN`, so floating point types implement
-/// `PartialEq` but not `Eq`.
+/// This trait allows for partial equality, for types that do not have a full
+/// equivalence relation. For example, in floating point numbers `NaN != NaN`,
+/// so floating point types implement `PartialEq` but not `Eq`.
///
/// Formally, the equality must be (for all `a`, `b` and `c`):
///
/// - symmetric: `a == b` implies `b == a`; and
/// - transitive: `a == b` and `b == c` implies `a == c`.
///
-/// Note that these requirements mean that the trait itself must be implemented symmetrically and
-/// transitively: if `T: PartialEq<U>` and `U: PartialEq<V>` then `U: PartialEq<T>` and `T:
-/// PartialEq<V>`.
+/// Note that these requirements mean that the trait itself must be implemented
+/// symmetrically and transitively: if `T: PartialEq<U>` and `U: PartialEq<V>`
+/// then `U: PartialEq<T>` and `T: PartialEq<V>`.
///
-/// PartialEq only requires the `eq` method to be implemented; `ne` is defined in terms of it by
-/// default. Any manual implementation of `ne` *must* respect the rule that `eq` is a strict
-/// inverse of `ne`; that is, `!(a == b)` if and only if `a != b`.
+/// PartialEq only requires the `eq` method to be implemented; `ne` is defined
+/// in terms of it by default. Any manual implementation of `ne` *must* respect
+/// the rule that `eq` is a strict inverse of `ne`; that is, `!(a == b)` if and
+/// only if `a != b`.
#[lang = "eq"]
#[stable(feature = "rust1", since = "1.0.0")]
pub trait PartialEq<Rhs: ?Sized = Self> {
- /// This method tests for `self` and `other` values to be equal, and is used by `==`.
+ /// This method tests for `self` and `other` values to be equal, and is used
+ /// by `==`.
#[stable(feature = "rust1", since = "1.0.0")]
fn eq(&self, other: &Rhs) -> bool;
/// assert_eq!(result, None);
/// ```
#[inline]
-#[unstable(feature = "core")]
+#[unstable(feature = "cmp_partial")]
pub fn partial_min<T: PartialOrd>(v1: T, v2: T) -> Option<T> {
match v1.partial_cmp(&v2) {
Some(Less) | Some(Equal) => Some(v1),
/// assert_eq!(result, None);
/// ```
#[inline]
-#[unstable(feature = "core")]
+#[unstable(feature = "cmp_partial")]
pub fn partial_max<T: PartialOrd>(v1: T, v2: T) -> Option<T> {
match v1.partial_cmp(&v2) {
Some(Equal) | Some(Less) => Some(v2),
//! Traits for conversions between types.
//!
-//! The traits in this module provide a general way to talk about conversions from one type to
-//! another. They follow the standard Rust conventions of `as`/`into`/`from`.
+//! The traits in this module provide a general way to talk about conversions
+//! from one type to another. They follow the standard Rust conventions of
+//! `as`/`into`/`from`.
//!
-//! Like many traits, these are often used as bounds for generic functions, to support arguments of
-//! multiple types.
+//! Like many traits, these are often used as bounds for generic functions, to
+//! support arguments of multiple types.
//!
//! See each trait for usage examples.
mod num;
mod builders;
-#[unstable(feature = "core", reason = "internal to format_args!")]
+#[unstable(feature = "fmt_internals", reason = "internal to format_args!")]
#[doc(hidden)]
pub mod rt {
pub mod v1;
/// 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 = "core", reason = "internal to format_args!")]
+#[unstable(feature = "fmt_internals", reason = "internal to format_args!")]
#[doc(hidden)]
pub struct ArgumentV1<'a> {
value: &'a Void,
}
#[doc(hidden)]
- #[unstable(feature = "core", reason = "internal to format_args!")]
+ #[unstable(feature = "fmt_internals", reason = "internal to format_args!")]
pub fn new<'b, T>(x: &'b T,
f: fn(&T, &mut Formatter) -> Result) -> ArgumentV1<'b> {
unsafe {
}
#[doc(hidden)]
- #[unstable(feature = "core", reason = "internal to format_args!")]
+ #[unstable(feature = "fmt_internals", reason = "internal to format_args!")]
pub fn from_usize(x: &usize) -> ArgumentV1 {
ArgumentV1::new(x, ArgumentV1::show_usize)
}
/// When using the format_args!() macro, this function is used to generate the
/// Arguments structure.
#[doc(hidden)] #[inline]
- #[unstable(feature = "core", reason = "internal to format_args!")]
+ #[unstable(feature = "fmt_internals", reason = "internal to format_args!")]
pub fn new_v1(pieces: &'a [&'a str],
args: &'a [ArgumentV1<'a>]) -> Arguments<'a> {
Arguments {
/// created with `argumentusize`. However, failing to do so doesn't cause
/// unsafety, but will ignore invalid .
#[doc(hidden)] #[inline]
- #[unstable(feature = "core", reason = "internal to format_args!")]
+ #[unstable(feature = "fmt_internals", reason = "internal to format_args!")]
pub fn new_v1_formatted(pieces: &'a [&'a str],
args: &'a [ArgumentV1<'a>],
fmt: &'a [rt::v1::Argument]) -> Arguments<'a> {
pub fn flags(&self) -> u32 { self.flags }
/// Character used as 'fill' whenever there is alignment
- #[unstable(feature = "core", reason = "method was just created")]
+ #[unstable(feature = "fmt_flags", reason = "method was just created")]
pub fn fill(&self) -> char { self.fill }
/// Flag indicating what form of alignment was requested
- #[unstable(feature = "core", reason = "method was just created")]
+ #[unstable(feature = "fmt_flags", reason = "method was just created")]
pub fn align(&self) -> Alignment { self.align }
/// Optionally specified integer width that the output should be
- #[unstable(feature = "core", reason = "method was just created")]
+ #[unstable(feature = "fmt_flags", reason = "method was just created")]
pub fn width(&self) -> Option<usize> { self.width }
/// Optionally specified precision for numeric types
- #[unstable(feature = "core", reason = "method was just created")]
+ #[unstable(feature = "fmt_flags", reason = "method was just created")]
pub fn precision(&self) -> Option<usize> { self.precision }
/// Creates a `DebugStruct` builder designed to assist with creation of
/// A radix with in the range of `2..36`.
#[derive(Clone, Copy, PartialEq)]
-#[unstable(feature = "core",
+#[unstable(feature = "fmt_radix",
reason = "may be renamed or move to a different module")]
pub struct Radix {
base: u8,
}
/// A helper type for formatting radixes.
-#[unstable(feature = "core",
+#[unstable(feature = "fmt_radix",
reason = "may be renamed or move to a different module")]
#[derive(Copy, Clone)]
pub struct RadixFmt<T, R>(T, R);
/// use std::fmt::radix;
/// assert_eq!(format!("{}", radix(55, 36)), "1j".to_string());
/// ```
-#[unstable(feature = "core",
+#[unstable(feature = "fmt_radix",
reason = "may be renamed or move to a different module")]
pub fn radix<T>(x: T, base: u8) -> RadixFmt<T, Radix> {
RadixFmt(x, Radix::new(base))
//! These definitions are similar to their `ct` equivalents, but differ in that
//! these can be statically allocated and are slightly optimized for the runtime
-#![unstable(feature = "core", reason = "internal to format_args!")]
-
#[derive(Copy, Clone)]
pub struct Argument {
pub position: Position,
fn hash<H: Hasher>(&self, state: &mut H);
/// Feeds a slice of this type into the state provided.
- #[unstable(feature = "hash", reason = "module was recently redesigned")]
+ #[unstable(feature = "hash_slice",
+ reason = "module was recently redesigned")]
fn hash_slice<H: Hasher>(data: &[Self], state: &mut H) where Self: Sized {
for piece in data {
piece.hash(state);
/// Write a single `u8` into this hasher
#[inline]
- #[unstable(feature = "hash", reason = "module was recently redesigned")]
+ #[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
fn write_u8(&mut self, i: u8) { self.write(&[i]) }
/// Write a single `u16` into this hasher.
#[inline]
- #[unstable(feature = "hash", reason = "module was recently redesigned")]
+ #[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
fn write_u16(&mut self, i: u16) {
self.write(&unsafe { mem::transmute::<_, [u8; 2]>(i) })
}
/// Write a single `u32` into this hasher.
#[inline]
- #[unstable(feature = "hash", reason = "module was recently redesigned")]
+ #[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
fn write_u32(&mut self, i: u32) {
self.write(&unsafe { mem::transmute::<_, [u8; 4]>(i) })
}
/// Write a single `u64` into this hasher.
#[inline]
- #[unstable(feature = "hash", reason = "module was recently redesigned")]
+ #[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
fn write_u64(&mut self, i: u64) {
self.write(&unsafe { mem::transmute::<_, [u8; 8]>(i) })
}
/// Write a single `usize` into this hasher.
#[inline]
- #[unstable(feature = "hash", reason = "module was recently redesigned")]
+ #[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
fn write_usize(&mut self, i: usize) {
if cfg!(target_pointer_width = "32") {
self.write_u32(i as u32)
/// Write a single `i8` into this hasher.
#[inline]
- #[unstable(feature = "hash", reason = "module was recently redesigned")]
+ #[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
fn write_i8(&mut self, i: i8) { self.write_u8(i as u8) }
/// Write a single `i16` into this hasher.
#[inline]
- #[unstable(feature = "hash", reason = "module was recently redesigned")]
+ #[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
fn write_i16(&mut self, i: i16) { self.write_u16(i as u16) }
/// Write a single `i32` into this hasher.
#[inline]
- #[unstable(feature = "hash", reason = "module was recently redesigned")]
+ #[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
fn write_i32(&mut self, i: i32) { self.write_u32(i as u32) }
/// Write a single `i64` into this hasher.
#[inline]
- #[unstable(feature = "hash", reason = "module was recently redesigned")]
+ #[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
fn write_i64(&mut self, i: i64) { self.write_u64(i as u64) }
/// Write a single `isize` into this hasher.
#[inline]
- #[unstable(feature = "hash", reason = "module was recently redesigned")]
+ #[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
fn write_isize(&mut self, i: isize) { self.write_usize(i as usize) }
}
///
/// The specified value will be hashed with this hasher and then the resulting
/// hash will be returned.
-#[unstable(feature = "hash", reason = "module was recently redesigned")]
+#[unstable(feature = "hash_default",
+ reason = "not the most ergonomic interface unless `H` is defaulted \
+ to SipHasher, but perhaps not ready to commit to that")]
pub fn hash<T: Hash, H: Hasher + Default>(value: &T) -> u64 {
let mut h: H = Default::default();
value.hash(&mut h);
//! guaranteed to happen in order. This is the standard mode for working
//! with atomic types and is equivalent to Java's `volatile`.
-#![unstable(feature = "core")]
+#![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")]
#![allow(missing_docs)]
use marker::Sized;
/// A compiler-only memory barrier.
///
- /// Memory accesses will never be reordered across this barrier by the compiler,
- /// but no instructions will be emitted for it. This is appropriate for operations
- /// on the same thread that may be preempted, such as when interacting with signal
- /// handlers.
+ /// Memory accesses will never be reordered across this barrier by the
+ /// compiler, but no instructions will be emitted for it. This is
+ /// appropriate for operations on the same thread that may be preempted,
+ /// such as when interacting with signal handlers.
pub fn atomic_singlethreadfence();
pub fn atomic_singlethreadfence_acq();
pub fn atomic_singlethreadfence_rel();
//! }
//! ```
//!
-//! Because `Iterator`s implement `IntoIterator`, this `for` loop syntax can be applied to any
-//! iterator over any type.
+//! Because `Iterator`s implement `IntoIterator`, this `for` loop syntax can be
+//! applied to any iterator over any type.
#![stable(feature = "rust1", since = "1.0.0")]
/// let a = [1, 1, 1, 1];
/// assert_eq!(a.iter().min_max(), MinMax(&1, &1));
/// ```
- #[unstable(feature = "core", reason = "return type may change")]
+ #[unstable(feature = "iter_min_max",
+ reason = "return type may change or may wish to have a closure \
+ based version as well")]
fn min_max(mut self) -> MinMaxResult<Self::Item> where Self: Sized, Self::Item: Ord
{
let (mut min, mut max) = match self.next() {
/// assert_eq!(*a.iter().max_by(|x| x.abs()).unwrap(), -10);
/// ```
#[inline]
- #[unstable(feature = "core",
+ #[unstable(feature = "iter_cmp",
reason = "may want to produce an Ordering directly; see #15311")]
fn max_by<B: Ord, F>(self, f: F) -> Option<Self::Item> where
Self: Sized,
/// assert_eq!(*a.iter().min_by(|x| x.abs()).unwrap(), 0);
/// ```
#[inline]
- #[unstable(feature = "core",
+ #[unstable(feature = "iter_cmp",
reason = "may want to produce an Ordering directly; see #15311")]
fn min_by<B: Ord, F>(self, f: F) -> Option<Self::Item> where
Self: Sized,
/// Use an iterator to reverse a container in place.
#[unstable(feature = "core",
reason = "uncertain about placement or widespread use")]
+ #[deprecated(since = "1.2.0",
+ reason = "not performant enough to justify inclusion")]
fn reverse_in_place<'a, T: 'a>(&mut self) where
Self: Sized + Iterator<Item=&'a mut T> + DoubleEndedIterator
{
/// let it = a.iter();
/// assert_eq!(it.sum::<i32>(), 15);
/// ```
- #[unstable(feature="core")]
+ #[unstable(feature="iter_sum", reason = "bounds recently changed")]
fn sum<S=<Self as Iterator>::Item>(self) -> S where
S: Add<Self::Item, Output=S> + Zero,
Self: Sized,
/// assert_eq!(factorial(1), 1);
/// assert_eq!(factorial(5), 120);
/// ```
- #[unstable(feature="core")]
+ #[unstable(feature="iter_product", reason = "bounds recently changed")]
fn product<P=<Self as Iterator>::Item>(self) -> P where
P: Mul<Self::Item, Output=P> + One,
Self: Sized,
/// `DoubleEndedIterator`. Calling `next()` or `next_back()` on a
/// `RandomAccessIterator` reduces the indexable range accordingly. That is,
/// `it.idx(1)` will become `it.idx(0)` after `it.next()` is called.
-#[unstable(feature = "core",
+#[unstable(feature = "iter_idx",
reason = "not widely used, may be better decomposed into Index \
and ExactSizeIterator")]
pub trait RandomAccessIterator: Iterator {
fn next_back(&mut self) -> Option<<I as Iterator>::Item> { self.iter.next() }
}
-#[unstable(feature = "core", reason = "trait is experimental")]
+#[unstable(feature = "iter_idx", reason = "trait is experimental")]
impl<I> RandomAccessIterator for Rev<I>
where I: DoubleEndedIterator + RandomAccessIterator
{
/// `MinMaxResult` is an enum returned by `min_max`. See `Iterator::min_max` for
/// more detail.
#[derive(Clone, PartialEq, Debug)]
-#[unstable(feature = "core",
+#[unstable(feature = "iter_min_max",
reason = "unclear whether such a fine-grained result is widely useful")]
pub enum MinMaxResult<T> {
/// Empty iterator
MinMax(T, T)
}
+#[unstable(feature = "iter_min_max", reason = "type is unstable")]
impl<T: Clone> MinMaxResult<T> {
/// `into_option` creates an `Option` of type `(T,T)`. The returned `Option`
/// has variant `None` if and only if the `MinMaxResult` has variant
/// let r = MinMax(1, 2);
/// assert_eq!(r.into_option(), Some((1, 2)));
/// ```
- #[unstable(feature = "core", reason = "type is unstable")]
pub fn into_option(self) -> Option<(T,T)> {
match self {
NoElements => None,
where I: ExactSizeIterator<Item=&'a T>, T: Clone
{}
-#[unstable(feature = "core", reason = "trait is experimental")]
+#[unstable(feature = "iter_idx", reason = "trait is experimental")]
impl<'a, I, T: 'a> RandomAccessIterator for Cloned<I>
where I: RandomAccessIterator<Item=&'a T>, T: Clone
{
}
}
-#[unstable(feature = "core", reason = "trait is experimental")]
+#[unstable(feature = "iter_idx", reason = "trait is experimental")]
impl<I> RandomAccessIterator for Cycle<I> where
I: Clone + RandomAccessIterator,
{
}
}
-#[unstable(feature = "core", reason = "trait is experimental")]
+#[unstable(feature = "iter_idx", reason = "trait is experimental")]
impl<A, B> RandomAccessIterator for Chain<A, B> where
A: RandomAccessIterator,
B: RandomAccessIterator<Item = A::Item>,
}
}
-#[unstable(feature = "core", reason = "trait is experimental")]
+#[unstable(feature = "iter_idx", reason = "trait is experimental")]
impl<A, B> RandomAccessIterator for Zip<A, B> where
A: RandomAccessIterator,
B: RandomAccessIterator
}
}
-#[unstable(feature = "core", reason = "trait is experimental")]
+#[unstable(feature = "iter_idx", reason = "trait is experimental")]
impl<B, I: RandomAccessIterator, F> RandomAccessIterator for Map<I, F> where
F: FnMut(I::Item) -> B,
{
}
}
-#[unstable(feature = "core", reason = "trait is experimental")]
+#[unstable(feature = "iter_idx", reason = "trait is experimental")]
impl<I> RandomAccessIterator for Enumerate<I> where I: RandomAccessIterator {
#[inline]
fn indexable(&self) -> usize {
}
}
-#[unstable(feature = "core", reason = "trait is experimental")]
+#[unstable(feature = "iter_idx", reason = "trait is experimental")]
impl<I> RandomAccessIterator for Skip<I> where I: RandomAccessIterator{
#[inline]
fn indexable(&self) -> usize {
}
}
-#[unstable(feature = "core", reason = "trait is experimental")]
+#[unstable(feature = "iter_idx", reason = "trait is experimental")]
impl<I> RandomAccessIterator for Take<I> where I: RandomAccessIterator{
#[inline]
fn indexable(&self) -> usize {
f: F,
/// The current internal state to be passed to the closure next.
- #[unstable(feature = "core")]
+ #[unstable(feature = "scan_state",
+ reason = "public fields are otherwise rare in the stdlib")]
pub state: St,
}
}
// Allow RandomAccessIterators to be fused without affecting random-access behavior
-#[unstable(feature = "core", reason = "trait is experimental")]
+#[unstable(feature = "iter_idx", reason = "trait is experimental")]
impl<I> RandomAccessIterator for Fuse<I> where I: RandomAccessIterator {
#[inline]
fn indexable(&self) -> usize {
/// `.next_back()` will call the underlying iterator again even if it
/// previously returned `None`.
#[inline]
- #[unstable(feature = "core", reason = "seems marginal")]
+ #[unstable(feature = "iter_reset_fuse", reason = "seems marginal")]
pub fn reset_fuse(&mut self) {
self.done = false
}
}
}
-#[unstable(feature = "core", reason = "trait is experimental")]
+#[unstable(feature = "iter_idx", reason = "trait is experimental")]
impl<I: RandomAccessIterator, F> RandomAccessIterator for Inspect<I, F>
where F: FnMut(&I::Item),
{
/// println!("{}", i);
/// }
/// ```
-#[unstable(feature = "core")]
+#[unstable(feature = "iter_unfold")]
#[derive(Clone)]
pub struct Unfold<St, F> {
f: F,
/// Internal state that will be passed to the closure on the next iteration
- #[unstable(feature = "core")]
+ #[unstable(feature = "iter_unfold")]
pub state: St,
}
-#[unstable(feature = "core")]
+#[unstable(feature = "iter_unfold")]
impl<A, St, F> Unfold<St, F> where F: FnMut(&mut St) -> Option<A> {
/// Creates a new iterator with the specified closure as the "iterator
/// function" and an initial state to eventually pass to the closure
/// An iterator over the range [start, stop]
#[derive(Clone)]
-#[unstable(feature = "core",
+#[unstable(feature = "range_inclusive",
reason = "likely to be replaced by range notation and adapters")]
pub struct RangeInclusive<A> {
range: ops::Range<A>,
/// Returns an iterator over the range [start, stop].
#[inline]
-#[unstable(feature = "core",
+#[unstable(feature = "range_inclusive",
reason = "likely to be replaced by range notation and adapters")]
pub fn range_inclusive<A>(start: A, stop: A) -> RangeInclusive<A>
where A: Step + One + Clone
}
}
-#[unstable(feature = "core",
+#[unstable(feature = "range_inclusive",
reason = "likely to be replaced by range notation and adapters")]
impl<A> Iterator for RangeInclusive<A> where
A: PartialEq + Step + One + Clone,
}
}
-#[unstable(feature = "core",
+#[unstable(feature = "range_inclusive",
reason = "likely to be replaced by range notation and adapters")]
impl<A> DoubleEndedIterator for RangeInclusive<A> where
A: PartialEq + Step + One + Clone,
fn next_back(&mut self) -> Option<A> { self.idx(0) }
}
-#[unstable(feature = "core", reason = "trait is experimental")]
+#[unstable(feature = "iter_idx", reason = "trait is experimental")]
impl<A: Clone> RandomAccessIterator for Repeat<A> {
#[inline]
fn indexable(&self) -> usize { usize::MAX }
/// An iterator that repeatedly applies a given function, starting
/// from a given seed value.
-#[unstable(feature = "core")]
+#[unstable(feature = "iter_iterate")]
pub type Iterate<T, F> = Unfold<IterateState<T, F>, fn(&mut IterateState<T, F>) -> Option<T>>;
/// Creates a new iterator that produces an infinite sequence of
/// repeated applications of the given function `f`.
-#[unstable(feature = "core")]
+#[unstable(feature = "iter_iterate")]
pub fn iterate<T, F>(seed: T, f: F) -> Iterate<T, F> where
T: Clone,
F: FnMut(T) -> T,
///
/// If two sequences are equal up until the point where one ends,
/// the shorter sequence compares less.
-#[unstable(feature = "core", reason = "needs review and revision")]
+#[unstable(feature = "iter_order", reason = "needs review and revision")]
pub mod order {
use cmp;
use cmp::{Eq, Ord, PartialOrd, PartialEq};
// Do not remove on snapshot creation. Needed for bootstrap. (Issue #22364)
#![cfg_attr(stage0, feature(custom_attribute))]
#![crate_name = "core"]
-#![unstable(feature = "core")]
+#![unstable(feature = "core",
+ reason = "the libcore library has not yet been scrutinized for \
+ stabilization in terms of structure and naming")]
#![staged_api]
#![crate_type = "rlib"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
#![allow(raw_pointer_derive)]
#![deny(missing_docs)]
-#![feature(intrinsics, lang_items)]
+#![feature(intrinsics)]
+#![feature(lang_items)]
#![feature(on_unimplemented)]
#![feature(simd)]
#![feature(staged_api)]
#![feature(reflect)]
#![feature(custom_attribute)]
#![feature(const_fn)]
+#![feature(allow_internal_unstable)]
#[macro_use]
mod macros;
/// Entry point of thread panic, for details, see std::macros
#[macro_export]
+#[allow_internal_unstable]
macro_rules! panic {
() => (
panic!("explicit panic")
}
/// Types that can be "unsized" to a dynamically sized type.
-#[unstable(feature = "core")]
+#[unstable(feature = "unsize")]
#[lang="unsize"]
pub trait Unsize<T> {
// Empty.
/// ensure that they are never copied, even if they lack a destructor.
#[unstable(feature = "core",
reason = "likely to change with new variance strategy")]
+#[deprecated(since = "1.2.0",
+ reason = "structs are by default not copyable")]
#[lang = "no_copy_bound"]
+#[allow(deprecated)]
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
pub struct NoCopy;
///
/// [1]: http://en.wikipedia.org/wiki/Parametricity
#[rustc_reflect_like]
-#[unstable(feature = "core", reason = "requires RFC and more experience")]
+#[unstable(feature = "reflect_marker",
+ reason = "requires RFC and more experience")]
#[allow(deprecated)]
#[rustc_on_unimplemented = "`{Self}` does not implement `Any`; \
ensure all type parameters are bounded by `Any`"]
/// Transforms lifetime of the second pointer to match the first.
#[inline]
-#[unstable(feature = "core",
+#[unstable(feature = "copy_lifetime",
reason = "this function may be removed in the future due to its \
questionable utility")]
pub unsafe fn copy_lifetime<'a, S: ?Sized, T: ?Sized + 'a>(_ptr: &'a S,
/// Transforms lifetime of the second mutable pointer to match the first.
#[inline]
-#[unstable(feature = "core",
+#[unstable(feature = "copy_lifetime",
reason = "this function may be removed in the future due to its \
questionable utility")]
pub unsafe fn copy_mut_lifetime<'a, S: ?Sized, T: ?Sized + 'a>(_ptr: &'a S,
// except according to those terms.
//! Exposes the NonZero lang item which provides optimization hints.
+#![unstable(feature = "nonzero",
+ reason = "needs an RFC to flesh out the design")]
use marker::Sized;
use ops::{CoerceUnsized, Deref};
/// NULL or 0 that might allow certain optimizations.
#[lang = "non_zero"]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
-#[unstable(feature = "core")]
pub struct NonZero<T: Zeroable>(T);
impl<T: Zeroable> NonZero<T> {
pub const PI: f32 = 3.14159265358979323846264338327950288_f32;
/// pi * 2.0
- #[unstable(feature = "core", reason = "unclear naming convention/usefulness")]
+ #[unstable(feature = "float_consts",
+ reason = "unclear naming convention/usefulness")]
pub const PI_2: f32 = 6.28318530717958647692528676655900576_f32;
/// pi/2.0
pub const LN_10: f32 = 2.30258509299404568401799145468436421_f32;
}
-#[unstable(feature = "core", reason = "trait is unstable")]
impl Float for f32 {
#[inline]
fn nan() -> f32 { NAN }
pub const PI: f64 = 3.14159265358979323846264338327950288_f64;
/// pi * 2.0
- #[unstable(feature = "core", reason = "unclear naming convention/usefulness")]
+ #[unstable(feature = "float_consts",
+ reason = "unclear naming convention/usefulness")]
pub const PI_2: f64 = 6.28318530717958647692528676655900576_f64;
/// pi/2.0
pub const LN_10: f64 = 2.30258509299404568401799145468436421_f64;
}
-#[unstable(feature = "core", reason = "trait is unstable")]
impl Float for f64 {
#[inline]
fn nan() -> f64 { NAN }
// while this is extensively documented, this is in principle private which is
// only made public for testing. do not expose us.
#![doc(hidden)]
+#![unstable(feature = "flt2dec",
+ reason = "internal routines only exposed for testing")]
use prelude::*;
use i16;
// FIXME(#11621): Should be deprecated once CTFE is implemented in favour of
// calling the `mem::size_of` function.
-#[unstable(feature = "core")]
+#[unstable(feature = "num_bits_bytes",
+ reason = "may want to be an associated function")]
pub const BITS : usize = $bits;
// FIXME(#11621): Should be deprecated once CTFE is implemented in favour of
// calling the `mem::size_of` function.
-#[unstable(feature = "core")]
+#[unstable(feature = "num_bits_bytes",
+ reason = "may want to be an associated function")]
pub const BYTES : usize = ($bits / 8);
// FIXME(#11621): Should be deprecated once CTFE is implemented in favour of
#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Debug)]
pub struct Wrapping<T>(#[stable(feature = "rust1", since = "1.0.0")] pub T);
-#[unstable(feature = "core", reason = "may be removed or relocated")]
pub mod wrapping;
-
-#[unstable(feature = "core", reason = "internal routines only exposed for testing")]
pub mod flt2dec;
/// Types that have a "zero" value.
/// to `-MIN`, a positive value that is too large to represent
/// in the type. In such a case, this function returns `MIN`
/// itself..
- #[unstable(feature = "core", since = "1.0.0")]
+ #[unstable(feature = "num_wrapping")]
#[inline(always)]
pub fn wrapping_div(self, rhs: Self) -> Self {
self.overflowing_div(rhs).0
/// implementation artifacts make `x % y` illegal for `MIN /
/// -1` on a signed type illegal (where `MIN` is the negative
/// minimal value). In such a case, this function returns `0`.
- #[unstable(feature = "core", since = "1.0.0")]
+ #[unstable(feature = "num_wrapping")]
#[inline(always)]
pub fn wrapping_rem(self, rhs: Self) -> Self {
self.overflowing_rem(rhs).0
/// negative minimal value for the type); this is a positive
/// value that is too large to represent in the type. In such
/// a case, this function returns `MIN` itself.
- #[unstable(feature = "core", since = "1.0.0")]
+ #[unstable(feature = "num_wrapping")]
#[inline(always)]
pub fn wrapping_neg(self) -> Self {
self.overflowing_neg().0
/// Panic-free bitwise shift-left; yields `self << mask(rhs)`,
/// where `mask` removes any high-order bits of `rhs` that
/// would cause the shift to exceed the bitwidth of the type.
- #[unstable(feature = "core", since = "1.0.0")]
+ #[unstable(feature = "num_wrapping")]
#[inline(always)]
pub fn wrapping_shl(self, rhs: u32) -> Self {
self.overflowing_shl(rhs).0
/// Panic-free bitwise shift-left; yields `self >> mask(rhs)`,
/// where `mask` removes any high-order bits of `rhs` that
/// would cause the shift to exceed the bitwidth of the type.
- #[unstable(feature = "core", since = "1.0.0")]
+ #[unstable(feature = "num_wrapping")]
#[inline(always)]
pub fn wrapping_shr(self, rhs: u32) -> Self {
self.overflowing_shr(rhs).0
/// to `-MIN`, a positive value that is too large to represent
/// in the type. In such a case, this function returns `MIN`
/// itself..
- #[unstable(feature = "core", since = "1.0.0")]
+ #[unstable(feature = "num_wrapping")]
#[inline(always)]
pub fn wrapping_div(self, rhs: Self) -> Self {
self.overflowing_div(rhs).0
/// implementation artifacts make `x % y` illegal for `MIN /
/// -1` on a signed type illegal (where `MIN` is the negative
/// minimal value). In such a case, this function returns `0`.
- #[unstable(feature = "core", since = "1.0.0")]
+ #[unstable(feature = "num_wrapping")]
#[inline(always)]
pub fn wrapping_rem(self, rhs: Self) -> Self {
self.overflowing_rem(rhs).0
/// negative minimal value for the type); this is a positive
/// value that is too large to represent in the type. In such
/// a case, this function returns `MIN` itself.
- #[unstable(feature = "core", since = "1.0.0")]
+ #[unstable(feature = "num_wrapping")]
#[inline(always)]
pub fn wrapping_neg(self) -> Self {
self.overflowing_neg().0
/// Panic-free bitwise shift-left; yields `self << mask(rhs)`,
/// where `mask` removes any high-order bits of `rhs` that
/// would cause the shift to exceed the bitwidth of the type.
- #[unstable(feature = "core", since = "1.0.0")]
+ #[unstable(feature = "num_wrapping")]
#[inline(always)]
pub fn wrapping_shl(self, rhs: u32) -> Self {
self.overflowing_shl(rhs).0
/// Panic-free bitwise shift-left; yields `self >> mask(rhs)`,
/// where `mask` removes any high-order bits of `rhs` that
/// would cause the shift to exceed the bitwidth of the type.
- #[unstable(feature = "core", since = "1.0.0")]
+ #[unstable(feature = "num_wrapping")]
#[inline(always)]
pub fn wrapping_shr(self, rhs: u32) -> Self {
self.overflowing_shr(rhs).0
/// A built-in floating point number.
#[doc(hidden)]
+#[unstable(feature = "core_float",
+ reason = "stable interface is via `impl f{32,64}` in later crates")]
pub trait Float {
/// Returns the NaN value.
fn nan() -> Self;
}
impl ParseIntError {
- #[unstable(feature = "core", reason = "available through Error trait")]
+ #[unstable(feature = "int_error_internals",
+ reason = "available through Error trait and this method should \
+ not be exposed publicly")]
pub fn description(&self) -> &str {
match self.kind {
IntErrorKind::Empty => "cannot parse integer from empty string",
#[stable(feature = "rust1", since = "1.0.0")]
pub struct ParseFloatError {
#[doc(hidden)]
+ #[unstable(feature = "float_error_internals",
+ reason = "should not be exposed publicly")]
pub __kind: FloatErrorKind
}
#[derive(Debug, Clone, PartialEq)]
+#[unstable(feature = "float_error_internals",
+ reason = "should not be exposed publicly")]
pub enum FloatErrorKind {
Empty,
Invalid,
macro_rules! uint_module { ($T:ty, $T_SIGNED:ty, $bits:expr) => (
-#[unstable(feature = "core")]
+#[unstable(feature = "num_bits_bytes",
+ reason = "may want to be an associated function")]
pub const BITS : usize = $bits;
-#[unstable(feature = "core")]
+#[unstable(feature = "num_bits_bytes",
+ reason = "may want to be an associated function")]
pub const BYTES : usize = ($bits / 8);
#[stable(feature = "rust1", since = "1.0.0")]
#![allow(missing_docs)]
#![allow(deprecated)]
+#![unstable(feature = "wrapping", reason = "may be removed or relocated")]
use super::Wrapping;
use ::{i8,i16,i32,i64};
-#[unstable(feature = "core", reason = "may be removed, renamed, or relocated")]
pub trait OverflowingOps {
fn overflowing_add(self, rhs: Self) -> (Self, bool);
fn overflowing_sub(self, rhs: Self) -> (Self, bool);
//!
//! # Examples
//!
-//! This example creates a `Point` struct that implements `Add` and `Sub`, and then
-//! demonstrates adding and subtracting two `Point`s.
+//! This example creates a `Point` struct that implements `Add` and `Sub`, and
+//! then demonstrates adding and subtracting two `Point`s.
//!
//! ```rust
//! use std::ops::{Add, Sub};
//! }
//! ```
//!
-//! See the documentation for each trait for a minimum implementation that prints
-//! something to the screen.
+//! See the documentation for each trait for a minimum implementation that
+//! prints something to the screen.
#![stable(feature = "rust1", since = "1.0.0")]
use marker::{Sized, Unsize};
use fmt;
-/// The `Drop` trait is used to run some code when a value goes out of scope. This
-/// is sometimes called a 'destructor'.
+/// The `Drop` trait is used to run some code when a value goes out of scope.
+/// This is sometimes called a 'destructor'.
///
/// # Examples
///
-/// A trivial implementation of `Drop`. The `drop` method is called when `_x` goes
-/// out of scope, and therefore `main` prints `Dropping!`.
+/// A trivial implementation of `Drop`. The `drop` method is called when `_x`
+/// goes out of scope, and therefore `main` prints `Dropping!`.
///
/// ```
/// struct HasDrop;
// based on "op T" where T is expected to be `Copy`able
macro_rules! forward_ref_unop {
(impl $imp:ident, $method:ident for $t:ty) => {
- #[unstable(feature = "core",
- reason = "recently added, waiting for dust to settle")]
+ #[stable(feature = "rust1", since = "1.0.0")]
impl<'a> $imp for &'a $t {
type Output = <$t as $imp>::Output;
// based on "T op U" where T and U are expected to be `Copy`able
macro_rules! forward_ref_binop {
(impl $imp:ident, $method:ident for $t:ty, $u:ty) => {
- #[unstable(feature = "core",
- reason = "recently added, waiting for dust to settle")]
+ #[stable(feature = "rust1", since = "1.0.0")]
impl<'a> $imp<$u> for &'a $t {
type Output = <$t as $imp<$u>>::Output;
}
}
- #[unstable(feature = "core",
- reason = "recently added, waiting for dust to settle")]
+ #[stable(feature = "rust1", since = "1.0.0")]
impl<'a> $imp<&'a $u> for $t {
type Output = <$t as $imp<$u>>::Output;
}
}
- #[unstable(feature = "core",
- reason = "recently added, waiting for dust to settle")]
+ #[stable(feature = "rust1", since = "1.0.0")]
impl<'a, 'b> $imp<&'a $u> for &'b $t {
type Output = <$t as $imp<$u>>::Output;
/// Trait that indicates that this is a pointer or a wrapper for one,
/// where unsizing can be performed on the pointee.
-#[unstable(feature = "core")]
+#[unstable(feature = "coerce_unsized")]
#[lang="coerce_unsized"]
pub trait CoerceUnsized<T> {
// Empty.
/// assert_eq!(x, Some("Dirt"));
/// ```
#[inline]
- #[unstable(feature = "core",
+ #[unstable(feature = "as_slice",
reason = "waiting for mut conventions")]
pub fn as_mut_slice<'r>(&'r mut self) -> &'r mut [T] {
match *self {
//! library, but the location of this may change over time.
#![allow(dead_code, missing_docs)]
+#![unstable(feature = "core_panic",
+ reason = "internal details of the implementation of the `panic!` \
+ and related macros")]
use fmt;
//! use core::prelude::*;
//! ```
+#![unstable(feature = "core_prelude",
+ reason = "the libcore prelude has not been scrutinized and \
+ stabilized yet")]
+
// Reexported core operators
pub use marker::{Copy, Send, Sized, Sync};
pub use ops::{Drop, Fn, FnMut, FnOnce};
pub use mem::drop;
// Reexported types and traits
-
pub use char::CharExt;
pub use clone::Clone;
pub use cmp::{PartialEq, PartialOrd, Eq, Ord};
///
/// This is unsafe for the same reasons that `read` is unsafe.
#[inline(always)]
-#[unstable(feature = "core",
+#[unstable(feature = "read_and_zero",
reason = "may play a larger role in std::ptr future extensions")]
pub unsafe fn read_and_zero<T>(dest: *mut T) -> T {
// Copy the data out from `dest`:
/// Variant of read_and_zero that writes the specific drop-flag byte
/// (which may be more appropriate than zero).
#[inline(always)]
-#[unstable(feature = "core",
+#[unstable(feature = "filling_drop",
reason = "may play a larger role in std::ptr future extensions")]
pub unsafe fn read_and_drop<T>(dest: *mut T) -> T {
// Copy the data out from `dest`:
/// null-safety, it is important to note that this is still an unsafe
/// operation because the returned value could be pointing to invalid
/// memory.
- #[unstable(feature = "core",
- reason = "Option is not clearly the right return type, and we may want \
- to tie the return lifetime to a borrow of the raw pointer")]
+ #[unstable(feature = "ptr_as_ref",
+ reason = "Option is not clearly the right return type, and we \
+ may want to tie the return lifetime to a borrow of \
+ the raw pointer")]
#[inline]
pub unsafe fn as_ref<'a>(&self) -> Option<&'a T> where T: Sized {
if self.is_null() {
/// null-safety, it is important to note that this is still an unsafe
/// operation because the returned value could be pointing to invalid
/// memory.
- #[unstable(feature = "core",
- reason = "Option is not clearly the right return type, and we may want \
- to tie the return lifetime to a borrow of the raw pointer")]
+ #[unstable(feature = "ptr_as_ref",
+ reason = "Option is not clearly the right return type, and we \
+ may want to tie the return lifetime to a borrow of \
+ the raw pointer")]
#[inline]
pub unsafe fn as_ref<'a>(&self) -> Option<&'a T> where T: Sized {
if self.is_null() {
///
/// As with `as_ref`, this is unsafe because it cannot verify the validity
/// of the returned pointer.
- #[unstable(feature = "core",
+ #[unstable(feature = "ptr_as_ref",
reason = "return value does not necessarily convey all possible \
information")]
#[inline]
/// modified without a unique path to the `Unique` reference. Useful
/// for building abstractions like `Vec<T>` or `Box<T>`, which
/// internally use raw pointers to manage the memory that they own.
-#[unstable(feature = "unique")]
+#[unstable(feature = "unique", reason = "needs an RFC to flesh out design")]
pub struct Unique<T: ?Sized> {
pointer: NonZero<*const T>,
_marker: PhantomData<T>,
#[unstable(feature = "unique")]
unsafe impl<T: Sync + ?Sized> Sync for Unique<T> { }
+#[unstable(feature = "unique")]
impl<T: ?Sized> Unique<T> {
/// Creates a new `Unique`.
- #[unstable(feature = "unique")]
pub unsafe fn new(ptr: *mut T) -> Unique<T> {
Unique { pointer: NonZero::new(ptr), _marker: PhantomData }
}
/// Dereferences the content.
- #[unstable(feature = "unique")]
pub unsafe fn get(&self) -> &T {
&**self.pointer
}
/// Mutably dereferences the content.
- #[unstable(feature = "unique")]
pub unsafe fn get_mut(&mut self) -> &mut T {
&mut ***self
}
// except according to those terms.
#![allow(missing_docs)]
-#![unstable(feature = "core")]
+#![unstable(feature = "raw")]
//! Contains struct definitions for the layout of compiler built-in types.
//!
/// assert!(x.as_mut_slice().is_empty());
/// ```
#[inline]
- #[unstable(feature = "core",
+ #[unstable(feature = "as_slice",
reason = "waiting for mut conventions")]
pub fn as_mut_slice(&mut self) -> &mut [T] {
match *self {
/// If an `Err` is encountered, it is immediately returned.
/// Otherwise, the folded value is returned.
#[inline]
-#[unstable(feature = "core")]
+#[unstable(feature = "result_fold",
+ reason = "unclear if this function should exist")]
pub fn fold<T,
V,
E,
//! These are all experimental. The interface may change entirely, without
//! warning.
+#![unstable(feature = "core_simd",
+ reason = "needs an RFC to flesh out the design")]
+
#![allow(non_camel_case_types)]
#![allow(missing_docs)]
-#[unstable(feature = "core")]
#[simd]
#[derive(Copy, Clone, Debug)]
#[repr(C)]
pub i8, pub i8, pub i8, pub i8,
pub i8, pub i8, pub i8, pub i8);
-#[unstable(feature = "core")]
#[simd]
#[derive(Copy, Clone, Debug)]
#[repr(C)]
pub struct i16x8(pub i16, pub i16, pub i16, pub i16,
pub i16, pub i16, pub i16, pub i16);
-#[unstable(feature = "core")]
#[simd]
#[derive(Copy, Clone, Debug)]
#[repr(C)]
pub struct i32x4(pub i32, pub i32, pub i32, pub i32);
-#[unstable(feature = "core")]
#[simd]
#[derive(Copy, Clone, Debug)]
#[repr(C)]
pub struct i64x2(pub i64, pub i64);
-#[unstable(feature = "core")]
#[simd]
#[derive(Copy, Clone, Debug)]
#[repr(C)]
pub u8, pub u8, pub u8, pub u8,
pub u8, pub u8, pub u8, pub u8);
-#[unstable(feature = "core")]
#[simd]
#[derive(Copy, Clone, Debug)]
#[repr(C)]
pub struct u16x8(pub u16, pub u16, pub u16, pub u16,
pub u16, pub u16, pub u16, pub u16);
-#[unstable(feature = "core")]
#[simd]
#[derive(Copy, Clone, Debug)]
#[repr(C)]
pub struct u32x4(pub u32, pub u32, pub u32, pub u32);
-#[unstable(feature = "core")]
#[simd]
#[derive(Copy, Clone, Debug)]
#[repr(C)]
pub struct u64x2(pub u64, pub u64);
-#[unstable(feature = "core")]
#[simd]
#[derive(Copy, Clone, Debug)]
#[repr(C)]
pub struct f32x4(pub f32, pub f32, pub f32, pub f32);
-#[unstable(feature = "core")]
#[simd]
#[derive(Copy, Clone, Debug)]
#[repr(C)]
/// Extension methods for slices.
#[allow(missing_docs)] // docs in libcollections
#[doc(hidden)]
+#[unstable(feature = "core_slice_ext",
+ reason = "stable interface provided by `impl [T]` in later crates")]
pub trait SliceExt {
type Item;
}};
}
-#[unstable(feature = "core")]
impl<T> SliceExt for [T] {
type Item = T;
self.repr().data
}
- #[unstable(feature = "core")]
fn binary_search_by<F>(&self, mut f: F) -> Result<usize, usize> where
F: FnMut(&T) -> Ordering
{
m >= n && needle == &self[m-n..]
}
- #[unstable(feature = "core")]
fn binary_search(&self, x: &T) -> Result<usize, usize> where T: Ord {
self.binary_search_by(|p| p.cmp(x))
}
- #[unstable(feature = "core")]
fn next_permutation(&mut self) -> bool where T: Ord {
// These cases only have 1 permutation each, so we can't do anything.
if self.len() < 2 { return false; }
true
}
- #[unstable(feature = "core")]
fn prev_permutation(&mut self) -> bool where T: Ord {
// These cases only have 1 permutation each, so we can't do anything.
if self.len() < 2 { return false; }
///
/// This has the same lifetime as the original slice, and so the
/// iterator can continue to be used while this exists.
- #[unstable(feature = "core")]
+ #[unstable(feature = "iter_to_slice")]
pub fn as_slice(&self) -> &'a [T] {
make_slice!(self.ptr, self.end)
}
fn clone(&self) -> Iter<'a, T> { Iter { ptr: self.ptr, end: self.end, _marker: self._marker } }
}
-#[unstable(feature = "core", reason = "trait is experimental")]
+#[unstable(feature = "iter_idx", reason = "trait is experimental")]
impl<'a, T> RandomAccessIterator for Iter<'a, T> {
#[inline]
fn indexable(&self) -> usize {
/// to consume the iterator. Consider using the `Slice` and
/// `SliceMut` implementations for obtaining slices with more
/// restricted lifetimes that do not consume the iterator.
- #[unstable(feature = "core")]
+ #[unstable(feature = "iter_to_slice")]
pub fn into_slice(self) -> &'a mut [T] {
make_mut_slice!(self.ptr, self.end)
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T> ExactSizeIterator for Windows<'a, T> {}
-#[unstable(feature = "core", reason = "trait is experimental")]
+#[unstable(feature = "iter_idx", reason = "trait is experimental")]
impl<'a, T> RandomAccessIterator for Windows<'a, T> {
#[inline]
fn indexable(&self) -> usize {
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T> ExactSizeIterator for Chunks<'a, T> {}
-#[unstable(feature = "core", reason = "trait is experimental")]
+#[unstable(feature = "iter_idx", reason = "trait is experimental")]
impl<'a, T> RandomAccessIterator for Chunks<'a, T> {
#[inline]
fn indexable(&self) -> usize {
//
/// Converts a pointer to A into a slice of length 1 (without copying).
-#[unstable(feature = "core")]
+#[unstable(feature = "ref_slice")]
pub fn ref_slice<'a, A>(s: &'a A) -> &'a [A] {
unsafe {
from_raw_parts(s, 1)
}
/// Converts a pointer to A into a slice of length 1 (without copying).
-#[unstable(feature = "core")]
+#[unstable(feature = "ref_slice")]
pub fn mut_ref_slice<'a, A>(s: &'a mut A) -> &'a mut [A] {
unsafe {
from_raw_parts_mut(s, 1)
//
/// Operations on `[u8]`.
-#[unstable(feature = "core", reason = "needs review")]
+#[unstable(feature = "slice_bytes", reason = "needs review")]
pub mod bytes {
use ptr;
use slice::SliceExt;
}
/// Extension methods for slices containing integers.
-#[unstable(feature = "core")]
+#[unstable(feature = "int_slice")]
pub trait IntSliceExt<U, S> {
/// Converts the slice to an immutable slice of unsigned integers with the same width.
fn as_unsigned<'a>(&'a self) -> &'a [U];
macro_rules! impl_int_slice {
($u:ty, $s:ty, $t:ty) => {
- #[unstable(feature = "core")]
+ #[unstable(feature = "int_slice")]
impl IntSliceExt<$u, $s> for [$t] {
#[inline]
fn as_unsigned(&self) -> &[$u] { unsafe { transmute(self) } }
//! For more details, see std::str
#![doc(primitive = "str")]
+#![stable(feature = "rust1", since = "1.0.0")]
use self::OldSearcher::{TwoWay, TwoWayLong};
use self::pattern::Pattern;
/// Reads the next code point out of a byte iterator (assuming a
/// UTF-8-like encoding).
-#[unstable(feature = "core")]
+#[unstable(feature = "str_internals")]
#[inline]
pub fn next_code_point(bytes: &mut slice::Iter<u8>) -> Option<u32> {
// Decode UTF-8
/// Reads the last code point out of a byte iterator (assuming a
/// UTF-8-like encoding).
-#[unstable(feature = "core")]
+#[unstable(feature = "str_internals")]
#[inline]
pub fn next_code_point_reverse(bytes: &mut slice::Iter<u8>) -> Option<u32> {
// Decode UTF-8
#[doc="Created with the method `.rmatch_indices()`."]
struct RMatchIndices;
stability:
- #[unstable(feature = "core",
+ #[unstable(feature = "str_internals",
reason = "type may be removed or have its iterator impl changed")]
internal:
MatchIndicesInternal yielding ((usize, usize));
#[doc="Created with the method `.rmatches()`."]
struct RMatches;
stability:
- #[unstable(feature = "core", reason = "type got recently added")]
+ #[unstable(feature = "str_internals", reason = "type got recently added")]
internal:
MatchesInternal yielding (&'a str);
delegate double ended;
/// Methods for string slices
#[allow(missing_docs)]
#[doc(hidden)]
+#[unstable(feature = "core_str_ext",
+ reason = "stable interface provided by `impl str` in later crates")]
pub trait StrExt {
// NB there are no docs here are they're all located on the StrExt trait in
// libcollections, not here.
/// Pluck a code point out of a UTF-8-like byte slice and return the
/// index of the next code point.
#[inline]
-#[unstable(feature = "core")]
+#[unstable(feature = "str_internals")]
pub fn char_range_at_raw(bytes: &[u8], i: usize) -> (u32, usize) {
if bytes[i] < 128 {
return (bytes[i] as u32, i + 1);
//! For more details, see the traits `Pattern`, `Searcher`,
//! `ReverseSearcher` and `DoubleEndedSearcher`.
+#![unstable(feature = "pattern",
+ reason = "API not fully fleshed out and ready to be stabilized")]
+
use prelude::*;
// Pattern
+++ /dev/null
-// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-//! Types dealing with unsafe actions.
-
-use marker;
#![feature(alloc)]
#![feature(staged_api)]
#![feature(box_syntax)]
-#![feature(core)]
-#![feature(const_fn)]
+#![feature(iter_cmp)]
#![feature(std_misc)]
use std::boxed;
#![unstable(feature = "rand",
reason = "use `rand` from crates.io")]
#![feature(core)]
+#![feature(core_float)]
+#![feature(core_prelude)]
+#![feature(core_slice_ext)]
#![feature(no_std)]
+#![feature(num_bits_bytes)]
#![feature(staged_api)]
#![feature(step_by)]
html_root_url = "http://doc.rust-lang.org/nightly/",
html_playground_url = "http://play.rust-lang.org/")]
-#![feature(core)]
#![feature(rustc_private)]
#![feature(staged_api)]
+#![feature(slice_bytes)]
#![cfg_attr(test, feature(test))]
#![feature(box_syntax)]
#![feature(collections)]
#![feature(const_fn)]
-#![feature(core)]
#![feature(duration)]
#![feature(duration_span)]
#![feature(fs_canonicalize)]
-#![feature(hash)]
+#![feature(hash_default)]
#![feature(into_cow)]
+#![feature(iter_sum)]
#![feature(libc)]
+#![feature(num_bits_bytes)]
#![feature(path_ext)]
#![feature(quote)]
+#![feature(range_inclusive)]
+#![feature(ref_slice)]
#![feature(rustc_diagnostic_macros)]
#![feature(rustc_private)]
+#![feature(slice_bytes)]
#![feature(slice_patterns)]
#![feature(staged_api)]
#![feature(std_misc)]
#![feature(str_char)]
+#![feature(wrapping)]
#![cfg_attr(test, feature(test))]
#![allow(trivial_casts)]
#![feature(box_syntax)]
#![feature(collections)]
-#![feature(core)]
+#![feature(fs_canonicalize)]
+#![feature(libc)]
+#![feature(path_ext)]
+#![feature(rand)]
#![feature(rustc_private)]
+#![feature(slice_bytes)]
#![feature(staged_api)]
-#![feature(rand)]
-#![feature(path_ext)]
#![feature(step_by)]
-#![feature(libc)]
-#![feature(fs_canonicalize)]
#![cfg_attr(test, feature(test, rand))]
extern crate syntax;
#![feature(box_patterns)]
#![feature(box_syntax)]
-#![cfg_attr(stage0, feature(collections))]
-#![feature(core)]
+#![feature(collections)]
+#![feature(num_bits_bytes)]
#![feature(quote)]
+#![feature(ref_slice)]
#![feature(rustc_diagnostic_macros)]
#![feature(rustc_private)]
#![feature(staged_api)]
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(collections)]
-#![feature(core)]
#![feature(const_fn)]
+#![feature(fs)]
+#![feature(iter_cmp)]
+#![feature(iter_sum)]
+#![feature(iter_unfold)]
#![feature(libc)]
+#![feature(path_ext)]
+#![feature(path_ext)]
+#![feature(path_relative_from)]
+#![feature(path_relative_from)]
#![feature(quote)]
#![feature(rustc_diagnostic_macros)]
#![feature(rustc_private)]
#![feature(staged_api)]
-#![feature(unicode)]
-#![feature(path_ext)]
-#![feature(path_relative_from)]
#![feature(std_misc)]
+#![feature(unicode)]
+#![feature(unicode)]
#![allow(trivial_casts)]
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(collections, collections_drain)]
-#![feature(core)]
+#![feature(iter_cmp)]
+#![feature(iter_sum)]
#![feature(quote)]
+#![feature(ref_slice)]
#![feature(rustc_diagnostic_macros)]
#![feature(rustc_private)]
#![feature(staged_api)]
#![cfg_attr(stage0, feature(custom_attribute))]
#![crate_name = "rustc_unicode"]
#![unstable(feature = "unicode")]
-#![feature(lang_items)]
-#![feature(staged_api)]
#![staged_api]
#![crate_type = "rlib"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
html_root_url = "http://doc.rust-lang.org/nightly/",
- html_playground_url = "http://play.rust-lang.org/")]
-#![feature(no_std)]
+ html_playground_url = "http://play.rust-lang.org/",
+ test(no_crate_inject))]
#![no_std]
+
#![feature(core)]
-#![doc(test(no_crate_inject))]
+#![feature(core_char_ext)]
+#![feature(core_prelude)]
+#![feature(core_slice_ext)]
+#![feature(core_str_ext)]
+#![feature(iter_sum)]
+#![feature(lang_items)]
+#![feature(no_std)]
+#![feature(staged_api)]
extern crate core;
#![feature(box_syntax)]
#![feature(collections)]
-#![feature(core)]
+#![feature(num_bits_bytes)]
+#![feature(num_wrapping)]
#![feature(rustc_private)]
#![feature(staged_api)]
#![feature(std_misc)]
-#![feature(unicode)]
#![feature(str_char)]
+#![feature(unicode)]
#![cfg_attr(test, feature(test))]
// test harness access
/// Get the `TypeId` of `self`
#[doc(hidden)]
- #[unstable(feature = "core",
+ #[unstable(feature = "error_type_id",
reason = "unclear whether to commit to this public implementation detail")]
fn type_id(&self) -> TypeId where Self: 'static {
TypeId::of::<Self>()
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
html_root_url = "http://doc.rust-lang.org/nightly/",
- html_playground_url = "http://play.rust-lang.org/")]
-#![doc(test(no_crate_inject, attr(deny(warnings))))]
-#![doc(test(attr(allow(dead_code, deprecated, unused_variables, unused_mut))))]
+ html_playground_url = "http://play.rust-lang.org/",
+ test(no_crate_inject, attr(deny(warnings))),
+ test(attr(allow(dead_code, deprecated, unused_variables, unused_mut))))]
#![feature(alloc)]
#![feature(allow_internal_unstable)]
#![feature(associated_consts)]
+#![feature(borrow_state)]
#![feature(box_syntax)]
+#![feature(char_internals)]
#![feature(collections)]
-#![feature(core)]
#![feature(const_fn)]
+#![feature(core)]
+#![feature(core_float)]
+#![feature(core_intrinsics)]
+#![feature(core_prelude)]
+#![feature(core_simd)]
+#![feature(fnbox)]
+#![feature(int_error_internals)]
#![feature(into_cow)]
+#![feature(iter_order)]
#![feature(lang_items)]
#![feature(libc)]
#![feature(linkage, thread_local, asm)]
#![feature(macro_reexport)]
+#![feature(no_std)]
+#![feature(num_bits_bytes)]
#![feature(optin_builtin_traits)]
#![feature(rand)]
+#![feature(raw)]
+#![feature(reflect_marker)]
+#![feature(slice_bytes)]
#![feature(slice_patterns)]
#![feature(staged_api)]
-#![feature(std_misc)]
#![feature(str_char)]
+#![feature(str_internals)]
#![feature(unboxed_closures)]
#![feature(unicode)]
#![feature(unique)]
#![feature(unsafe_no_drop_flag, filling_drop)]
+#![feature(wrapping)]
#![feature(zero_one)]
#![cfg_attr(test, feature(float_from_str_radix))]
#![cfg_attr(test, feature(test, rustc_private, std_misc))]
// Don't link to std. We are std.
-#![feature(no_std)]
#![no_std]
#![allow(trivial_casts)]
#![feature(associated_consts)]
#![feature(collections)]
#![feature(collections_drain)]
-#![feature(core)]
+#![feature(filling_drop)]
#![feature(libc)]
+#![feature(ref_slice)]
#![feature(rustc_private)]
#![feature(staged_api)]
#![feature(str_char)]