/// Weak pointers will not keep the data inside of the `Arc` alive, and can be used to break cycles
/// between `Arc` pointers.
#[unsafe_no_drop_flag]
-#[experimental = "Weak pointers may not belong in this module."]
+#[unstable = "Weak pointers may not belong in this module."]
pub struct Weak<T> {
// FIXME #12808: strange name to try to avoid interfering with
// field accesses of the contained type via Deref
///
/// let weak_five = five.downgrade();
/// ```
- #[experimental = "Weak pointers may not belong in this module."]
+ #[unstable = "Weak pointers may not belong in this module."]
pub fn downgrade(&self) -> Weak<T> {
// See the clone() impl for why this is relaxed
self.inner().weak.fetch_add(1, Relaxed);
/// Get the number of weak references to this value.
#[inline]
-#[experimental]
+#[unstable]
pub fn weak_count<T>(this: &Arc<T>) -> uint { this.inner().weak.load(SeqCst) - 1 }
/// Get the number of strong references to this value.
#[inline]
-#[experimental]
+#[unstable]
pub fn strong_count<T>(this: &Arc<T>) -> uint { this.inner().strong.load(SeqCst) }
#[stable]
/// let mut_five = five.make_unique();
/// ```
#[inline]
- #[experimental]
+ #[unstable]
pub fn make_unique(&mut self) -> &mut T {
// Note that we hold a strong reference, which also counts as a weak reference, so we only
// clone if there is an additional reference of either kind.
}
}
-#[experimental = "Weak pointers may not belong in this module."]
+#[unstable = "Weak pointers may not belong in this module."]
impl<T: Sync + Send> Weak<T> {
/// Upgrades a weak reference to a strong reference.
///
}
}
-#[experimental = "Weak pointers may not belong in this module."]
+#[unstable = "Weak pointers may not belong in this module."]
impl<T: Sync + Send> Clone for Weak<T> {
/// Makes a clone of the `Weak<T>`.
///
}
#[cfg(test)]
-#[allow(experimental)]
+#[allow(unstable)]
mod tests {
use std::clone::Clone;
use std::sync::mpsc::channel;
/// }
/// ```
#[lang = "exchange_heap"]
-#[experimental = "may be renamed; uncertain about custom allocator design"]
+#[unstable = "may be renamed; uncertain about custom allocator design"]
pub static HEAP: () = ();
/// A type that represents a uniquely-owned value.
//! default global allocator. It is not compatible with the libc allocator API.
#![crate_name = "alloc"]
-#![experimental]
+#![unstable]
#![staged_api]
#![crate_type = "rlib"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
///
/// let weak_five = five.downgrade();
/// ```
- #[experimental = "Weak pointers may not belong in this module"]
+ #[unstable = "Weak pointers may not belong in this module"]
pub fn downgrade(&self) -> Weak<T> {
self.inc_weak();
Weak {
/// Get the number of weak references to this value.
#[inline]
-#[experimental]
+#[unstable]
pub fn weak_count<T>(this: &Rc<T>) -> uint { this.weak() - 1 }
/// Get the number of strong references to this value.
#[inline]
-#[experimental]
+#[unstable]
pub fn strong_count<T>(this: &Rc<T>) -> uint { this.strong() }
/// Returns true if there are no other `Rc` or `Weak<T>` values that share the same inner value.
/// rc::is_unique(&five);
/// ```
#[inline]
-#[experimental]
+#[unstable]
pub fn is_unique<T>(rc: &Rc<T>) -> bool {
weak_count(rc) == 0 && strong_count(rc) == 1
}
/// assert_eq!(rc::try_unwrap(x), Err(Rc::new(4u)));
/// ```
#[inline]
-#[experimental]
+#[unstable]
pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> {
if is_unique(&rc) {
unsafe {
/// assert!(rc::get_mut(&mut x).is_none());
/// ```
#[inline]
-#[experimental]
+#[unstable]
pub fn get_mut<'a, T>(rc: &'a mut Rc<T>) -> Option<&'a mut T> {
if is_unique(rc) {
let inner = unsafe { &mut **rc._ptr };
/// let mut_five = five.make_unique();
/// ```
#[inline]
- #[experimental]
+ #[unstable]
pub fn make_unique(&mut self) -> &mut T {
if !is_unique(self) {
*self = Rc::new((**self).clone())
}
}
-#[experimental = "Show is experimental."]
+#[unstable = "Show is experimental."]
impl<T: fmt::Show> fmt::Show for Rc<T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "Rc({:?})", **self)
///
/// See the [module level documentation](../index.html) for more.
#[unsafe_no_drop_flag]
-#[experimental = "Weak pointers may not belong in this module."]
+#[unstable = "Weak pointers may not belong in this module."]
pub struct Weak<T> {
// FIXME #12808: strange names to try to avoid interfering with
// field accesses of the contained type via Deref
_noshare: marker::NoSync
}
-#[experimental = "Weak pointers may not belong in this module."]
+#[unstable = "Weak pointers may not belong in this module."]
impl<T> Weak<T> {
/// Upgrades a weak reference to a strong reference.
///
}
}
-#[experimental = "Weak pointers may not belong in this module."]
+#[unstable = "Weak pointers may not belong in this module."]
impl<T> Clone for Weak<T> {
/// Makes a clone of the `Weak<T>`.
///
}
}
-#[experimental = "Show is experimental."]
+#[unstable = "Show is experimental."]
impl<T: fmt::Show> fmt::Show for Weak<T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "(Weak)")
}
#[cfg(test)]
-#[allow(experimental)]
+#[allow(unstable)]
mod tests {
use super::{Rc, Weak, weak_count, strong_count};
use std::cell::RefCell;
//! more complex, slower arena which can hold objects of any type.
#![crate_name = "arena"]
-#![experimental]
+#![unstable]
#![staged_api]
#![crate_type = "rlib"]
#![crate_type = "dylib"]
#![crate_name = "collections"]
-#![experimental]
+#![unstable]
#![staged_api]
#![crate_type = "rlib"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
/// assert_eq!(num_moved, 3);
/// assert!(a == [6i, 7, 8, 4, 5]);
/// ```
- #[experimental = "uncertain about this API approach"]
+ #[unstable = "uncertain about this API approach"]
fn move_from(&mut self, src: Vec<Self::Item>, start: uint, end: uint) -> uint;
/// Returns a subslice spanning the interval [`start`, `end`).
/// original slice (i.e. when `end > self.len()`) or when `start > end`.
///
/// Slicing with `start` equal to `end` yields an empty slice.
- #[experimental = "will be replaced by slice syntax"]
+ #[unstable = "will be replaced by slice syntax"]
fn slice(&self, start: uint, end: uint) -> &[Self::Item];
/// Returns a subslice from `start` to the end of the slice.
/// Panics when `start` is strictly greater than the length of the original slice.
///
/// Slicing from `self.len()` yields an empty slice.
- #[experimental = "will be replaced by slice syntax"]
+ #[unstable = "will be replaced by slice syntax"]
fn slice_from(&self, start: uint) -> &[Self::Item];
/// Returns a subslice from the start of the slice to `end`.
/// Panics when `end` is strictly greater than the length of the original slice.
///
/// Slicing to `0` yields an empty slice.
- #[experimental = "will be replaced by slice syntax"]
+ #[unstable = "will be replaced by slice syntax"]
fn slice_to(&self, end: uint) -> &[Self::Item];
/// Divides one slice into two at an index.
fn first(&self) -> Option<&Self::Item>;
/// Returns all but the first element of a slice.
- #[experimental = "likely to be renamed"]
+ #[unstable = "likely to be renamed"]
fn tail(&self) -> &[Self::Item];
/// Returns all but the last element of a slice.
- #[experimental = "likely to be renamed"]
+ #[unstable = "likely to be renamed"]
fn init(&self) -> &[Self::Item];
/// Returns the last element of a slice, or `None` if it is empty.
/// original slice (i.e. when `end > self.len()`) or when `start > end`.
///
/// Slicing with `start` equal to `end` yields an empty slice.
- #[experimental = "will be replaced by slice syntax"]
+ #[unstable = "will be replaced by slice syntax"]
fn slice_mut(&mut self, start: uint, end: uint) -> &mut [Self::Item];
/// Returns a mutable subslice from `start` to the end of the slice.
/// Panics when `start` is strictly greater than the length of the original slice.
///
/// Slicing from `self.len()` yields an empty slice.
- #[experimental = "will be replaced by slice syntax"]
+ #[unstable = "will be replaced by slice syntax"]
fn slice_from_mut(&mut self, start: uint) -> &mut [Self::Item];
/// Returns a mutable subslice from the start of the slice to `end`.
/// Panics when `end` is strictly greater than the length of the original slice.
///
/// Slicing to `0` yields an empty slice.
- #[experimental = "will be replaced by slice syntax"]
+ #[unstable = "will be replaced by slice syntax"]
fn slice_to_mut(&mut self, end: uint) -> &mut [Self::Item];
/// Returns an iterator that allows modifying each value
fn first_mut(&mut self) -> Option<&mut Self::Item>;
/// Returns all but the first element of a mutable slice
- #[experimental = "likely to be renamed or removed"]
+ #[unstable = "likely to be renamed or removed"]
fn tail_mut(&mut self) -> &mut [Self::Item];
/// Returns all but the last element of a mutable slice
- #[experimental = "likely to be renamed or removed"]
+ #[unstable = "likely to be renamed or removed"]
fn init_mut(&mut self) -> &mut [Self::Item];
/// Returns a mutable pointer to the last item in the slice.
/// assert!(dst.clone_from_slice(&src2) == 3);
/// assert!(dst == [3i, 4, 5]);
/// ```
- #[experimental]
+ #[unstable]
fn clone_from_slice(&mut self, &[Self::Item]) -> uint where Self::Item: Clone;
/// Sorts the slice, in place.
fn prev_permutation(&mut self) -> bool where Self::Item: Ord;
/// Find the first index containing a matching value.
- #[experimental]
+ #[unstable]
fn position_elem(&self, t: &Self::Item) -> Option<uint> where Self::Item: PartialEq;
/// Find the last index containing a matching value.
- #[experimental]
+ #[unstable]
fn rposition_elem(&self, t: &Self::Item) -> Option<uint> where Self::Item: PartialEq;
/// Return true if the slice contains an element with the given value.
fn ends_with(&self, needle: &[Self::Item]) -> bool where Self::Item: PartialEq;
/// Convert `self` into a vector without clones or allocation.
- #[experimental]
+ #[unstable]
fn into_vec(self: Box<Self>) -> Vec<Self::Item>;
}
///
/// The last generated swap is always (0, 1), and it returns the
/// sequence to its initial order.
-#[experimental]
+#[unstable]
#[derive(Clone)]
pub struct ElementSwaps {
sdir: Vec<SizeDirection>,
impl ElementSwaps {
/// Creates an `ElementSwaps` iterator for a sequence of `length` elements.
- #[experimental]
+ #[unstable]
pub fn new(length: uint) -> ElementSwaps {
// Initialize `sdir` with a direction that position should move in
// (all negative at the beginning) and the `size` of the
/// assert_eq!(s.as_slice(), "hello");
/// ```
#[inline]
- #[experimental = "needs investigation to see if to_string() can match perf"]
+ #[unstable = "needs investigation to see if to_string() can match perf"]
pub fn from_str(string: &str) -> String {
String { vec: ::slice::SliceExt::to_vec(string.as_bytes()) }
}
}
}
-#[experimental = "waiting on Extend stabilization"]
+#[unstable = "waiting on Extend stabilization"]
impl Extend<char> for String {
fn extend<I:Iterator<Item=char>>(&mut self, mut iterator: I) {
let (lower_bound, _) = iterator.size_hint();
}
}
-#[experimental = "waiting on Extend stabilization"]
+#[unstable = "waiting on Extend stabilization"]
impl<'a> Extend<&'a str> for String {
fn extend<I: Iterator<Item=&'a str>>(&mut self, mut iterator: I) {
// A guess that at least one byte per iterator element will be needed.
fn ne(&self, other: &CowString<'a>) -> bool { PartialEq::ne(&**self, &**other) }
}
-#[experimental = "waiting on Str stabilization"]
+#[unstable = "waiting on Str stabilization"]
impl Str for String {
#[inline]
#[stable]
}
}
-#[experimental = "waiting on fmt stabilization"]
+#[unstable = "waiting on fmt stabilization"]
impl fmt::Show for String {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fmt::Show::fmt(&**self, f)
}
}
-#[experimental = "waiting on Hash stabilization"]
+#[unstable = "waiting on Hash stabilization"]
#[cfg(stage0)]
impl<H: hash::Writer> hash::Hash<H> for String {
#[inline]
(**self).hash(hasher)
}
}
-#[experimental = "waiting on Hash stabilization"]
+#[unstable = "waiting on Hash stabilization"]
#[cfg(not(stage0))]
impl<H: hash::Writer + hash::Hasher> hash::Hash<H> for String {
#[inline]
}
/// Wrapper type providing a `&String` reference via `Deref`.
-#[experimental]
+#[unstable]
pub struct DerefString<'a> {
x: DerefVec<'a, u8>
}
/// let string = as_string("foo").clone();
/// string_consumer(string);
/// ```
-#[experimental]
+#[unstable]
pub fn as_string<'a>(x: &'a str) -> DerefString<'a> {
DerefString { x: as_vec(x.as_bytes()) }
}
/// Note that this will drop any excess capacity. Calling this and
/// converting back to a vector with `into_vec()` is equivalent to calling
/// `shrink_to_fit()`.
- #[experimental]
+ #[unstable]
pub fn into_boxed_slice(mut self) -> Box<[T]> {
self.shrink_to_fit();
unsafe {
/// let newtyped_bytes = bytes.map_in_place(|x| Newtype(x));
/// assert_eq!(newtyped_bytes.as_slice(), [Newtype(0x11), Newtype(0x22)].as_slice());
/// ```
- #[experimental = "API may change to provide stronger guarantees"]
+ #[unstable = "API may change to provide stronger guarantees"]
pub fn map_in_place<U, F>(self, mut f: F) -> Vec<U> where F: FnMut(T) -> U {
// FIXME: Assert statically that the types `T` and `U` have the same
// size.
/// assert_eq!(vec, vec![1, 2, 3, 4]);
/// ```
#[inline]
- #[experimental = "likely to be replaced by a more optimized extend"]
+ #[unstable = "likely to be replaced by a more optimized extend"]
pub fn push_all(&mut self, other: &[T]) {
self.reserve(other.len());
}
}
-#[experimental = "waiting on Index stability"]
+#[unstable = "waiting on Index stability"]
impl<T> Index<uint> for Vec<T> {
type Output = T;
}
}
-#[experimental = "waiting on Extend stability"]
+#[unstable = "waiting on Extend stability"]
impl<T> Extend<T> for Vec<T> {
#[inline]
fn extend<I: Iterator<Item=T>>(&mut self, mut iterator: I) {
}
}
-#[experimental = "waiting on Show stability"]
+#[unstable = "waiting on Show stability"]
impl<T: fmt::Show> fmt::Show for Vec<T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fmt::Show::fmt(self.as_slice(), f)
// Clone-on-write
////////////////////////////////////////////////////////////////////////////////
-#[experimental = "unclear how valuable this alias is"]
+#[unstable = "unclear how valuable this alias is"]
/// A clone-on-write vector
pub type CowVec<'a, T> = Cow<'a, Vec<T>, [T]>;
////////////////////////////////////////////////////////////////////////////////
/// Wrapper type providing a `&Vec<T>` reference via `Deref`.
-#[experimental]
+#[unstable]
pub struct DerefVec<'a, T> {
x: Vec<T>,
l: ContravariantLifetime<'a>
}
-#[experimental]
+#[unstable]
impl<'a, T> Deref for DerefVec<'a, T> {
type Target = Vec<T>;
}
/// Convert a slice to a wrapper type providing a `&Vec<T>` reference.
-#[experimental]
+#[unstable]
pub fn as_vec<'a, T>(x: &'a [T]) -> DerefVec<'a, T> {
unsafe {
DerefVec {
#[stable]
pub trait Any: 'static {
/// Get the `TypeId` of `self`
- #[experimental = "this method will likely be replaced by an associated static"]
+ #[unstable = "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.
-#![experimental] // not yet reviewed
+#![unstable] // not yet reviewed
use clone::Clone;
use cmp::{PartialEq, Eq, PartialOrd, Ord, Ordering};
///
/// This function is `unsafe` because `UnsafeCell`'s field is public.
#[inline]
- #[experimental]
+ #[unstable]
pub unsafe fn as_unsafe_cell<'a>(&'a self) -> &'a UnsafeCell<T> {
&self.value
}
///
/// This function is `unsafe` because `UnsafeCell`'s field is public.
#[inline]
- #[experimental]
+ #[unstable]
pub unsafe fn as_unsafe_cell<'a>(&'a self) -> &'a UnsafeCell<T> {
&self.value
}
///
/// A `Clone` implementation would interfere with the widespread
/// use of `r.borrow().clone()` to clone the contents of a `RefCell`.
-#[experimental = "likely to be moved to a method, pending language changes"]
+#[unstable = "likely to be moved to a method, pending language changes"]
pub fn clone_ref<'b, T:Clone>(orig: &Ref<'b, T>) -> Ref<'b, T> {
Ref {
_value: orig._value,
macro_rules! extern_fn_clone {
($($A:ident),*) => (
- #[experimental = "this may not be sufficient for fns with region parameters"]
+ #[unstable = "this may not be sufficient for fns with region parameters"]
impl<$($A,)* ReturnType> Clone for extern "Rust" fn($($A),*) -> ReturnType {
/// Return a copy of a function pointer
#[inline]
///
/// Returns the first argument if the comparison determines them to be equal.
#[inline]
-#[experimental]
+#[unstable]
pub fn partial_min<T: PartialOrd>(v1: T, v2: T) -> Option<T> {
match v1.partial_cmp(&v2) {
Some(Less) | Some(Equal) => Some(v1),
///
/// Returns the first argument if the comparison determines them to be equal.
#[inline]
-#[experimental]
+#[unstable]
pub fn partial_max<T: PartialOrd>(v1: T, v2: T) -> Option<T> {
match v1.partial_cmp(&v2) {
Some(Less) => Some(v2),
//! # }
//! ```
-#![experimental]
+#![unstable]
use ops::{Drop, FnMut, FnOnce};
mod float;
pub mod rt;
-#[experimental = "core and I/O reconciliation may alter this definition"]
+#[unstable = "core and I/O reconciliation may alter this definition"]
/// The type returned by formatter methods.
pub type Result = result::Result<(), Error>;
/// This type does not support transmission of an error other than that an error
/// occurred. Any extra information must be arranged to be transmitted through
/// some other means.
-#[experimental = "core and I/O reconciliation may alter this definition"]
+#[unstable = "core and I/O reconciliation may alter this definition"]
#[derive(Copy)]
pub struct Error;
/// This trait should generally not be implemented by consumers of the standard
/// library. The `write!` macro accepts an instance of `io::Writer`, and the
/// `io::Writer` trait is favored over implementing this trait.
-#[experimental = "waiting for core and I/O reconciliation"]
+#[unstable = "waiting for core and I/O reconciliation"]
pub trait Writer {
/// Writes a slice of bytes into this writer, returning whether the write
/// succeeded.
/// family of functions. It contains a function to format the given value. At
/// 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.
-#[experimental = "implementation detail of the `format_args!` macro"]
+#[unstable = "implementation detail of the `format_args!` macro"]
#[derive(Copy)]
pub struct Argument<'a> {
value: &'a Void,
/// When using the format_args!() macro, this function is used to generate the
/// Arguments structure.
#[doc(hidden)] #[inline]
- #[experimental = "implementation detail of the `format_args!` macro"]
+ #[unstable = "implementation detail of the `format_args!` macro"]
pub fn new(pieces: &'a [&'a str],
args: &'a [Argument<'a>]) -> Arguments<'a> {
Arguments {
/// created with `argumentuint`. However, failing to do so doesn't cause
/// unsafety, but will ignore invalid .
#[doc(hidden)] #[inline]
- #[experimental = "implementation detail of the `format_args!` macro"]
+ #[unstable = "implementation detail of the `format_args!` macro"]
pub fn with_placeholders(pieces: &'a [&'a str],
fmt: &'a [rt::Argument<'a>],
args: &'a [Argument<'a>]) -> Arguments<'a> {
///
/// * output - the buffer to write output to
/// * args - the precompiled arguments generated by `format_args!`
-#[experimental = "libcore and I/O have yet to be reconciled, and this is an \
+#[unstable = "libcore and I/O have yet to be reconciled, and this is an \
implementation detail which should not otherwise be exported"]
pub fn write(output: &mut Writer, args: Arguments) -> Result {
let mut formatter = Formatter {
}
/// Flags for formatting (packed version of rt::Flag)
- #[experimental = "return type may change and method was just created"]
+ #[unstable = "return type may change and method was just created"]
pub fn flags(&self) -> uint { self.flags }
/// Character used as 'fill' whenever there is alignment
/// This is a function which calls are emitted to by the compiler itself to
/// create the Argument structures that are passed into the `format` function.
#[doc(hidden)] #[inline]
-#[experimental = "implementation detail of the `format_args!` macro"]
+#[unstable = "implementation detail of the `format_args!` macro"]
pub fn argument<'a, T>(f: fn(&T, &mut Formatter) -> Result,
t: &'a T) -> Argument<'a> {
Argument::new(t, f)
/// When the compiler determines that the type of an argument *must* be a uint
/// (such as for width and precision), then it invokes this method.
#[doc(hidden)] #[inline]
-#[experimental = "implementation detail of the `format_args!` macro"]
+#[unstable = "implementation detail of the `format_args!` macro"]
pub fn argumentuint<'a>(s: &'a uint) -> Argument<'a> {
Argument::from_uint(s)
}
//! These definitions are similar to their `ct` equivalents, but differ in that
//! these can be statically allocated and are slightly optimized for the runtime
-#![experimental = "implementation detail of the `format_args!` macro"]
+#![unstable = "implementation detail of the `format_args!` macro"]
pub use self::Alignment::*;
pub use self::Count::*;
//! guaranteed to happen in order. This is the standard mode for working
//! with atomic types and is equivalent to Java's `volatile`.
-#![experimental]
+#![unstable]
#![allow(missing_docs)]
#[cfg(not(stage0))]
/// Invokes memset on the specified pointer, setting `count * size_of::<T>()`
/// bytes of memory starting at `dst` to `c`.
- #[experimental = "uncertain about naming and semantics"]
+ #[unstable = "uncertain about naming and semantics"]
pub fn set_memory<T>(dst: *mut T, val: u8, count: uint);
/// Equivalent to the appropriate `llvm.memcpy.p0i8.0i8.*` intrinsic, with
}
/// Use an iterator to reverse a container in place.
- #[experimental = "uncertain about placement or widespread use"]
+ #[unstable = "uncertain about placement or widespread use"]
fn reverse_in_place<'a, T: 'a>(&mut self) where
Self: Iterator<Item=&'a mut T> + 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.
-#[experimental = "not widely used, may be better decomposed into Index and ExactSizeIterator"]
+#[unstable = "not widely used, may be better decomposed into Index and ExactSizeIterator"]
pub trait RandomAccessIterator: Iterator {
/// Return the number of indexable elements. At most `std::uint::MAX`
/// elements are indexable, even if the iterator represents a longer range.
fn next_back(&mut self) -> Option<<I as Iterator>::Item> { self.iter.next() }
}
-#[experimental = "trait is experimental"]
+#[unstable = "trait is experimental"]
impl<I> RandomAccessIterator for Rev<I> where I: DoubleEndedIterator + RandomAccessIterator {
#[inline]
fn indexable(&self) -> uint { self.iter.indexable() }
}
/// A trait for iterators over elements which can be added together
-#[experimental = "needs to be re-evaluated as part of numerics reform"]
+#[unstable = "needs to be re-evaluated as part of numerics reform"]
pub trait AdditiveIterator<A> {
/// Iterates over the entire iterator, summing up all the elements
///
macro_rules! impl_additive {
($A:ty, $init:expr) => {
- #[experimental = "trait is experimental"]
+ #[unstable = "trait is experimental"]
impl<T: Iterator<Item=$A>> AdditiveIterator<$A> for T {
#[inline]
fn sum(self) -> $A {
impl_additive! { f64, 0.0 }
/// A trait for iterators over elements which can be multiplied together.
-#[experimental = "needs to be re-evaluated as part of numerics reform"]
+#[unstable = "needs to be re-evaluated as part of numerics reform"]
pub trait MultiplicativeIterator<A> {
/// Iterates over the entire iterator, multiplying all the elements
///
macro_rules! impl_multiplicative {
($A:ty, $init:expr) => {
- #[experimental = "trait is experimental"]
+ #[unstable = "trait is experimental"]
impl<T: Iterator<Item=$A>> MultiplicativeIterator<$A> for T {
#[inline]
fn product(self) -> $A {
}
}
-#[experimental = "trait is experimental"]
+#[unstable = "trait is experimental"]
impl<I> RandomAccessIterator for Cycle<I> where
I: Clone + RandomAccessIterator,
{
}
}
-#[experimental = "trait is experimental"]
+#[unstable = "trait is experimental"]
impl<T, A, B> RandomAccessIterator for Chain<A, B> where
A: RandomAccessIterator<Item=T>,
B: RandomAccessIterator<Item=T>,
}
}
-#[experimental = "trait is experimental"]
+#[unstable = "trait is experimental"]
impl<T, U, A, B> RandomAccessIterator for Zip<A, B> where
A: RandomAccessIterator<Item=T>,
B: RandomAccessIterator<Item=U>,
}
}
-#[experimental = "trait is experimental"]
+#[unstable = "trait is experimental"]
impl<A, B, I, F> RandomAccessIterator for Map<A, B, I, F> where
I: RandomAccessIterator<Item=A>,
F: FnMut(A) -> B,
}
}
-#[experimental = "trait is experimental"]
+#[unstable = "trait is experimental"]
impl<I> RandomAccessIterator for Enumerate<I> where I: RandomAccessIterator {
#[inline]
fn indexable(&self) -> uint {
}
}
-#[experimental = "trait is experimental"]
+#[unstable = "trait is experimental"]
impl<I> RandomAccessIterator for Skip<I> where I: RandomAccessIterator{
#[inline]
fn indexable(&self) -> uint {
}
}
-#[experimental = "trait is experimental"]
+#[unstable = "trait is experimental"]
impl<I> RandomAccessIterator for Take<I> where I: RandomAccessIterator{
#[inline]
fn indexable(&self) -> uint {
}
// Allow RandomAccessIterators to be fused without affecting random-access behavior
-#[experimental = "trait is experimental"]
+#[unstable = "trait is experimental"]
impl<I> RandomAccessIterator for Fuse<I> where I: RandomAccessIterator {
#[inline]
fn indexable(&self) -> uint {
/// Resets the fuse such that the next call to .next() or .next_back() will
/// call the underlying iterator again even if it previously returned None.
#[inline]
- #[experimental = "seems marginal"]
+ #[unstable = "seems marginal"]
pub fn reset_fuse(&mut self) {
self.done = false
}
}
}
-#[experimental = "trait is experimental"]
+#[unstable = "trait is experimental"]
impl<A, I, F> RandomAccessIterator for Inspect<A, I, F> where
I: RandomAccessIterator<Item=A>,
F: FnMut(&A),
/// println!("{}", i);
/// }
/// ```
-#[experimental]
+#[unstable]
pub struct Unfold<A, St, F> where F: FnMut(&mut St) -> Option<A> {
f: F,
/// Internal state that will be passed to the closure on the next iteration
}
}
-#[experimental]
+#[unstable]
impl<A, St, F> Unfold<A, 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
fn next_back(&mut self) -> Option<A> { self.idx(0) }
}
-#[experimental = "trait is experimental"]
+#[unstable = "trait is experimental"]
impl<A: Clone> RandomAccessIterator for Repeat<A> {
#[inline]
fn indexable(&self) -> uint { uint::MAX }
/// An iterator that repeatedly applies a given function, starting
/// from a given seed value.
-#[experimental]
+#[unstable]
pub type Iterate<T, F> = Unfold<T, IterateState<T, F>, fn(&mut IterateState<T, F>) -> Option<T>>;
/// Create a new iterator that produces an infinite sequence of
/// repeated applications of the given function `f`.
-#[experimental]
+#[unstable]
pub fn iterate<T, F>(seed: T, f: F) -> Iterate<T, F> where
T: Clone,
F: FnMut(T) -> T,
// separate crate, libcoretest, to avoid bizarre issues.
#![crate_name = "core"]
-#![experimental]
+#![unstable]
#![staged_api]
#![crate_type = "rlib"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
/// NULL or 0 that might allow certain optimizations.
#[lang="non_zero"]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Show)]
-#[experimental]
+#[unstable]
pub struct NonZero<T: Zeroable>(T);
impl<T: Zeroable> NonZero<T> {
impl UnsignedInt for u64 {}
/// A generic trait for converting a value to a number.
-#[experimental = "trait is likely to be removed"]
+#[unstable = "trait is likely to be removed"]
pub trait ToPrimitive {
/// Converts the value of `self` to an `int`.
#[inline]
impl_to_primitive_float! { f64 }
/// A generic trait for converting a number to a value.
-#[experimental = "trait is likely to be removed"]
+#[unstable = "trait is likely to be removed"]
pub trait FromPrimitive : ::marker::Sized {
/// Convert an `int` to return an optional value of this type. If the
/// value cannot be represented by this value, the `None` is returned.
}
/// A utility function that just calls `FromPrimitive::from_int`.
-#[experimental = "likely to be removed"]
+#[unstable = "likely to be removed"]
pub fn from_int<A: FromPrimitive>(n: int) -> Option<A> {
FromPrimitive::from_int(n)
}
/// A utility function that just calls `FromPrimitive::from_i8`.
-#[experimental = "likely to be removed"]
+#[unstable = "likely to be removed"]
pub fn from_i8<A: FromPrimitive>(n: i8) -> Option<A> {
FromPrimitive::from_i8(n)
}
/// A utility function that just calls `FromPrimitive::from_i16`.
-#[experimental = "likely to be removed"]
+#[unstable = "likely to be removed"]
pub fn from_i16<A: FromPrimitive>(n: i16) -> Option<A> {
FromPrimitive::from_i16(n)
}
/// A utility function that just calls `FromPrimitive::from_i32`.
-#[experimental = "likely to be removed"]
+#[unstable = "likely to be removed"]
pub fn from_i32<A: FromPrimitive>(n: i32) -> Option<A> {
FromPrimitive::from_i32(n)
}
/// A utility function that just calls `FromPrimitive::from_i64`.
-#[experimental = "likely to be removed"]
+#[unstable = "likely to be removed"]
pub fn from_i64<A: FromPrimitive>(n: i64) -> Option<A> {
FromPrimitive::from_i64(n)
}
/// A utility function that just calls `FromPrimitive::from_uint`.
-#[experimental = "likely to be removed"]
+#[unstable = "likely to be removed"]
pub fn from_uint<A: FromPrimitive>(n: uint) -> Option<A> {
FromPrimitive::from_uint(n)
}
/// A utility function that just calls `FromPrimitive::from_u8`.
-#[experimental = "likely to be removed"]
+#[unstable = "likely to be removed"]
pub fn from_u8<A: FromPrimitive>(n: u8) -> Option<A> {
FromPrimitive::from_u8(n)
}
/// A utility function that just calls `FromPrimitive::from_u16`.
-#[experimental = "likely to be removed"]
+#[unstable = "likely to be removed"]
pub fn from_u16<A: FromPrimitive>(n: u16) -> Option<A> {
FromPrimitive::from_u16(n)
}
/// A utility function that just calls `FromPrimitive::from_u32`.
-#[experimental = "likely to be removed"]
+#[unstable = "likely to be removed"]
pub fn from_u32<A: FromPrimitive>(n: u32) -> Option<A> {
FromPrimitive::from_u32(n)
}
/// A utility function that just calls `FromPrimitive::from_u64`.
-#[experimental = "likely to be removed"]
+#[unstable = "likely to be removed"]
pub fn from_u64<A: FromPrimitive>(n: u64) -> Option<A> {
FromPrimitive::from_u64(n)
}
/// A utility function that just calls `FromPrimitive::from_f32`.
-#[experimental = "likely to be removed"]
+#[unstable = "likely to be removed"]
pub fn from_f32<A: FromPrimitive>(n: f32) -> Option<A> {
FromPrimitive::from_f32(n)
}
/// A utility function that just calls `FromPrimitive::from_f64`.
-#[experimental = "likely to be removed"]
+#[unstable = "likely to be removed"]
pub fn from_f64<A: FromPrimitive>(n: f64) -> Option<A> {
FromPrimitive::from_f64(n)
}
/// ```
///
#[inline]
-#[experimental = "likely to be removed"]
+#[unstable = "likely to be removed"]
pub fn cast<T: NumCast,U: NumCast>(n: T) -> Option<U> {
NumCast::from(n)
}
/// An interface for casting between machine scalars.
-#[experimental = "trait is likely to be removed"]
+#[unstable = "trait is likely to be removed"]
pub trait NumCast: ToPrimitive {
/// Creates a number from another value that can be converted into a primitive via the
/// `ToPrimitive` trait.
}
/// A generic trait for converting a string with a radix (base) to a value
-#[experimental = "might need to return Result"]
+#[unstable = "might need to return Result"]
pub trait FromStrRadix {
fn from_str_radix(str: &str, radix: uint) -> Option<Self>;
}
/// A utility function that just calls FromStrRadix::from_str_radix.
-#[experimental = "might need to return Result"]
+#[unstable = "might need to return Result"]
pub fn from_str_radix<T: FromStrRadix>(str: &str, radix: uint) -> Option<T> {
FromStrRadix::from_str_radix(str, radix)
}
macro_rules! from_str_radix_float_impl {
($T:ty) => {
- #[experimental = "might need to return Result"]
+ #[unstable = "might need to return Result"]
impl FromStr for $T {
/// Convert a string in base 10 to a float.
/// Accepts an optional decimal exponent.
}
}
- #[experimental = "might need to return Result"]
+ #[unstable = "might need to return Result"]
impl FromStrRadix for $T {
/// Convert a string in a given base to a float.
///
macro_rules! from_str_radix_int_impl {
($T:ty) => {
- #[experimental = "might need to return Result"]
+ #[unstable = "might need to return Result"]
impl FromStr for $T {
#[inline]
fn from_str(src: &str) -> Option<$T> {
}
}
- #[experimental = "might need to return Result"]
+ #[unstable = "might need to return Result"]
impl FromStrRadix for $T {
fn from_str_radix(src: &str, radix: uint) -> Option<$T> {
assert!(radix >= 2 && radix <= 36,
/// assert_eq!(x.ok_or(0i), Err(0i));
/// ```
#[inline]
- #[experimental]
+ #[unstable]
pub fn ok_or<E>(self, err: E) -> Result<T, E> {
match self {
Some(v) => Ok(v),
/// assert_eq!(x.ok_or_else(|| 0i), Err(0i));
/// ```
#[inline]
- #[experimental]
+ #[unstable]
pub fn ok_or_else<E, F: FnOnce() -> E>(self, err: F) -> Result<T, E> {
match self {
Some(v) => Ok(v),
#[unstable]
pub use intrinsics::copy_memory;
-#[experimental = "uncertain about naming and semantics"]
+#[unstable = "uncertain about naming and semantics"]
pub use intrinsics::set_memory;
// except according to those terms.
#![allow(missing_docs)]
-#![experimental]
+#![unstable]
//! Contains struct definitions for the layout of compiler built-in types.
//!
/// If an `Err` is encountered, it is immediately returned.
/// Otherwise, the folded value is returned.
#[inline]
-#[experimental]
+#[unstable]
pub fn fold<T,
V,
E,
//! provided beyond this module.
//!
//! ```rust
-//! #[allow(experimental)];
+//! #[allow(unstable)];
//!
//! fn main() {
//! use std::simd::f32x4;
#![allow(non_camel_case_types)]
#![allow(missing_docs)]
-#[experimental]
+#[unstable]
#[simd]
#[derive(Copy, Show)]
#[repr(C)]
pub i8, pub i8, pub i8, pub i8,
pub i8, pub i8, pub i8, pub i8);
-#[experimental]
+#[unstable]
#[simd]
#[derive(Copy, Show)]
#[repr(C)]
pub struct i16x8(pub i16, pub i16, pub i16, pub i16,
pub i16, pub i16, pub i16, pub i16);
-#[experimental]
+#[unstable]
#[simd]
#[derive(Copy, Show)]
#[repr(C)]
pub struct i32x4(pub i32, pub i32, pub i32, pub i32);
-#[experimental]
+#[unstable]
#[simd]
#[derive(Copy, Show)]
#[repr(C)]
pub struct i64x2(pub i64, pub i64);
-#[experimental]
+#[unstable]
#[simd]
#[derive(Copy, Show)]
#[repr(C)]
pub u8, pub u8, pub u8, pub u8,
pub u8, pub u8, pub u8, pub u8);
-#[experimental]
+#[unstable]
#[simd]
#[derive(Copy, Show)]
#[repr(C)]
pub struct u16x8(pub u16, pub u16, pub u16, pub u16,
pub u16, pub u16, pub u16, pub u16);
-#[experimental]
+#[unstable]
#[simd]
#[derive(Copy, Show)]
#[repr(C)]
pub struct u32x4(pub u32, pub u32, pub u32, pub u32);
-#[experimental]
+#[unstable]
#[simd]
#[derive(Copy, Show)]
#[repr(C)]
pub struct u64x2(pub u64, pub u64);
-#[experimental]
+#[unstable]
#[simd]
#[derive(Copy, Show)]
#[repr(C)]
pub struct f32x4(pub f32, pub f32, pub f32, pub f32);
-#[experimental]
+#[unstable]
#[simd]
#[derive(Copy, Show)]
#[repr(C)]
self.binary_search_by(|p| p.cmp(x))
}
- #[experimental]
+ #[unstable]
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
}
- #[experimental]
+ #[unstable]
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; }
////////////////////////////////////////////////////////////////////////////////
/// Data that is viewable as a slice.
-#[experimental = "will be replaced by slice syntax"]
+#[unstable = "will be replaced by slice syntax"]
pub trait AsSlice<T> {
/// Work with `self` as a slice.
fn as_slice<'a>(&'a self) -> &'a [T];
}
-#[experimental = "trait is experimental"]
+#[unstable = "trait is experimental"]
impl<T> AsSlice<T> for [T] {
#[inline(always)]
fn as_slice<'a>(&'a self) -> &'a [T] { self }
}
-#[experimental = "trait is experimental"]
+#[unstable = "trait is experimental"]
impl<'a, T, U: ?Sized + AsSlice<T>> AsSlice<T> for &'a U {
#[inline(always)]
fn as_slice(&self) -> &[T] { AsSlice::as_slice(*self) }
}
-#[experimental = "trait is experimental"]
+#[unstable = "trait is experimental"]
impl<'a, T, U: ?Sized + AsSlice<T>> AsSlice<T> for &'a mut U {
#[inline(always)]
fn as_slice(&self) -> &[T] { AsSlice::as_slice(*self) }
marker: marker::ContravariantLifetime<'a>
}
-#[experimental]
+#[unstable]
impl<'a, T> ops::Index<ops::Range<uint>> for Iter<'a, T> {
type Output = [T];
#[inline]
}
}
-#[experimental]
+#[unstable]
impl<'a, T> ops::Index<ops::RangeTo<uint>> for Iter<'a, T> {
type Output = [T];
#[inline]
}
}
-#[experimental]
+#[unstable]
impl<'a, T> ops::Index<ops::RangeFrom<uint>> for Iter<'a, T> {
type Output = [T];
#[inline]
}
}
-#[experimental]
+#[unstable]
impl<'a, T> ops::Index<ops::FullRange> for Iter<'a, T> {
type Output = [T];
#[inline]
///
/// This has the same lifetime as the original slice, and so the
/// iterator can continue to be used while this exists.
- #[experimental]
+ #[unstable]
pub fn as_slice(&self) -> &'a [T] {
make_slice!(T => &'a [T]: self.ptr, self.end)
}
fn clone(&self) -> Iter<'a, T> { *self }
}
-#[experimental = "trait is experimental"]
+#[unstable = "trait is experimental"]
impl<'a, T> RandomAccessIterator for Iter<'a, T> {
#[inline]
fn indexable(&self) -> uint {
}
-#[experimental]
+#[unstable]
impl<'a, T> ops::Index<ops::Range<uint>> for IterMut<'a, T> {
type Output = [T];
#[inline]
self.index(&ops::FullRange).index(index)
}
}
-#[experimental]
+#[unstable]
impl<'a, T> ops::Index<ops::RangeTo<uint>> for IterMut<'a, T> {
type Output = [T];
#[inline]
self.index(&ops::FullRange).index(index)
}
}
-#[experimental]
+#[unstable]
impl<'a, T> ops::Index<ops::RangeFrom<uint>> for IterMut<'a, T> {
type Output = [T];
#[inline]
self.index(&ops::FullRange).index(index)
}
}
-#[experimental]
+#[unstable]
impl<'a, T> ops::Index<ops::FullRange> for IterMut<'a, T> {
type Output = [T];
#[inline]
}
}
-#[experimental]
+#[unstable]
impl<'a, T> ops::IndexMut<ops::Range<uint>> for IterMut<'a, T> {
type Output = [T];
#[inline]
self.index_mut(&ops::FullRange).index_mut(index)
}
}
-#[experimental]
+#[unstable]
impl<'a, T> ops::IndexMut<ops::RangeTo<uint>> for IterMut<'a, T> {
type Output = [T];
#[inline]
self.index_mut(&ops::FullRange).index_mut(index)
}
}
-#[experimental]
+#[unstable]
impl<'a, T> ops::IndexMut<ops::RangeFrom<uint>> for IterMut<'a, T> {
type Output = [T];
#[inline]
self.index_mut(&ops::FullRange).index_mut(index)
}
}
-#[experimental]
+#[unstable]
impl<'a, T> ops::IndexMut<ops::FullRange> for IterMut<'a, T> {
type Output = [T];
#[inline]
/// to consume the iterator. Consider using the `Slice` and
/// `SliceMut` implementations for obtaining slices with more
/// restricted lifetimes that do not consume the iterator.
- #[experimental]
+ #[unstable]
pub fn into_slice(self) -> &'a mut [T] {
make_slice!(T => &'a mut [T]: self.ptr, self.end)
}
}
}
-#[experimental = "trait is experimental"]
+#[unstable = "trait is experimental"]
impl<'a, T> RandomAccessIterator for Chunks<'a, T> {
#[inline]
fn indexable(&self) -> uint {
//
/// Operations on `[u8]`.
-#[experimental = "needs review"]
+#[unstable = "needs review"]
pub mod bytes {
use ptr;
use slice::SliceExt;
impl MutableByteVector for [u8] {
#[inline]
- #[allow(experimental)]
+ #[allow(unstable)]
fn set_memory(&mut self, value: u8) {
unsafe { ptr::set_memory(self.as_mut_ptr(), value, self.len()) };
}
}
/// Extension methods for slices containing integers.
-#[experimental]
+#[unstable]
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) => {
- #[experimental]
+ #[unstable]
impl IntSliceExt<$u, $s> for [$t] {
#[inline]
fn as_unsigned(&self) -> &[$u] { unsafe { transmute(self) } }
}
#[test]
-#[allow(experimental)]
+#[allow(unstable)]
fn clone_ref_updates_flag() {
let x = RefCell::new(0i);
{
//! [mz]: https://code.google.com/p/miniz/
#![crate_name = "flate"]
-#![experimental]
+#![unstable]
#![staged_api]
#![crate_type = "rlib"]
#![crate_type = "dylib"]
//! generated instead.
#![crate_name = "fmt_macros"]
-#![experimental]
+#![unstable]
#![staged_api]
#![crate_type = "rlib"]
#![crate_type = "dylib"]
//! ```
#![crate_name = "getopts"]
-#![experimental = "use the crates.io `getopts` library instead"]
+#![unstable = "use the crates.io `getopts` library instead"]
#![staged_api]
#![crate_type = "rlib"]
#![crate_type = "dylib"]
//! * [DOT language](http://www.graphviz.org/doc/info/lang.html)
#![crate_name = "graphviz"]
-#![experimental]
+#![unstable]
#![staged_api]
#![crate_type = "rlib"]
#![crate_type = "dylib"]
#![crate_name = "libc"]
#![crate_type = "rlib"]
-#![cfg_attr(not(feature = "cargo-build"), experimental)]
+#![cfg_attr(not(feature = "cargo-build"), unstable)]
#![cfg_attr(not(feature = "cargo-build"), staged_api)]
#![no_std]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
//! if logging is disabled, none of the components of the log will be executed.
#![crate_name = "log"]
-#![experimental = "use the crates.io `log` library instead"]
+#![unstable = "use the crates.io `log` library instead"]
#![staged_api]
#![crate_type = "rlib"]
#![crate_type = "dylib"]
//! internally. The `IndependentSample` trait is for generating values
//! that do not need to record state.
-#![experimental]
+#![unstable]
use core::prelude::*;
use core::num::{Float, Int};
html_playground_url = "http://play.rust-lang.org/")]
#![no_std]
-#![experimental]
+#![unstable]
#![staged_api]
#[macro_use]
//! http://www.matroska.org/technical/specs/rfc/index.html
#![crate_name = "rbml"]
-#![experimental]
+#![unstable]
#![staged_api]
#![crate_type = "rlib"]
#![crate_type = "dylib"]
#![crate_name = "regex"]
#![crate_type = "rlib"]
#![crate_type = "dylib"]
-#![experimental = "use the crates.io `regex` library instead"]
+#![unstable = "use the crates.io `regex` library instead"]
#![staged_api]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
}
#[doc(hidden)]
- #[experimental]
+ #[unstable]
pub fn names_iter<'a>(&'a self) -> NamesIter<'a> {
match *self {
Native(ref n) => NamesIterNative(n.names.iter()),
}
impl<'t> Captures<'t> {
- #[allow(experimental)]
+ #[allow(unstable)]
fn new(re: &Regex, search: &'t str, locs: CaptureLocs)
-> Option<Captures<'t>> {
if !has_match(&locs) {
//! This API is completely unstable and subject to change.
#![crate_name = "rustc"]
-#![experimental]
+#![unstable]
#![staged_api]
#![crate_type = "dylib"]
#![crate_type = "rlib"]
Warn,
"detects use of #[deprecated] items"
}
-// FIXME #6875: Change to Warn after std library stabilization is complete
-declare_lint! {
- EXPERIMENTAL,
- Allow,
- "detects use of #[experimental] items"
-}
declare_lint! {
UNSTABLE,
- Allow,
+ Warn,
"detects use of #[unstable] items (incl. items with no stability attribute)"
}
-declare_lint!(STAGED_EXPERIMENTAL, Warn,
- "detects use of #[experimental] items in staged builds");
-
-declare_lint!(STAGED_UNSTABLE, Warn,
- "detects use of #[unstable] items (incl. items with no stability attribute) \
- in staged builds");
-
-/// Checks for use of items with `#[deprecated]`, `#[experimental]` and
+/// Checks for use of items with `#[deprecated]`, `#[unstable]` and
/// `#[unstable]` attributes, or no stability attribute.
#[derive(Copy)]
-pub struct Stability;
+pub struct Stability { this_crate_staged: bool }
impl Stability {
+ pub fn new() -> Stability { Stability { this_crate_staged: false } }
+
fn lint(&self, cx: &Context, id: ast::DefId, span: Span) {
let ref stability = stability::lookup(cx.tcx, id);
let cross_crate = !ast_util::is_local(id);
+ let staged = (!cross_crate && self.this_crate_staged)
+ || (cross_crate && stability::is_staged_api(cx.tcx, id));
+
+ if !staged { return }
// stability attributes are promises made across crates; only
// check DEPRECATED for crate-local usage.
None if cross_crate => (UNSTABLE, "unmarked"),
Some(attr::Stability { level: attr::Unstable, .. }) if cross_crate =>
(UNSTABLE, "unstable"),
- Some(attr::Stability { level: attr::Experimental, .. }) if cross_crate =>
- (EXPERIMENTAL, "experimental"),
Some(attr::Stability { level: attr::Deprecated, .. }) =>
(DEPRECATED, "deprecated"),
_ => return
};
output(cx, span, stability, lint, label);
- if cross_crate && stability::is_staged_api(cx.tcx, id) {
- if lint.name == UNSTABLE.name {
- output(cx, span, stability, STAGED_UNSTABLE, label);
- } else if lint.name == EXPERIMENTAL.name {
- output(cx, span, stability, STAGED_EXPERIMENTAL, label);
- }
- }
fn output(cx: &Context, span: Span, stability: &Option<attr::Stability>,
lint: &'static Lint, label: &'static str) {
impl LintPass for Stability {
fn get_lints(&self) -> LintArray {
- lint_array!(DEPRECATED, EXPERIMENTAL, UNSTABLE, STAGED_EXPERIMENTAL, STAGED_UNSTABLE)
+ lint_array!(DEPRECATED, UNSTABLE)
}
fn check_crate(&mut self, _: &Context, c: &ast::Crate) {
match attr.node.value.node {
ast::MetaWord(_) => {
attr::mark_used(attr);
+ self.this_crate_staged = true;
}
_ => (/*pass*/)
}
UnsafeBlocks,
UnusedMut,
UnusedAllocation,
- Stability,
MissingCopyImplementations,
UnstableFeatures,
);
TypeLimits,
RawPointerDerive,
MissingDoc,
+ Stability,
);
add_lint_group!(sess, "bad_style",
UnstableFeatures::Cheat => Allow
};
match self.by_name.get("unstable_features") {
- Some(&Id(lint_id)) => self.set_level(lint_id, (lvl, ReleaseChannel)),
- Some(&Renamed(_, lint_id)) => self.set_level(lint_id, (lvl, ReleaseChannel)),
- None => unreachable!()
- }
- match self.by_name.get("staged_unstable") {
- Some(&Id(lint_id)) => self.set_level(lint_id, (lvl, ReleaseChannel)),
- Some(&Renamed(_, lint_id)) => self.set_level(lint_id, (lvl, ReleaseChannel)),
+ Some(&Id(lint_id)) => if self.get_level_source(lint_id).0 != Forbid {
+ self.set_level(lint_id, (lvl, ReleaseChannel))
+ },
+ Some(&Renamed(_, lint_id)) => if self.get_level_source(lint_id).0 != Forbid {
+ self.set_level(lint_id, (lvl, ReleaseChannel))
+ },
None => unreachable!()
}
- match self.by_name.get("staged_experimental") {
- Some(&Id(lint_id)) => self.set_level(lint_id, (lvl, ReleaseChannel)),
- Some(&Renamed(_, lint_id)) => self.set_level(lint_id, (lvl, ReleaseChannel)),
+ match self.by_name.get("unstable") {
+ Some(&Id(lint_id)) => if self.get_level_source(lint_id).0 != Forbid {
+ self.set_level(lint_id, (lvl, ReleaseChannel))
+ },
+ Some(&Renamed(_, lint_id)) => if self.get_level_source(lint_id).0 != Forbid {
+ self.set_level(lint_id, (lvl, ReleaseChannel))
+ },
None => unreachable!()
}
}
pub use lint::context::{Context, LintStore, raw_emit_lint, check_crate, gather_attrs};
/// Specification of a single lint.
-#[derive(Copy)]
+#[derive(Copy, Show)]
pub struct Lint {
/// A string identifier for the lint.
///
}
/// Setting for how to handle a lint.
-#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord)]
+#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Show)]
pub enum Level {
Allow, Warn, Deny, Forbid
}
//! build speedups.
#![crate_name = "rustc_back"]
-#![experimental]
+#![unstable]
#![staged_api]
#![crate_type = "dylib"]
#![crate_type = "rlib"]
// except according to those terms.
#![crate_name = "rustc_borrowck"]
-#![experimental]
+#![unstable]
#![staged_api]
#![crate_type = "dylib"]
#![crate_type = "rlib"]
//! This API is completely unstable and subject to change.
#![crate_name = "rustc_driver"]
-#![experimental]
+#![unstable]
#![staged_api]
#![crate_type = "dylib"]
#![crate_type = "rlib"]
#![allow(dead_code)]
#![crate_name = "rustc_llvm"]
-#![experimental]
+#![unstable]
#![staged_api]
#![crate_type = "dylib"]
#![crate_type = "rlib"]
// except according to those terms.
#![crate_name = "rustc_resolve"]
-#![experimental]
+#![unstable]
#![staged_api]
#![crate_type = "dylib"]
#![crate_type = "rlib"]
//! This API is completely unstable and subject to change.
#![crate_name = "rustc_trans"]
-#![experimental]
+#![unstable]
#![staged_api]
#![crate_type = "dylib"]
#![crate_type = "rlib"]
*/
#![crate_name = "rustc_typeck"]
-#![experimental]
+#![unstable]
#![staged_api]
#![crate_type = "dylib"]
#![crate_type = "rlib"]
// except according to those terms.
#![crate_name = "rustdoc"]
-#![experimental]
+#![unstable]
#![staged_api]
#![crate_type = "dylib"]
#![crate_type = "rlib"]
use vec::Vec;
/// Extension methods for ASCII-subset only operations on owned strings
-#[experimental = "would prefer to do this in a more general way"]
+#[unstable = "would prefer to do this in a more general way"]
pub trait OwnedAsciiExt {
/// Convert the string to ASCII upper case:
/// ASCII letters 'a' to 'z' are mapped to 'A' to 'Z',
}
/// Extension methods for ASCII-subset only operations on string slices
-#[experimental = "would prefer to do this in a more general way"]
+#[unstable = "would prefer to do this in a more general way"]
pub trait AsciiExt<T = Self> {
/// Check if within the ASCII range.
fn is_ascii(&self) -> bool;
fn eq_ignore_ascii_case(&self, other: &Self) -> bool;
}
-#[experimental = "would prefer to do this in a more general way"]
+#[unstable = "would prefer to do this in a more general way"]
impl AsciiExt<String> for str {
#[inline]
fn is_ascii(&self) -> bool {
}
}
-#[experimental = "would prefer to do this in a more general way"]
+#[unstable = "would prefer to do this in a more general way"]
impl OwnedAsciiExt for String {
#[inline]
fn into_ascii_uppercase(self) -> String {
}
}
-#[experimental = "would prefer to do this in a more general way"]
+#[unstable = "would prefer to do this in a more general way"]
impl AsciiExt<Vec<u8>> for [u8] {
#[inline]
fn is_ascii(&self) -> bool {
}
}
-#[experimental = "would prefer to do this in a more general way"]
+#[unstable = "would prefer to do this in a more general way"]
impl OwnedAsciiExt for Vec<u8> {
#[inline]
fn into_ascii_uppercase(mut self) -> Vec<u8> {
}
}
-#[experimental = "would prefer to do this in a more general way"]
+#[unstable = "would prefer to do this in a more general way"]
impl AsciiExt for u8 {
#[inline]
fn is_ascii(&self) -> bool {
}
}
-#[experimental = "would prefer to do this in a more general way"]
+#[unstable = "would prefer to do this in a more general way"]
impl AsciiExt for char {
#[inline]
fn is_ascii(&self) -> bool {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![experimental]
+#![unstable]
//! A typesafe bitmask flag generator.
/// Creates a new raw table from a given capacity. All buckets are
/// initially empty.
- #[allow(experimental)]
+ #[allow(unstable)]
pub fn new(capacity: uint) -> RawTable<K, V> {
unsafe {
let ret = RawTable::new_uninitialized(capacity);
//!
//! A simple wrapper over the platform's dynamic library facilities
-#![experimental]
+#![unstable]
#![allow(missing_docs)]
use prelude::v1::*;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![experimental]
+#![unstable]
use prelude::v1::*;
//! them with the same character. For example, the `{` character is escaped with
//! `{{` and the `}` character is escaped with `}}`.
-#![experimental]
+#![unstable]
use string;
/// let s = fmt::format(format_args!("Hello, {}!", "world"));
/// assert_eq!(s, "Hello, world!".to_string());
/// ```
-#[experimental = "this is an implementation detail of format! and should not \
+#[unstable = "this is an implementation detail of format! and should not \
be called directly"]
pub fn format(args: Arguments) -> string::String {
let mut output = string::String::new();
//! concerned with error handling; instead its caller is responsible for
//! responding to errors that may occur while attempting to read the numbers.
-#![experimental]
+#![unstable]
#![deny(unused_must_use)]
pub use self::SeekStyle::*;
///
/// If a `timeout` with zero or negative duration is specified then
/// the function returns `Err`, with the error kind set to `TimedOut`.
- #[experimental = "the timeout argument is likely to change types"]
+ #[unstable = "the timeout argument is likely to change types"]
pub fn connect_timeout<P>(path: P, timeout: Duration)
-> IoResult<UnixStream>
where P: BytesContainer {
/// Sets the read/write timeout for this socket.
///
/// For more information, see `TcpStream::set_timeout`
- #[experimental = "the timeout argument may change in type and value"]
+ #[unstable = "the timeout argument may change in type and value"]
pub fn set_timeout(&mut self, timeout_ms: Option<u64>) {
self.inner.set_timeout(timeout_ms)
}
/// Sets the read timeout for this socket.
///
/// For more information, see `TcpStream::set_timeout`
- #[experimental = "the timeout argument may change in type and value"]
+ #[unstable = "the timeout argument may change in type and value"]
pub fn set_read_timeout(&mut self, timeout_ms: Option<u64>) {
self.inner.set_read_timeout(timeout_ms)
}
/// Sets the write timeout for this socket.
///
/// For more information, see `TcpStream::set_timeout`
- #[experimental = "the timeout argument may change in type and value"]
+ #[unstable = "the timeout argument may change in type and value"]
pub fn set_write_timeout(&mut self, timeout_ms: Option<u64>) {
self.inner.set_write_timeout(timeout_ms)
}
/// When using this method, it is likely necessary to reset the timeout as
/// appropriate, the timeout specified is specific to this object, not
/// specific to the next request.
- #[experimental = "the name and arguments to this function are likely \
+ #[unstable = "the name and arguments to this function are likely \
to change"]
pub fn set_timeout(&mut self, timeout_ms: Option<u64>) {
self.inner.set_timeout(timeout_ms)
///
/// This function has the same semantics as `TcpAcceptor::close_accept`, and
/// more information can be found in that documentation.
- #[experimental]
+ #[unstable]
pub fn close_accept(&mut self) -> IoResult<()> {
self.inner.close_accept()
}
///
/// If a `timeout` with zero or negative duration is specified then
/// the function returns `Err`, with the error kind set to `TimedOut`.
- #[experimental = "the timeout argument may eventually change types"]
+ #[unstable = "the timeout argument may eventually change types"]
pub fn connect_timeout<A: ToSocketAddr>(addr: A,
timeout: Duration) -> IoResult<TcpStream> {
if timeout <= Duration::milliseconds(0) {
}
/// Sets the nodelay flag on this connection to the boolean specified
- #[experimental]
+ #[unstable]
pub fn set_nodelay(&mut self, nodelay: bool) -> IoResult<()> {
self.inner.set_nodelay(nodelay)
}
/// If the value specified is `None`, then the keepalive flag is cleared on
/// this connection. Otherwise, the keepalive timeout will be set to the
/// specified time, in seconds.
- #[experimental]
+ #[unstable]
pub fn set_keepalive(&mut self, delay_in_seconds: Option<uint>) -> IoResult<()> {
self.inner.set_keepalive(delay_in_seconds)
}
///
/// For clarification on the semantics of interrupting a read and a write,
/// take a look at `set_read_timeout` and `set_write_timeout`.
- #[experimental = "the timeout argument may change in type and value"]
+ #[unstable = "the timeout argument may change in type and value"]
pub fn set_timeout(&mut self, timeout_ms: Option<u64>) {
self.inner.set_timeout(timeout_ms)
}
/// action is taken. Otherwise, the read operation will be scheduled to
/// promptly return. If a timeout error is returned, then no data was read
/// during the timeout period.
- #[experimental = "the timeout argument may change in type and value"]
+ #[unstable = "the timeout argument may change in type and value"]
pub fn set_read_timeout(&mut self, timeout_ms: Option<u64>) {
self.inner.set_read_timeout(timeout_ms)
}
/// does not know how many bytes were written as part of the timeout
/// operation. It may be the case that bytes continue to be written in an
/// asynchronous fashion after the call to write returns.
- #[experimental = "the timeout argument may change in type and value"]
+ #[unstable = "the timeout argument may change in type and value"]
pub fn set_write_timeout(&mut self, timeout_ms: Option<u64>) {
self.inner.set_write_timeout(timeout_ms)
}
/// # Example
///
/// ```no_run
- /// # #![allow(experimental)]
+ /// # #![allow(unstable)]
/// use std::io::TcpListener;
/// use std::io::{Listener, Acceptor, TimedOut};
///
/// a.set_timeout(None);
/// let socket = a.accept();
/// ```
- #[experimental = "the type of the argument and name of this function are \
+ #[unstable = "the type of the argument and name of this function are \
subject to change"]
pub fn set_timeout(&mut self, ms: Option<u64>) { self.inner.set_timeout(ms); }
/// # Example
///
/// ```
- /// # #![allow(experimental)]
+ /// # #![allow(unstable)]
/// use std::io::{TcpListener, Listener, Acceptor, EndOfFile};
/// use std::thread::Thread;
///
/// // Signal our accept loop to exit
/// assert!(a.close_accept().is_ok());
/// ```
- #[experimental]
+ #[unstable]
pub fn close_accept(&mut self) -> IoResult<()> {
self.inner.close_accept()
}
}
#[cfg(test)]
-#[allow(experimental)]
+#[allow(unstable)]
mod test {
use prelude::v1::*;
}
/// Joins a multicast IP address (becomes a member of it)
- #[experimental]
+ #[unstable]
pub fn join_multicast(&mut self, multi: IpAddr) -> IoResult<()> {
self.inner.join_multicast(multi)
}
/// Leaves a multicast IP address (drops membership from it)
- #[experimental]
+ #[unstable]
pub fn leave_multicast(&mut self, multi: IpAddr) -> IoResult<()> {
self.inner.leave_multicast(multi)
}
/// Set the multicast loop flag to the specified value
///
/// This lets multicast packets loop back to local sockets (if enabled)
- #[experimental]
+ #[unstable]
pub fn set_multicast_loop(&mut self, on: bool) -> IoResult<()> {
self.inner.set_multicast_loop(on)
}
/// Sets the multicast TTL
- #[experimental]
+ #[unstable]
pub fn set_multicast_ttl(&mut self, ttl: int) -> IoResult<()> {
self.inner.multicast_time_to_live(ttl)
}
/// Sets this socket's TTL
- #[experimental]
+ #[unstable]
pub fn set_ttl(&mut self, ttl: int) -> IoResult<()> {
self.inner.time_to_live(ttl)
}
/// Sets the broadcast flag on or off
- #[experimental]
+ #[unstable]
pub fn set_broadcast(&mut self, broadcast: bool) -> IoResult<()> {
self.inner.set_broadcast(broadcast)
}
/// Sets the read/write timeout for this socket.
///
/// For more information, see `TcpStream::set_timeout`
- #[experimental = "the timeout argument may change in type and value"]
+ #[unstable = "the timeout argument may change in type and value"]
pub fn set_timeout(&mut self, timeout_ms: Option<u64>) {
self.inner.set_timeout(timeout_ms)
}
/// Sets the read timeout for this socket.
///
/// For more information, see `TcpStream::set_timeout`
- #[experimental = "the timeout argument may change in type and value"]
+ #[unstable = "the timeout argument may change in type and value"]
pub fn set_read_timeout(&mut self, timeout_ms: Option<u64>) {
self.inner.set_read_timeout(timeout_ms)
}
/// Sets the write timeout for this socket.
///
/// For more information, see `TcpStream::set_timeout`
- #[experimental = "the timeout argument may change in type and value"]
+ #[unstable = "the timeout argument may change in type and value"]
pub fn set_write_timeout(&mut self, timeout_ms: Option<u64>) {
self.inner.set_write_timeout(timeout_ms)
}
}
#[cfg(test)]
-#[allow(experimental)]
+#[allow(unstable)]
mod test {
use prelude::v1::*;
//! Bindings for executing child processes
-#![allow(experimental)]
+#![allow(unstable)]
#![allow(non_upper_case_globals)]
pub use self::StdioContainer::*;
/// # Example
///
/// ```no_run
- /// # #![allow(experimental)]
+ /// # #![allow(unstable)]
/// use std::io::{Command, IoResult};
/// use std::io::process::ProcessExit;
///
/// p.wait()
/// }
/// ```
- #[experimental = "the type of the timeout is likely to change"]
+ #[unstable = "the type of the timeout is likely to change"]
pub fn set_timeout(&mut self, timeout_ms: Option<u64>) {
self.deadline = timeout_ms.map(|i| i + sys::timer::now()).unwrap_or(0);
}
//! library. Each macro is available for use when linking against the standard
//! library.
-#![experimental]
+#![unstable]
/// The entry point for panic of Rust tasks.
///
///
/// For more information about select, see the `std::sync::mpsc::Select` structure.
#[macro_export]
-#[experimental]
+#[unstable]
macro_rules! select {
(
$($name:pat = $rx:ident.$meth:ident() => $code:expr),+
///
/// * num - The float value
#[inline]
-#[experimental = "may be removed or relocated"]
+#[unstable = "may be removed or relocated"]
pub fn to_string(num: f32) -> String {
let (r, _) = strconv::float_to_str_common(
num, 10u, true, SignNeg, DigAll, ExpNone, false);
///
/// * num - The float value
#[inline]
-#[experimental = "may be removed or relocated"]
+#[unstable = "may be removed or relocated"]
pub fn to_str_hex(num: f32) -> String {
let (r, _) = strconv::float_to_str_common(
num, 16u, true, SignNeg, DigAll, ExpNone, false);
/// * num - The float value
/// * radix - The base to use
#[inline]
-#[experimental = "may be removed or relocated"]
+#[unstable = "may be removed or relocated"]
pub fn to_str_radix_special(num: f32, rdx: uint) -> (String, bool) {
strconv::float_to_str_common(num, rdx, true, SignNeg, DigAll, ExpNone, false)
}
/// * num - The float value
/// * digits - The number of significant digits
#[inline]
-#[experimental = "may be removed or relocated"]
+#[unstable = "may be removed or relocated"]
pub fn to_str_exact(num: f32, dig: uint) -> String {
let (r, _) = strconv::float_to_str_common(
num, 10u, true, SignNeg, DigExact(dig), ExpNone, false);
/// * num - The float value
/// * digits - The number of significant digits
#[inline]
-#[experimental = "may be removed or relocated"]
+#[unstable = "may be removed or relocated"]
pub fn to_str_digits(num: f32, dig: uint) -> String {
let (r, _) = strconv::float_to_str_common(
num, 10u, true, SignNeg, DigMax(dig), ExpNone, false);
/// * digits - The number of digits after the decimal point
/// * upper - Use `E` instead of `e` for the exponent sign
#[inline]
-#[experimental = "may be removed or relocated"]
+#[unstable = "may be removed or relocated"]
pub fn to_str_exp_exact(num: f32, dig: uint, upper: bool) -> String {
let (r, _) = strconv::float_to_str_common(
num, 10u, true, SignNeg, DigExact(dig), ExpDec, upper);
/// * digits - The number of digits after the decimal point
/// * upper - Use `E` instead of `e` for the exponent sign
#[inline]
-#[experimental = "may be removed or relocated"]
+#[unstable = "may be removed or relocated"]
pub fn to_str_exp_digits(num: f32, dig: uint, upper: bool) -> String {
let (r, _) = strconv::float_to_str_common(
num, 10u, true, SignNeg, DigMax(dig), ExpDec, upper);
///
/// * num - The float value
#[inline]
-#[experimental = "may be removed or relocated"]
+#[unstable = "may be removed or relocated"]
pub fn to_string(num: f64) -> String {
let (r, _) = strconv::float_to_str_common(
num, 10u, true, SignNeg, DigAll, ExpNone, false);
///
/// * num - The float value
#[inline]
-#[experimental = "may be removed or relocated"]
+#[unstable = "may be removed or relocated"]
pub fn to_str_hex(num: f64) -> String {
let (r, _) = strconv::float_to_str_common(
num, 16u, true, SignNeg, DigAll, ExpNone, false);
/// * num - The float value
/// * radix - The base to use
#[inline]
-#[experimental = "may be removed or relocated"]
+#[unstable = "may be removed or relocated"]
pub fn to_str_radix_special(num: f64, rdx: uint) -> (String, bool) {
strconv::float_to_str_common(num, rdx, true, SignNeg, DigAll, ExpNone, false)
}
/// * num - The float value
/// * digits - The number of significant digits
#[inline]
-#[experimental = "may be removed or relocated"]
+#[unstable = "may be removed or relocated"]
pub fn to_str_exact(num: f64, dig: uint) -> String {
let (r, _) = strconv::float_to_str_common(
num, 10u, true, SignNeg, DigExact(dig), ExpNone, false);
/// * num - The float value
/// * digits - The number of significant digits
#[inline]
-#[experimental = "may be removed or relocated"]
+#[unstable = "may be removed or relocated"]
pub fn to_str_digits(num: f64, dig: uint) -> String {
let (r, _) = strconv::float_to_str_common(
num, 10u, true, SignNeg, DigMax(dig), ExpNone, false);
/// * digits - The number of digits after the decimal point
/// * upper - Use `E` instead of `e` for the exponent sign
#[inline]
-#[experimental = "may be removed or relocated"]
+#[unstable = "may be removed or relocated"]
pub fn to_str_exp_exact(num: f64, dig: uint, upper: bool) -> String {
let (r, _) = strconv::float_to_str_common(
num, 10u, true, SignNeg, DigExact(dig), ExpDec, upper);
/// * digits - The number of digits after the decimal point
/// * upper - Use `E` instead of `e` for the exponent sign
#[inline]
-#[experimental = "may be removed or relocated"]
+#[unstable = "may be removed or relocated"]
pub fn to_str_exp_digits(num: f64, dig: uint, upper: bool) -> String {
let (r, _) = strconv::float_to_str_common(
num, 10u, true, SignNeg, DigMax(dig), ExpDec, upper);
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![experimental]
+#![unstable]
#![doc(hidden)]
macro_rules! assert_approx_eq {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![experimental]
+#![unstable]
#![doc(hidden)]
macro_rules! int_module { ($T:ty) => (
use option::Option;
-#[experimental = "may be removed or relocated"]
+#[unstable = "may be removed or relocated"]
pub mod strconv;
/// Mathematical operations on primitive floating point numbers.
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![experimental]
+#![unstable]
#![doc(hidden)]
#![allow(unsigned_negation)]
//! so we will not _hide_ the facts of which OS the user is on -- they should be given the
//! opportunity to write OS-ignorant code by default.
-#![experimental]
+#![unstable]
#![allow(missing_docs)]
#![allow(non_snake_case)]
//! println!("path exists: {}", path.exists());
//! ```
-#![experimental]
+#![unstable]
use core::marker::Sized;
use ffi::CString;
//! }
//! ```
-#![experimental]
+#![unstable]
use cell::RefCell;
use clone::Clone;
//! and should be considered as private implementation details for the
//! time being.
-#![experimental]
+#![unstable]
// FIXME: this should not be here.
#![allow(missing_docs)]
/// Only a limited number of callbacks can be registered, and this function
/// returns whether the callback was successfully registered or not. It is not
/// currently possible to unregister a callback once it has been registered.
-#[experimental]
+#[unstable]
pub unsafe fn register(f: Callback) -> bool {
match CALLBACK_CNT.fetch_add(1, Ordering::SeqCst) {
// The invocation code has knowledge of this window where the count has
//! the standard library This varies per-platform, but these libraries are
//! necessary for running libstd.
-#![experimental]
+#![unstable]
// All platforms need to link to rustrt
#[cfg(not(test))]
//! method, and see the method for more information about it. Due to this
//! caveat, this queue may not be appropriate for all use-cases.
-#![experimental]
+#![unstable]
// http://www.1024cores.net/home/lock-free-algorithms
// /queues/non-intrusive-mpsc-node-based-queue
//! ```
#![allow(dead_code)]
-#![experimental = "This implementation, while likely sufficient, is unsafe and \
+#![unstable = "This implementation, while likely sufficient, is unsafe and \
likely to be error prone. At some point in the future this \
module will likely be replaced, and it is currently \
unknown how much API breakage that will cause. The ability \
//! concurrently between two tasks. This data structure is safe to use and
//! enforces the semantics that there is one pusher and one popper.
-#![experimental]
+#![unstable]
use core::prelude::*;
//! }
//! ```
-#![experimental]
+#![unstable]
use sys_common::AsInner;
use libc;
//! descriptors, and sockets, but its functionality will grow over
//! time.
-#![experimental]
+#![unstable]
use sys_common::AsInner;
use libc;
}
/// Redirect thread-local stdout.
- #[experimental = "Will likely go away after proc removal"]
+ #[unstable = "Will likely go away after proc removal"]
pub fn stdout(mut self, stdout: Box<Writer + Send>) -> Builder {
self.stdout = Some(stdout);
self
}
/// Redirect thread-local stderr.
- #[experimental = "Will likely go away after proc removal"]
+ #[unstable = "Will likely go away after proc removal"]
pub fn stderr(mut self, stderr: Box<Writer + Send>) -> Builder {
self.stderr = Some(stderr);
self
impl<T: Send> JoinGuard<'static, T> {
/// Detaches the child thread, allowing it to outlive its parent.
- #[experimental = "unsure whether this API imposes limitations elsewhere"]
+ #[unstable = "unsure whether this API imposes limitations elsewhere"]
pub fn detach(mut self) {
unsafe { imp::detach(self.native) };
self.joined = true; // avoid joining in the destructor
//! Temporal quantification
-#![experimental]
+#![unstable]
use {fmt, i64};
use ops::{Add, Sub, Mul, Div, Neg, FnOnce};
//! This API is completely unstable and subject to change.
#![crate_name = "syntax"]
-#![experimental]
+#![unstable]
#![staged_api]
#![crate_type = "dylib"]
#![crate_type = "rlib"]
//! [ti]: https://en.wikipedia.org/wiki/Terminfo
#![crate_name = "term"]
-#![experimental = "use the crates.io `term` library instead"]
+#![unstable = "use the crates.io `term` library instead"]
#![staged_api]
#![crate_type = "rlib"]
#![crate_type = "dylib"]
// build off of.
#![crate_name = "test"]
-#![experimental]
+#![unstable]
#![staged_api]
#![crate_type = "rlib"]
#![crate_type = "dylib"]
//! (yet) aim to provide a full set of Unicode tables.
#![crate_name = "unicode"]
-#![experimental]
+#![unstable]
#![staged_api]
#![crate_type = "rlib"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
/// 'XID_Start' is a Unicode Derived Property specified in
/// [UAX #31](http://unicode.org/reports/tr31/#NFKC_Modifications),
/// mostly similar to ID_Start but modified for closure under NFKx.
- #[experimental = "mainly needed for compiler internals"]
+ #[unstable = "mainly needed for compiler internals"]
fn is_xid_start(self) -> bool;
/// Returns whether the specified `char` satisfies the 'XID_Continue'
/// 'XID_Continue' is a Unicode Derived Property specified in
/// [UAX #31](http://unicode.org/reports/tr31/#NFKC_Modifications),
/// mostly similar to 'ID_Continue' but modified for closure under NFKx.
- #[experimental = "mainly needed for compiler internals"]
+ #[unstable = "mainly needed for compiler internals"]
fn is_xid_continue(self) -> bool;
/// Indicates whether a character is in lowercase.
///
/// Returns the lowercase equivalent of the character, or the character
/// itself if no conversion is possible.
- #[experimental = "pending case transformation decisions"]
+ #[unstable = "pending case transformation decisions"]
fn to_lowercase(self) -> char;
/// Converts a character to its uppercase equivalent.
/// [`SpecialCasing`.txt`]: ftp://ftp.unicode.org/Public/UNIDATA/SpecialCasing.txt
///
/// [2]: http://www.unicode.org/versions/Unicode4.0.0/ch03.pdf#G33992
- #[experimental = "pending case transformation decisions"]
+ #[unstable = "pending case transformation decisions"]
fn to_uppercase(self) -> char;
/// Returns this character's displayed width in columns, or `None` if it is a
/// [Unicode Standard Annex #11](http://www.unicode.org/reports/tr11/)
/// recommends that these characters be treated as 1 column (i.e.,
/// `is_cjk` = `false`) if the context cannot be reliably determined.
- #[experimental = "needs expert opinion. is_cjk flag stands out as ugly"]
+ #[unstable = "needs expert opinion. is_cjk flag stands out as ugly"]
fn width(self, is_cjk: bool) -> Option<uint>;
}
}
}
- #[experimental = "mainly needed for compiler internals"]
+ #[unstable = "mainly needed for compiler internals"]
fn is_xid_start(self) -> bool { derived_property::XID_Start(self) }
- #[experimental = "mainly needed for compiler internals"]
+ #[unstable = "mainly needed for compiler internals"]
fn is_xid_continue(self) -> bool { derived_property::XID_Continue(self) }
#[stable]
}
}
- #[experimental = "pending case transformation decisions"]
+ #[unstable = "pending case transformation decisions"]
fn to_lowercase(self) -> char { conversions::to_lower(self) }
- #[experimental = "pending case transformation decisions"]
+ #[unstable = "pending case transformation decisions"]
fn to_uppercase(self) -> char { conversions::to_upper(self) }
- #[experimental = "needs expert opinion. is_cjk flag stands out as ugly"]
+ #[unstable = "needs expert opinion. is_cjk flag stands out as ugly"]
fn width(self, is_cjk: bool) -> Option<uint> { charwidth::width(self, is_cjk) }
}
// except according to those terms.
#![crate_name="inherited_stability"]
#![crate_type = "lib"]
-#![experimental]
+#![unstable]
+#![staged_api]
pub fn experimental() {}
#[unstable]
pub mod unstable_mod {
- #[experimental]
+ #[unstable]
pub fn experimental() {}
pub fn unstable() {}
#![crate_name="lint_output_format"]
#![crate_type = "lib"]
+#![staged_api]
#[deprecated]
pub fn foo() -> uint {
20
}
-#[experimental]
+#[unstable]
pub fn bar() -> uint {
40
}
// except according to those terms.
#![crate_name="lint_stability"]
#![crate_type = "lib"]
+#![staged_api]
#[deprecated]
pub fn deprecated() {}
#[deprecated="text"]
pub fn deprecated_text() {}
-#[experimental]
+#[unstable]
pub fn experimental() {}
-#[experimental="text"]
+#[unstable="text"]
pub fn experimental_text() {}
#[unstable]
#[deprecated="text"]
pub fn method_deprecated_text(&self) {}
- #[experimental]
+ #[unstable]
pub fn method_experimental(&self) {}
- #[experimental="text"]
+ #[unstable="text"]
pub fn method_experimental_text(&self) {}
#[unstable]
#[deprecated="text"]
fn trait_deprecated_text(&self) {}
- #[experimental]
+ #[unstable]
fn trait_experimental(&self) {}
- #[experimental="text"]
+ #[unstable="text"]
fn trait_experimental_text(&self) {}
#[unstable]
impl Trait for MethodTester {}
-#[experimental]
+#[unstable]
pub trait ExperimentalTrait {}
#[deprecated]
pub struct DeprecatedStruct { pub i: int }
-#[experimental]
+#[unstable]
pub struct ExperimentalStruct { pub i: int }
#[unstable]
pub struct UnstableStruct { pub i: int }
#[deprecated]
pub struct DeprecatedUnitStruct;
-#[experimental]
+#[unstable]
pub struct ExperimentalUnitStruct;
#[unstable]
pub struct UnstableUnitStruct;
pub enum Enum {
#[deprecated]
DeprecatedVariant,
- #[experimental]
+ #[unstable]
ExperimentalVariant,
#[unstable]
UnstableVariant,
#[deprecated]
pub struct DeprecatedTupleStruct(pub int);
-#[experimental]
+#[unstable]
pub struct ExperimentalTupleStruct(pub int);
#[unstable]
pub struct UnstableTupleStruct(pub int);
#![cfg_attr(foo, experimental)]
#![cfg_attr(not(foo), stable)]
+#![staged_api]
// compile-flags:--cfg foo
-#![cfg_attr(foo, experimental)]
+#![cfg_attr(foo, unstable)]
#![cfg_attr(not(foo), stable)]
-
+#![staged_api]
// OF THE POSSIBILITY OF SUCH DAMAGE.
#![feature(simd)]
-#![allow(experimental)]
+#![allow(unstable)]
// ignore-pretty very bad with line comments
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![staged_api]
#![deny(deprecated)]
struct Foo;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![forbid(experimental)]
+#![forbid(unstable)]
-#[allow(experimental)] //~ ERROR allow(experimental) overruled by outer forbid(experimental)
+#[allow(unstable)] //~ ERROR allow(unstable) overruled by outer forbid(unstable)
fn main() {
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// compile-flags: -F experimental
+// compile-flags: -F unstable
-#[allow(experimental)] //~ ERROR allow(experimental) overruled by outer forbid(experimental)
+#![staged_api]
+#[allow(unstable)] //~ ERROR allow(unstable) overruled by outer forbid(unstable)
fn main() {
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// compile-flags:-F experimental -D unstable
+// compile-flags:-F unstable
// aux-build:lint_output_format.rs
extern crate lint_output_format; //~ ERROR: use of unmarked item
-use lint_output_format::{foo, bar, baz};
+use lint_output_format::{foo, bar};
fn main() {
let _x = foo(); //~ WARNING #[warn(deprecated)] on by default
- let _y = bar(); //~ ERROR [-F experimental]
- let _z = baz(); //~ ERROR [-D unstable]
+ let _y = bar(); //~ ERROR [-F unstable]
}
#![deny(unstable)]
#![deny(deprecated)]
-#![deny(experimental)]
+#![deny(unstable)]
#![allow(dead_code)]
+#![staged_api]
#[macro_use]
extern crate lint_stability; //~ ERROR: use of unmarked item
mod cross_crate {
extern crate stability_cfg1;
- extern crate stability_cfg2; //~ ERROR: use of experimental item
+ extern crate stability_cfg2; //~ ERROR: use of unstable item
use lint_stability::*;
foo.method_deprecated_text(); //~ ERROR use of deprecated item: text
foo.trait_deprecated_text(); //~ ERROR use of deprecated item: text
- experimental(); //~ ERROR use of experimental item
- foo.method_experimental(); //~ ERROR use of experimental item
- foo.trait_experimental(); //~ ERROR use of experimental item
+ experimental(); //~ ERROR use of unstable item
+ foo.method_experimental(); //~ ERROR use of unstable item
+ foo.trait_experimental(); //~ ERROR use of unstable item
- experimental_text(); //~ ERROR use of experimental item: text
- foo.method_experimental_text(); //~ ERROR use of experimental item: text
- foo.trait_experimental_text(); //~ ERROR use of experimental item: text
+ experimental_text(); //~ ERROR use of unstable item: text
+ foo.method_experimental_text(); //~ ERROR use of unstable item: text
+ foo.trait_experimental_text(); //~ ERROR use of unstable item: text
unstable(); //~ ERROR use of unstable item
foo.method_unstable(); //~ ERROR use of unstable item
foo.trait_locked_text();
let _ = DeprecatedStruct { i: 0 }; //~ ERROR use of deprecated item
- let _ = ExperimentalStruct { i: 0 }; //~ ERROR use of experimental item
+ let _ = ExperimentalStruct { i: 0 }; //~ ERROR use of unstable item
let _ = UnstableStruct { i: 0 }; //~ ERROR use of unstable item
let _ = UnmarkedStruct { i: 0 }; //~ ERROR use of unmarked item
let _ = StableStruct { i: 0 };
let _ = LockedStruct { i: 0 };
let _ = DeprecatedUnitStruct; //~ ERROR use of deprecated item
- let _ = ExperimentalUnitStruct; //~ ERROR use of experimental item
+ let _ = ExperimentalUnitStruct; //~ ERROR use of unstable item
let _ = UnstableUnitStruct; //~ ERROR use of unstable item
let _ = UnmarkedUnitStruct; //~ ERROR use of unmarked item
let _ = StableUnitStruct;
let _ = LockedUnitStruct;
let _ = Enum::DeprecatedVariant; //~ ERROR use of deprecated item
- let _ = Enum::ExperimentalVariant; //~ ERROR use of experimental item
+ let _ = Enum::ExperimentalVariant; //~ ERROR use of unstable item
let _ = Enum::UnstableVariant; //~ ERROR use of unstable item
let _ = Enum::UnmarkedVariant; //~ ERROR use of unmarked item
let _ = Enum::StableVariant;
let _ = Enum::LockedVariant;
let _ = DeprecatedTupleStruct (1); //~ ERROR use of deprecated item
- let _ = ExperimentalTupleStruct (1); //~ ERROR use of experimental item
+ let _ = ExperimentalTupleStruct (1); //~ ERROR use of unstable item
let _ = UnstableTupleStruct (1); //~ ERROR use of unstable item
let _ = UnmarkedTupleStruct (1); //~ ERROR use of unmarked item
let _ = StableTupleStruct (1);
fn test_method_param<F: Trait>(foo: F) {
foo.trait_deprecated(); //~ ERROR use of deprecated item
foo.trait_deprecated_text(); //~ ERROR use of deprecated item: text
- foo.trait_experimental(); //~ ERROR use of experimental item
- foo.trait_experimental_text(); //~ ERROR use of experimental item: text
+ foo.trait_experimental(); //~ ERROR use of unstable item
+ foo.trait_experimental_text(); //~ ERROR use of unstable item: text
foo.trait_unstable(); //~ ERROR use of unstable item
foo.trait_unstable_text(); //~ ERROR use of unstable item: text
foo.trait_unmarked(); //~ ERROR use of unmarked item
fn test_method_object(foo: &Trait) {
foo.trait_deprecated(); //~ ERROR use of deprecated item
foo.trait_deprecated_text(); //~ ERROR use of deprecated item: text
- foo.trait_experimental(); //~ ERROR use of experimental item
- foo.trait_experimental_text(); //~ ERROR use of experimental item: text
+ foo.trait_experimental(); //~ ERROR use of unstable item
+ foo.trait_experimental_text(); //~ ERROR use of unstable item: text
foo.trait_unstable(); //~ ERROR use of unstable item
foo.trait_unstable_text(); //~ ERROR use of unstable item: text
foo.trait_unmarked(); //~ ERROR use of unmarked item
struct S;
- impl ExperimentalTrait for S { } //~ ERROR use of experimental item
+ impl ExperimentalTrait for S { } //~ ERROR use of unstable item
- trait LocalTrait : ExperimentalTrait { } //~ ERROR use of experimental item
+ trait LocalTrait : ExperimentalTrait { } //~ ERROR use of unstable item
}
mod inheritance {
- extern crate inherited_stability; //~ ERROR: use of experimental item
+ extern crate inherited_stability; //~ ERROR: use of unstable item
use self::inherited_stability::*;
fn test_inheritance() {
- experimental(); //~ ERROR use of experimental item
+ experimental(); //~ ERROR use of unstable item
stable();
- stable_mod::experimental(); //~ ERROR use of experimental item
+ stable_mod::experimental(); //~ ERROR use of unstable item
stable_mod::stable();
- unstable_mod::experimental(); //~ ERROR use of experimental item
+ unstable_mod::experimental(); //~ ERROR use of unstable item
unstable_mod::unstable(); //~ ERROR use of unstable item
- experimental_mod::experimental(); //~ ERROR use of experimental item
+ experimental_mod::experimental(); //~ ERROR use of unstable item
experimental_mod::stable();
- let _ = Experimental::ExperimentalVariant; //~ ERROR use of experimental item
+ let _ = Experimental::ExperimentalVariant; //~ ERROR use of unstable item
let _ = Experimental::StableVariant;
let x: uint = 0;
- x.experimental(); //~ ERROR use of experimental item
+ x.experimental(); //~ ERROR use of unstable item
x.stable();
}
}
#[deprecated="text"]
pub fn deprecated_text() {}
- #[experimental]
+ #[unstable]
pub fn experimental() {}
- #[experimental="text"]
+ #[unstable="text"]
pub fn experimental_text() {}
#[unstable]
#[deprecated="text"]
pub fn method_deprecated_text(&self) {}
- #[experimental]
+ #[unstable]
pub fn method_experimental(&self) {}
- #[experimental="text"]
+ #[unstable="text"]
pub fn method_experimental_text(&self) {}
#[unstable]
#[deprecated="text"]
fn trait_deprecated_text(&self) {}
- #[experimental]
+ #[unstable]
fn trait_experimental(&self) {}
- #[experimental="text"]
+ #[unstable="text"]
fn trait_experimental_text(&self) {}
#[unstable]
#[deprecated]
pub struct DeprecatedStruct { i: int }
- #[experimental]
+ #[unstable]
pub struct ExperimentalStruct { i: int }
#[unstable]
pub struct UnstableStruct { i: int }
#[deprecated]
pub struct DeprecatedUnitStruct;
- #[experimental]
+ #[unstable]
pub struct ExperimentalUnitStruct;
#[unstable]
pub struct UnstableUnitStruct;
pub enum Enum {
#[deprecated]
DeprecatedVariant,
- #[experimental]
+ #[unstable]
ExperimentalVariant,
#[unstable]
UnstableVariant,
#[deprecated]
pub struct DeprecatedTupleStruct(int);
- #[experimental]
+ #[unstable]
pub struct ExperimentalTupleStruct(int);
#[unstable]
pub struct UnstableTupleStruct(int);
// ignore-tidy-linelength
-#![allow(experimental)]
+#![allow(unstable)]
use std::simd::f32x4;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![deny(experimental)]
+#![deny(unstable)]
use std::simd;
// gdb-command:continue
-#![allow(experimental)]
+#![allow(unstable)]
#![allow(unused_variables)]
#![omit_gdb_pretty_printer_section]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(experimental)]
+#![allow(unstable)]
use std::simd::{i32x4, f32x4, u32x4};
// except according to those terms.
-#![allow(experimental)]
+#![allow(unstable)]
#![feature(simd)]
pub fn main() {
// one test task to ensure that errors are timeouts, not file descriptor
// exhaustion.
-#![allow(experimental)]
+#![allow(unstable)]
#![reexport_test_harness_main = "test_main"]
#![allow(unused_imports)]