1
Fork 0

std: Stabilize library APIs for 1.5

This commit stabilizes and deprecates library APIs whose FCP has closed in the
last cycle, specifically:

Stabilized APIs:

* `fs::canonicalize`
* `Path::{metadata, symlink_metadata, canonicalize, read_link, read_dir, exists,
   is_file, is_dir}` - all moved to inherent methods from the `PathExt` trait.
* `Formatter::fill`
* `Formatter::width`
* `Formatter::precision`
* `Formatter::sign_plus`
* `Formatter::sign_minus`
* `Formatter::alternate`
* `Formatter::sign_aware_zero_pad`
* `string::ParseError`
* `Utf8Error::valid_up_to`
* `Iterator::{cmp, partial_cmp, eq, ne, lt, le, gt, ge}`
* `<[T]>::split_{first,last}{,_mut}`
* `Condvar::wait_timeout` - note that `wait_timeout_ms` is not yet deprecated
  but will be once 1.5 is released.
* `str::{R,}MatchIndices`
* `str::{r,}match_indices`
* `char::from_u32_unchecked`
* `VecDeque::insert`
* `VecDeque::shrink_to_fit`
* `VecDeque::as_slices`
* `VecDeque::as_mut_slices`
* `VecDeque::swap_remove_front` - (renamed from `swap_front_remove`)
* `VecDeque::swap_remove_back` - (renamed from `swap_back_remove`)
* `Vec::resize`
* `str::slice_mut_unchecked`
* `FileTypeExt`
* `FileTypeExt::{is_block_device, is_char_device, is_fifo, is_socket}`
* `BinaryHeap::from` - `from_vec` deprecated in favor of this
* `BinaryHeap::into_vec` - plus a `Into` impl
* `BinaryHeap::into_sorted_vec`

Deprecated APIs

* `slice::ref_slice`
* `slice::mut_ref_slice`
* `iter::{range_inclusive, RangeInclusive}`
* `std::dynamic_lib`

Closes #27706
Closes #27725
cc #27726 (align not stabilized yet)
Closes #27734
Closes #27737
Closes #27742
Closes #27743
Closes #27772
Closes #27774
Closes #27777
Closes #27781
cc #27788 (a few remaining methods though)
Closes #27790
Closes #27793
Closes #27796
Closes #27810
cc #28147 (not all parts stabilized)
This commit is contained in:
Alex Crichton 2015-10-22 16:28:45 -07:00
parent 9a855668fc
commit ff49733274
60 changed files with 274 additions and 195 deletions

View file

@ -13,9 +13,7 @@
#![feature(box_syntax)] #![feature(box_syntax)]
#![feature(dynamic_lib)] #![feature(dynamic_lib)]
#![feature(libc)] #![feature(libc)]
#![feature(path_ext)]
#![feature(rustc_private)] #![feature(rustc_private)]
#![feature(slice_splits)]
#![feature(str_char)] #![feature(str_char)]
#![feature(test)] #![feature(test)]
#![feature(vec_push_all)] #![feature(vec_push_all)]

View file

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#![allow(deprecated)]
use std::dynamic_lib::DynamicLibrary; use std::dynamic_lib::DynamicLibrary;
use std::io::prelude::*; use std::io::prelude::*;
use std::path::PathBuf; use std::path::PathBuf;

View file

@ -240,14 +240,9 @@ impl<T: Ord> BinaryHeap<T> {
#[unstable(feature = "binary_heap_extras", #[unstable(feature = "binary_heap_extras",
reason = "needs to be audited", reason = "needs to be audited",
issue = "28147")] issue = "28147")]
#[deprecated(since = "1.5.0", reason = "use BinaryHeap::from instead")]
pub fn from_vec(vec: Vec<T>) -> BinaryHeap<T> { pub fn from_vec(vec: Vec<T>) -> BinaryHeap<T> {
let mut heap = BinaryHeap { data: vec }; BinaryHeap::from(vec)
let mut n = heap.len() / 2;
while n > 0 {
n -= 1;
heap.sift_down(n);
}
heap
} }
/// Returns an iterator visiting all values in the underlying vector, in /// Returns an iterator visiting all values in the underlying vector, in
@ -256,10 +251,8 @@ impl<T: Ord> BinaryHeap<T> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(binary_heap_extras)]
///
/// use std::collections::BinaryHeap; /// use std::collections::BinaryHeap;
/// let heap = BinaryHeap::from_vec(vec![1, 2, 3, 4]); /// let heap = BinaryHeap::from(vec![1, 2, 3, 4]);
/// ///
/// // Print 1, 2, 3, 4 in arbitrary order /// // Print 1, 2, 3, 4 in arbitrary order
/// for x in heap.iter() { /// for x in heap.iter() {
@ -362,10 +355,8 @@ impl<T: Ord> BinaryHeap<T> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(binary_heap_extras)]
///
/// use std::collections::BinaryHeap; /// use std::collections::BinaryHeap;
/// let mut heap = BinaryHeap::from_vec(vec![1, 3]); /// let mut heap = BinaryHeap::from(vec![1, 3]);
/// ///
/// assert_eq!(heap.pop(), Some(3)); /// assert_eq!(heap.pop(), Some(3));
/// assert_eq!(heap.pop(), Some(1)); /// assert_eq!(heap.pop(), Some(1));
@ -475,10 +466,8 @@ impl<T: Ord> BinaryHeap<T> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(binary_heap_extras)]
///
/// use std::collections::BinaryHeap; /// use std::collections::BinaryHeap;
/// let heap = BinaryHeap::from_vec(vec![1, 2, 3, 4, 5, 6, 7]); /// let heap = BinaryHeap::from(vec![1, 2, 3, 4, 5, 6, 7]);
/// let vec = heap.into_vec(); /// let vec = heap.into_vec();
/// ///
/// // Will print in some order /// // Will print in some order
@ -486,10 +475,10 @@ impl<T: Ord> BinaryHeap<T> {
/// println!("{}", x); /// println!("{}", x);
/// } /// }
/// ``` /// ```
#[unstable(feature = "binary_heap_extras", #[stable(feature = "binary_heap_extras_15", since = "1.5.0")]
reason = "needs to be audited", pub fn into_vec(self) -> Vec<T> {
issue = "28147")] self.into()
pub fn into_vec(self) -> Vec<T> { self.data } }
/// Consumes the `BinaryHeap` and returns a vector in sorted /// Consumes the `BinaryHeap` and returns a vector in sorted
/// (ascending) order. /// (ascending) order.
@ -497,20 +486,16 @@ impl<T: Ord> BinaryHeap<T> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(binary_heap_extras)]
///
/// use std::collections::BinaryHeap; /// use std::collections::BinaryHeap;
/// ///
/// let mut heap = BinaryHeap::from_vec(vec![1, 2, 4, 5, 7]); /// let mut heap = BinaryHeap::from(vec![1, 2, 4, 5, 7]);
/// heap.push(6); /// heap.push(6);
/// heap.push(3); /// heap.push(3);
/// ///
/// let vec = heap.into_sorted_vec(); /// let vec = heap.into_sorted_vec();
/// assert_eq!(vec, [1, 2, 3, 4, 5, 6, 7]); /// assert_eq!(vec, [1, 2, 3, 4, 5, 6, 7]);
/// ``` /// ```
#[unstable(feature = "binary_heap_extras", #[stable(feature = "binary_heap_extras_15", since = "1.5.0")]
reason = "needs to be audited",
issue = "28147")]
pub fn into_sorted_vec(mut self) -> Vec<T> { pub fn into_sorted_vec(mut self) -> Vec<T> {
let mut end = self.len(); let mut end = self.len();
while end > 1 { while end > 1 {
@ -744,10 +729,28 @@ impl<'a, T: 'a> DoubleEndedIterator for Drain<'a, T> {
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: 'a> ExactSizeIterator for Drain<'a, T> {} impl<'a, T: 'a> ExactSizeIterator for Drain<'a, T> {}
impl<T: Ord> From<Vec<T>> for BinaryHeap<T> {
fn from(vec: Vec<T>) -> BinaryHeap<T> {
let mut heap = BinaryHeap { data: vec };
let mut n = heap.len() / 2;
while n > 0 {
n -= 1;
heap.sift_down(n);
}
heap
}
}
impl<T> From<BinaryHeap<T>> for Vec<T> {
fn from(heap: BinaryHeap<T>) -> Vec<T> {
heap.data
}
}
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl<T: Ord> FromIterator<T> for BinaryHeap<T> { impl<T: Ord> FromIterator<T> for BinaryHeap<T> {
fn from_iter<I: IntoIterator<Item=T>>(iter: I) -> BinaryHeap<T> { fn from_iter<I: IntoIterator<Item=T>>(iter: I) -> BinaryHeap<T> {
BinaryHeap::from_vec(iter.into_iter().collect()) BinaryHeap::from(iter.into_iter().collect::<Vec<_>>())
} }
} }
@ -763,10 +766,8 @@ impl<T: Ord> IntoIterator for BinaryHeap<T> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(binary_heap_extras)]
///
/// use std::collections::BinaryHeap; /// use std::collections::BinaryHeap;
/// let heap = BinaryHeap::from_vec(vec![1, 2, 3, 4]); /// let heap = BinaryHeap::from(vec![1, 2, 3, 4]);
/// ///
/// // Print 1, 2, 3, 4 in arbitrary order /// // Print 1, 2, 3, 4 in arbitrary order
/// for x in heap.into_iter() { /// for x in heap.into_iter() {

View file

@ -46,7 +46,6 @@
#![feature(fmt_internals)] #![feature(fmt_internals)]
#![feature(fmt_radix)] #![feature(fmt_radix)]
#![feature(heap_api)] #![feature(heap_api)]
#![feature(iter_order)]
#![feature(iter_arith)] #![feature(iter_arith)]
#![feature(iter_arith)] #![feature(iter_arith)]
#![feature(lang_items)] #![feature(lang_items)]
@ -60,14 +59,12 @@
#![feature(staged_api)] #![feature(staged_api)]
#![feature(step_by)] #![feature(step_by)]
#![feature(str_char)] #![feature(str_char)]
#![feature(str_match_indices)]
#![feature(unboxed_closures)] #![feature(unboxed_closures)]
#![feature(unicode)] #![feature(unicode)]
#![feature(unique)] #![feature(unique)]
#![feature(dropck_parametricity)] #![feature(dropck_parametricity)]
#![feature(unsafe_no_drop_flag, filling_drop)] #![feature(unsafe_no_drop_flag, filling_drop)]
#![feature(decode_utf16)] #![feature(decode_utf16)]
#![feature(utf8_error)]
#![cfg_attr(test, feature(clone_from_slice, rand, test))] #![cfg_attr(test, feature(clone_from_slice, rand, test))]
#![feature(no_std)] #![feature(no_std)]

View file

@ -106,6 +106,7 @@ pub use core::slice::{Chunks, Windows};
pub use core::slice::{Iter, IterMut}; pub use core::slice::{Iter, IterMut};
pub use core::slice::{SplitMut, ChunksMut, Split}; pub use core::slice::{SplitMut, ChunksMut, Split};
pub use core::slice::{SplitN, RSplitN, SplitNMut, RSplitNMut}; pub use core::slice::{SplitN, RSplitN, SplitNMut, RSplitNMut};
#[allow(deprecated)]
pub use core::slice::{bytes, mut_ref_slice, ref_slice}; pub use core::slice::{bytes, mut_ref_slice, ref_slice};
pub use core::slice::{from_raw_parts, from_raw_parts_mut}; pub use core::slice::{from_raw_parts, from_raw_parts_mut};
@ -214,21 +215,21 @@ impl<T> [T] {
} }
/// Returns the first and all the rest of the elements of a slice. /// Returns the first and all the rest of the elements of a slice.
#[unstable(feature = "slice_splits", reason = "new API", issue = "27742")] #[stable(feature = "slice_splits", since = "1.5.0")]
#[inline] #[inline]
pub fn split_first(&self) -> Option<(&T, &[T])> { pub fn split_first(&self) -> Option<(&T, &[T])> {
core_slice::SliceExt::split_first(self) core_slice::SliceExt::split_first(self)
} }
/// Returns the first and all the rest of the elements of a slice. /// Returns the first and all the rest of the elements of a slice.
#[unstable(feature = "slice_splits", reason = "new API", issue = "27742")] #[stable(feature = "slice_splits", since = "1.5.0")]
#[inline] #[inline]
pub fn split_first_mut(&mut self) -> Option<(&mut T, &mut [T])> { pub fn split_first_mut(&mut self) -> Option<(&mut T, &mut [T])> {
core_slice::SliceExt::split_first_mut(self) core_slice::SliceExt::split_first_mut(self)
} }
/// Returns the last and all the rest of the elements of a slice. /// Returns the last and all the rest of the elements of a slice.
#[unstable(feature = "slice_splits", reason = "new API", issue = "27742")] #[stable(feature = "slice_splits", since = "1.5.0")]
#[inline] #[inline]
pub fn split_last(&self) -> Option<(&T, &[T])> { pub fn split_last(&self) -> Option<(&T, &[T])> {
core_slice::SliceExt::split_last(self) core_slice::SliceExt::split_last(self)
@ -236,7 +237,7 @@ impl<T> [T] {
} }
/// Returns the last and all the rest of the elements of a slice. /// Returns the last and all the rest of the elements of a slice.
#[unstable(feature = "slice_splits", reason = "new API", issue = "27742")] #[stable(feature = "slice_splits", since = "1.5.0")]
#[inline] #[inline]
pub fn split_last_mut(&mut self) -> Option<(&mut T, &mut [T])> { pub fn split_last_mut(&mut self) -> Option<(&mut T, &mut [T])> {
core_slice::SliceExt::split_last_mut(self) core_slice::SliceExt::split_last_mut(self)

View file

@ -277,8 +277,7 @@ impl str {
/// Takes a bytewise mutable slice from a string. /// Takes a bytewise mutable slice from a string.
/// ///
/// Same as `slice_unchecked`, but works with `&mut str` instead of `&str`. /// Same as `slice_unchecked`, but works with `&mut str` instead of `&str`.
#[unstable(feature = "str_slice_mut", reason = "recently added", #[stable(feature = "str_slice_mut", since = "1.5.0")]
issue = "27793")]
#[inline] #[inline]
pub unsafe fn slice_mut_unchecked(&mut self, begin: usize, end: usize) -> &mut str { pub unsafe fn slice_mut_unchecked(&mut self, begin: usize, end: usize) -> &mut str {
core_str::StrExt::slice_mut_unchecked(self, begin, end) core_str::StrExt::slice_mut_unchecked(self, begin, end)
@ -1192,9 +1191,7 @@ impl str {
/// let v: Vec<_> = "ababa".match_indices("aba").collect(); /// let v: Vec<_> = "ababa".match_indices("aba").collect();
/// assert_eq!(v, [(0, "aba")]); // only the first `aba` /// assert_eq!(v, [(0, "aba")]); // only the first `aba`
/// ``` /// ```
#[unstable(feature = "str_match_indices", #[stable(feature = "str_match_indices", since = "1.5.0")]
reason = "might have its iterator type changed",
issue = "27743")]
pub fn match_indices<'a, P: Pattern<'a>>(&'a self, pat: P) -> MatchIndices<'a, P> { pub fn match_indices<'a, P: Pattern<'a>>(&'a self, pat: P) -> MatchIndices<'a, P> {
core_str::StrExt::match_indices(self, pat) core_str::StrExt::match_indices(self, pat)
} }
@ -1231,9 +1228,7 @@ impl str {
/// let v: Vec<_> = "ababa".rmatch_indices("aba").collect(); /// let v: Vec<_> = "ababa".rmatch_indices("aba").collect();
/// assert_eq!(v, [(2, "aba")]); // only the last `aba` /// assert_eq!(v, [(2, "aba")]); // only the last `aba`
/// ``` /// ```
#[unstable(feature = "str_match_indices", #[stable(feature = "str_match_indices", since = "1.5.0")]
reason = "might have its iterator type changed",
issue = "27743")]
pub fn rmatch_indices<'a, P: Pattern<'a>>(&'a self, pat: P) -> RMatchIndices<'a, P> pub fn rmatch_indices<'a, P: Pattern<'a>>(&'a self, pat: P) -> RMatchIndices<'a, P>
where P::Searcher: ReverseSearcher<'a> where P::Searcher: ReverseSearcher<'a>
{ {

View file

@ -1131,9 +1131,7 @@ impl ops::DerefMut for String {
} }
/// Error returned from `String::from` /// Error returned from `String::from`
#[unstable(feature = "str_parse_error", reason = "may want to be replaced with \ #[stable(feature = "str_parse_error", since = "1.5.0")]
Void if it ever exists",
issue = "27734")]
#[derive(Copy)] #[derive(Copy)]
pub enum ParseError {} pub enum ParseError {}

View file

@ -865,8 +865,6 @@ impl<T: Clone> Vec<T> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(vec_resize)]
///
/// let mut vec = vec!["hello"]; /// let mut vec = vec!["hello"];
/// vec.resize(3, "world"); /// vec.resize(3, "world");
/// assert_eq!(vec, ["hello", "world", "world"]); /// assert_eq!(vec, ["hello", "world", "world"]);
@ -875,9 +873,7 @@ impl<T: Clone> Vec<T> {
/// vec.resize(2, 0); /// vec.resize(2, 0);
/// assert_eq!(vec, [1, 2]); /// assert_eq!(vec, [1, 2]);
/// ``` /// ```
#[unstable(feature = "vec_resize", #[stable(feature = "vec_resize", since = "1.5.0")]
reason = "matches collection reform specification; waiting for dust to settle",
issue = "27790")]
pub fn resize(&mut self, new_len: usize, value: T) { pub fn resize(&mut self, new_len: usize, value: T) {
let len = self.len(); let len = self.len();

View file

@ -38,12 +38,13 @@ const INITIAL_CAPACITY: usize = 7; // 2^3 - 1
const MINIMUM_CAPACITY: usize = 1; // 2 - 1 const MINIMUM_CAPACITY: usize = 1; // 2 - 1
const MAXIMUM_ZST_CAPACITY: usize = 1 << (usize::BITS - 1); // Largest possible power of two const MAXIMUM_ZST_CAPACITY: usize = 1 << (usize::BITS - 1); // Largest possible power of two
/// `VecDeque` is a growable ring buffer, which can be used as a /// `VecDeque` is a growable ring buffer, which can be used as a double-ended
/// double-ended queue efficiently. /// queue efficiently.
/// ///
/// The "default" usage of this type as a queue is to use `push_back` to add to the queue, and /// The "default" usage of this type as a queue is to use `push_back` to add to
/// `pop_front` to remove from the queue. `extend` and `append` push onto the back in this manner, /// the queue, and `pop_front` to remove from the queue. `extend` and `append`
/// and iterating over `VecDeque` goes front to back. /// push onto the back in this manner, and iterating over `VecDeque` goes front
/// to back.
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
pub struct VecDeque<T> { pub struct VecDeque<T> {
// tail and head are pointers into the buffer. Tail always points // tail and head are pointers into the buffer. Tail always points
@ -499,8 +500,6 @@ impl<T> VecDeque<T> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(deque_extras)]
///
/// use std::collections::VecDeque; /// use std::collections::VecDeque;
/// ///
/// let mut buf = VecDeque::with_capacity(15); /// let mut buf = VecDeque::with_capacity(15);
@ -509,9 +508,7 @@ impl<T> VecDeque<T> {
/// buf.shrink_to_fit(); /// buf.shrink_to_fit();
/// assert!(buf.capacity() >= 4); /// assert!(buf.capacity() >= 4);
/// ``` /// ```
#[unstable(feature = "deque_extras", #[stable(feature = "deque_extras_15", since = "1.5.0")]
reason = "needs to be audited",
issue = "27788")]
pub fn shrink_to_fit(&mut self) { pub fn shrink_to_fit(&mut self) {
// +1 since the ringbuffer always leaves one space empty // +1 since the ringbuffer always leaves one space empty
// len + 1 can't overflow for an existing, well-formed ringbuffer. // len + 1 can't overflow for an existing, well-formed ringbuffer.
@ -653,9 +650,7 @@ impl<T> VecDeque<T> {
/// Returns a pair of slices which contain, in order, the contents of the /// Returns a pair of slices which contain, in order, the contents of the
/// `VecDeque`. /// `VecDeque`.
#[inline] #[inline]
#[unstable(feature = "deque_extras", #[stable(feature = "deque_extras_15", since = "1.5.0")]
reason = "matches collection reform specification, waiting for dust to settle",
issue = "27788")]
pub fn as_slices(&self) -> (&[T], &[T]) { pub fn as_slices(&self) -> (&[T], &[T]) {
unsafe { unsafe {
let contiguous = self.is_contiguous(); let contiguous = self.is_contiguous();
@ -674,9 +669,7 @@ impl<T> VecDeque<T> {
/// Returns a pair of slices which contain, in order, the contents of the /// Returns a pair of slices which contain, in order, the contents of the
/// `VecDeque`. /// `VecDeque`.
#[inline] #[inline]
#[unstable(feature = "deque_extras", #[stable(feature = "deque_extras_15", since = "1.5.0")]
reason = "matches collection reform specification, waiting for dust to settle",
issue = "27788")]
pub fn as_mut_slices(&mut self) -> (&mut [T], &mut [T]) { pub fn as_mut_slices(&mut self) -> (&mut [T], &mut [T]) {
unsafe { unsafe {
let contiguous = self.is_contiguous(); let contiguous = self.is_contiguous();
@ -1035,25 +1028,21 @@ impl<T> VecDeque<T> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(deque_extras)]
///
/// use std::collections::VecDeque; /// use std::collections::VecDeque;
/// ///
/// let mut buf = VecDeque::new(); /// let mut buf = VecDeque::new();
/// assert_eq!(buf.swap_back_remove(0), None); /// assert_eq!(buf.swap_remove_back(0), None);
/// buf.push_back(1); /// buf.push_back(1);
/// buf.push_back(2); /// buf.push_back(2);
/// buf.push_back(3); /// buf.push_back(3);
/// ///
/// assert_eq!(buf.swap_back_remove(0), Some(1)); /// assert_eq!(buf.swap_remove_back(0), Some(1));
/// assert_eq!(buf.len(), 2); /// assert_eq!(buf.len(), 2);
/// assert_eq!(buf[0], 3); /// assert_eq!(buf[0], 3);
/// assert_eq!(buf[1], 2); /// assert_eq!(buf[1], 2);
/// ``` /// ```
#[unstable(feature = "deque_extras", #[stable(feature = "deque_extras_15", since = "1.5.0")]
reason = "the naming of this function may be altered", pub fn swap_remove_back(&mut self, index: usize) -> Option<T> {
issue = "27788")]
pub fn swap_back_remove(&mut self, index: usize) -> Option<T> {
let length = self.len(); let length = self.len();
if length > 0 && index < length - 1 { if length > 0 && index < length - 1 {
self.swap(index, length - 1); self.swap(index, length - 1);
@ -1063,6 +1052,15 @@ impl<T> VecDeque<T> {
self.pop_back() self.pop_back()
} }
/// deprecated
#[unstable(feature = "deque_extras",
reason = "the naming of this function may be altered",
issue = "27788")]
#[deprecated(since = "1.5.0", reason = "renamed to swap_remove_back")]
pub fn swap_back_remove(&mut self, index: usize) -> Option<T> {
self.swap_remove_back(index)
}
/// Removes an element from anywhere in the `VecDeque` and returns it, /// Removes an element from anywhere in the `VecDeque` and returns it,
/// replacing it with the first element. /// replacing it with the first element.
/// ///
@ -1073,25 +1071,21 @@ impl<T> VecDeque<T> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(deque_extras)]
///
/// use std::collections::VecDeque; /// use std::collections::VecDeque;
/// ///
/// let mut buf = VecDeque::new(); /// let mut buf = VecDeque::new();
/// assert_eq!(buf.swap_front_remove(0), None); /// assert_eq!(buf.swap_remove_front(0), None);
/// buf.push_back(1); /// buf.push_back(1);
/// buf.push_back(2); /// buf.push_back(2);
/// buf.push_back(3); /// buf.push_back(3);
/// ///
/// assert_eq!(buf.swap_front_remove(2), Some(3)); /// assert_eq!(buf.swap_remove_front(2), Some(3));
/// assert_eq!(buf.len(), 2); /// assert_eq!(buf.len(), 2);
/// assert_eq!(buf[0], 2); /// assert_eq!(buf[0], 2);
/// assert_eq!(buf[1], 1); /// assert_eq!(buf[1], 1);
/// ``` /// ```
#[unstable(feature = "deque_extras", #[stable(feature = "deque_extras_15", since = "1.5.0")]
reason = "the naming of this function may be altered", pub fn swap_remove_front(&mut self, index: usize) -> Option<T> {
issue = "27788")]
pub fn swap_front_remove(&mut self, index: usize) -> Option<T> {
let length = self.len(); let length = self.len();
if length > 0 && index < length && index != 0 { if length > 0 && index < length && index != 0 {
self.swap(index, 0); self.swap(index, 0);
@ -1101,6 +1095,15 @@ impl<T> VecDeque<T> {
self.pop_front() self.pop_front()
} }
/// deprecated
#[unstable(feature = "deque_extras",
reason = "the naming of this function may be altered",
issue = "27788")]
#[deprecated(since = "1.5.0", reason = "renamed to swap_remove_front")]
pub fn swap_front_remove(&mut self, index: usize) -> Option<T> {
self.swap_remove_front(index)
}
/// Inserts an element at `index` within the `VecDeque`. Whichever /// Inserts an element at `index` within the `VecDeque`. Whichever
/// end is closer to the insertion point will be moved to make room, /// end is closer to the insertion point will be moved to make room,
/// and all the affected elements will be moved to new positions. /// and all the affected elements will be moved to new positions.
@ -1111,8 +1114,6 @@ impl<T> VecDeque<T> {
/// ///
/// # Examples /// # Examples
/// ``` /// ```
/// #![feature(deque_extras)]
///
/// use std::collections::VecDeque; /// use std::collections::VecDeque;
/// ///
/// let mut buf = VecDeque::new(); /// let mut buf = VecDeque::new();
@ -1121,9 +1122,7 @@ impl<T> VecDeque<T> {
/// buf.insert(1, 11); /// buf.insert(1, 11);
/// assert_eq!(Some(&11), buf.get(1)); /// assert_eq!(Some(&11), buf.get(1));
/// ``` /// ```
#[unstable(feature = "deque_extras", #[stable(feature = "deque_extras_15", since = "1.5.0")]
reason = "needs to be audited",
issue = "27788")]
pub fn insert(&mut self, index: usize, value: T) { pub fn insert(&mut self, index: usize, value: T) {
assert!(index <= self.len(), "index out of bounds"); assert!(index <= self.len(), "index out of bounds");
if self.is_full() { if self.is_full() {

View file

@ -91,8 +91,7 @@ pub fn from_u32(i: u32) -> Option<char> {
/// Converts a `u32` to an `char`, not checking whether it is a valid unicode /// Converts a `u32` to an `char`, not checking whether it is a valid unicode
/// codepoint. /// codepoint.
#[inline] #[inline]
#[unstable(feature = "char_from_unchecked", reason = "recently added API", #[stable(feature = "char_from_unchecked", since = "1.5.0")]
issue = "27781")]
pub unsafe fn from_u32_unchecked(i: u32) -> char { pub unsafe fn from_u32_unchecked(i: u32) -> char {
transmute(i) transmute(i)
} }

View file

@ -1098,43 +1098,36 @@ impl<'a> Formatter<'a> {
pub fn flags(&self) -> u32 { self.flags } pub fn flags(&self) -> u32 { self.flags }
/// Character used as 'fill' whenever there is alignment /// Character used as 'fill' whenever there is alignment
#[unstable(feature = "fmt_flags", reason = "method was just created", #[stable(feature = "fmt_flags", since = "1.5.0")]
issue = "27726")]
pub fn fill(&self) -> char { self.fill } pub fn fill(&self) -> char { self.fill }
/// Flag indicating what form of alignment was requested /// Flag indicating what form of alignment was requested
#[unstable(feature = "fmt_flags", reason = "method was just created", #[unstable(feature = "fmt_flags_align", reason = "method was just created",
issue = "27726")] issue = "27726")]
pub fn align(&self) -> Alignment { self.align } pub fn align(&self) -> Alignment { self.align }
/// Optionally specified integer width that the output should be /// Optionally specified integer width that the output should be
#[unstable(feature = "fmt_flags", reason = "method was just created", #[stable(feature = "fmt_flags", since = "1.5.0")]
issue = "27726")]
pub fn width(&self) -> Option<usize> { self.width } pub fn width(&self) -> Option<usize> { self.width }
/// Optionally specified precision for numeric types /// Optionally specified precision for numeric types
#[unstable(feature = "fmt_flags", reason = "method was just created", #[stable(feature = "fmt_flags", since = "1.5.0")]
issue = "27726")]
pub fn precision(&self) -> Option<usize> { self.precision } pub fn precision(&self) -> Option<usize> { self.precision }
/// Determines if the `+` flag was specified. /// Determines if the `+` flag was specified.
#[unstable(feature = "fmt_flags", reason = "method was just created", #[stable(feature = "fmt_flags", since = "1.5.0")]
issue = "27726")]
pub fn sign_plus(&self) -> bool { self.flags & (1 << FlagV1::SignPlus as u32) != 0 } pub fn sign_plus(&self) -> bool { self.flags & (1 << FlagV1::SignPlus as u32) != 0 }
/// Determines if the `-` flag was specified. /// Determines if the `-` flag was specified.
#[unstable(feature = "fmt_flags", reason = "method was just created", #[stable(feature = "fmt_flags", since = "1.5.0")]
issue = "27726")]
pub fn sign_minus(&self) -> bool { self.flags & (1 << FlagV1::SignMinus as u32) != 0 } pub fn sign_minus(&self) -> bool { self.flags & (1 << FlagV1::SignMinus as u32) != 0 }
/// Determines if the `#` flag was specified. /// Determines if the `#` flag was specified.
#[unstable(feature = "fmt_flags", reason = "method was just created", #[stable(feature = "fmt_flags", since = "1.5.0")]
issue = "27726")]
pub fn alternate(&self) -> bool { self.flags & (1 << FlagV1::Alternate as u32) != 0 } pub fn alternate(&self) -> bool { self.flags & (1 << FlagV1::Alternate as u32) != 0 }
/// Determines if the `0` flag was specified. /// Determines if the `0` flag was specified.
#[unstable(feature = "fmt_flags", reason = "method was just created", #[stable(feature = "fmt_flags", since = "1.5.0")]
issue = "27726")]
pub fn sign_aware_zero_pad(&self) -> bool { pub fn sign_aware_zero_pad(&self) -> bool {
self.flags & (1 << FlagV1::SignAwareZeroPad as u32) != 0 self.flags & (1 << FlagV1::SignAwareZeroPad as u32) != 0
} }

View file

@ -1257,7 +1257,7 @@ pub trait Iterator {
/// Lexicographically compares the elements of this `Iterator` with those /// Lexicographically compares the elements of this `Iterator` with those
/// of another. /// of another.
#[unstable(feature = "iter_order", reason = "needs review and revision", issue = "27737")] #[stable(feature = "iter_order", since = "1.5.0")]
fn cmp<I>(mut self, other: I) -> Ordering where fn cmp<I>(mut self, other: I) -> Ordering where
I: IntoIterator<Item = Self::Item>, I: IntoIterator<Item = Self::Item>,
Self::Item: Ord, Self::Item: Ord,
@ -1280,7 +1280,7 @@ pub trait Iterator {
/// Lexicographically compares the elements of this `Iterator` with those /// Lexicographically compares the elements of this `Iterator` with those
/// of another. /// of another.
#[unstable(feature = "iter_order", reason = "needs review and revision", issue = "27737")] #[stable(feature = "iter_order", since = "1.5.0")]
fn partial_cmp<I>(mut self, other: I) -> Option<Ordering> where fn partial_cmp<I>(mut self, other: I) -> Option<Ordering> where
I: IntoIterator, I: IntoIterator,
Self::Item: PartialOrd<I::Item>, Self::Item: PartialOrd<I::Item>,
@ -1303,7 +1303,7 @@ pub trait Iterator {
/// Determines if the elements of this `Iterator` are equal to those of /// Determines if the elements of this `Iterator` are equal to those of
/// another. /// another.
#[unstable(feature = "iter_order", reason = "needs review and revision", issue = "27737")] #[stable(feature = "iter_order", since = "1.5.0")]
fn eq<I>(mut self, other: I) -> bool where fn eq<I>(mut self, other: I) -> bool where
I: IntoIterator, I: IntoIterator,
Self::Item: PartialEq<I::Item>, Self::Item: PartialEq<I::Item>,
@ -1322,7 +1322,7 @@ pub trait Iterator {
/// Determines if the elements of this `Iterator` are unequal to those of /// Determines if the elements of this `Iterator` are unequal to those of
/// another. /// another.
#[unstable(feature = "iter_order", reason = "needs review and revision", issue = "27737")] #[stable(feature = "iter_order", since = "1.5.0")]
fn ne<I>(mut self, other: I) -> bool where fn ne<I>(mut self, other: I) -> bool where
I: IntoIterator, I: IntoIterator,
Self::Item: PartialEq<I::Item>, Self::Item: PartialEq<I::Item>,
@ -1341,7 +1341,7 @@ pub trait Iterator {
/// Determines if the elements of this `Iterator` are lexicographically /// Determines if the elements of this `Iterator` are lexicographically
/// less than those of another. /// less than those of another.
#[unstable(feature = "iter_order", reason = "needs review and revision", issue = "27737")] #[stable(feature = "iter_order", since = "1.5.0")]
fn lt<I>(mut self, other: I) -> bool where fn lt<I>(mut self, other: I) -> bool where
I: IntoIterator, I: IntoIterator,
Self::Item: PartialOrd<I::Item>, Self::Item: PartialOrd<I::Item>,
@ -1368,7 +1368,7 @@ pub trait Iterator {
/// Determines if the elements of this `Iterator` are lexicographically /// Determines if the elements of this `Iterator` are lexicographically
/// less or equal to those of another. /// less or equal to those of another.
#[unstable(feature = "iter_order", reason = "needs review and revision", issue = "27737")] #[stable(feature = "iter_order", since = "1.5.0")]
fn le<I>(mut self, other: I) -> bool where fn le<I>(mut self, other: I) -> bool where
I: IntoIterator, I: IntoIterator,
Self::Item: PartialOrd<I::Item>, Self::Item: PartialOrd<I::Item>,
@ -1395,7 +1395,7 @@ pub trait Iterator {
/// Determines if the elements of this `Iterator` are lexicographically /// Determines if the elements of this `Iterator` are lexicographically
/// greater than those of another. /// greater than those of another.
#[unstable(feature = "iter_order", reason = "needs review and revision", issue = "27737")] #[stable(feature = "iter_order", since = "1.5.0")]
fn gt<I>(mut self, other: I) -> bool where fn gt<I>(mut self, other: I) -> bool where
I: IntoIterator, I: IntoIterator,
Self::Item: PartialOrd<I::Item>, Self::Item: PartialOrd<I::Item>,
@ -1422,7 +1422,7 @@ pub trait Iterator {
/// Determines if the elements of this `Iterator` are lexicographically /// Determines if the elements of this `Iterator` are lexicographically
/// greater than or equal to those of another. /// greater than or equal to those of another.
#[unstable(feature = "iter_order", reason = "needs review and revision", issue = "27737")] #[stable(feature = "iter_order", since = "1.5.0")]
fn ge<I>(mut self, other: I) -> bool where fn ge<I>(mut self, other: I) -> bool where
I: IntoIterator, I: IntoIterator,
Self::Item: PartialOrd<I::Item>, Self::Item: PartialOrd<I::Item>,
@ -2934,6 +2934,8 @@ impl<A> Iterator for StepBy<A, RangeFrom<A>> where
#[unstable(feature = "range_inclusive", #[unstable(feature = "range_inclusive",
reason = "likely to be replaced by range notation and adapters", reason = "likely to be replaced by range notation and adapters",
issue = "27777")] issue = "27777")]
#[deprecated(since = "1.5.0", reason = "replaced with ... syntax")]
#[allow(deprecated)]
pub struct RangeInclusive<A> { pub struct RangeInclusive<A> {
range: ops::Range<A>, range: ops::Range<A>,
done: bool, done: bool,
@ -2944,6 +2946,8 @@ pub struct RangeInclusive<A> {
#[unstable(feature = "range_inclusive", #[unstable(feature = "range_inclusive",
reason = "likely to be replaced by range notation and adapters", reason = "likely to be replaced by range notation and adapters",
issue = "27777")] issue = "27777")]
#[deprecated(since = "1.5.0", reason = "replaced with ... syntax")]
#[allow(deprecated)]
pub fn range_inclusive<A>(start: A, stop: A) -> RangeInclusive<A> pub fn range_inclusive<A>(start: A, stop: A) -> RangeInclusive<A>
where A: Step + One + Clone where A: Step + One + Clone
{ {
@ -2956,6 +2960,8 @@ pub fn range_inclusive<A>(start: A, stop: A) -> RangeInclusive<A>
#[unstable(feature = "range_inclusive", #[unstable(feature = "range_inclusive",
reason = "likely to be replaced by range notation and adapters", reason = "likely to be replaced by range notation and adapters",
issue = "27777")] issue = "27777")]
#[deprecated(since = "1.5.0", reason = "replaced with ... syntax")]
#[allow(deprecated)]
impl<A> Iterator for RangeInclusive<A> where impl<A> Iterator for RangeInclusive<A> where
A: PartialEq + Step + One + Clone, A: PartialEq + Step + One + Clone,
for<'a> &'a A: Add<&'a A, Output = A> for<'a> &'a A: Add<&'a A, Output = A>
@ -2990,6 +2996,8 @@ impl<A> Iterator for RangeInclusive<A> where
#[unstable(feature = "range_inclusive", #[unstable(feature = "range_inclusive",
reason = "likely to be replaced by range notation and adapters", reason = "likely to be replaced by range notation and adapters",
issue = "27777")] issue = "27777")]
#[deprecated(since = "1.5.0", reason = "replaced with ... syntax")]
#[allow(deprecated)]
impl<A> DoubleEndedIterator for RangeInclusive<A> where impl<A> DoubleEndedIterator for RangeInclusive<A> where
A: PartialEq + Step + One + Clone, A: PartialEq + Step + One + Clone,
for<'a> &'a A: Add<&'a A, Output = A>, for<'a> &'a A: Add<&'a A, Output = A>,
@ -3367,7 +3375,7 @@ pub fn once<T>(value: T) -> Once<T> {
/// If two sequences are equal up until the point where one ends, /// If two sequences are equal up until the point where one ends,
/// the shorter sequence compares less. /// the shorter sequence compares less.
#[deprecated(since = "1.4.0", reason = "use the equivalent methods on `Iterator` instead")] #[deprecated(since = "1.4.0", reason = "use the equivalent methods on `Iterator` instead")]
#[unstable(feature = "iter_order", reason = "needs review and revision", #[unstable(feature = "iter_order_deprecated", reason = "needs review and revision",
issue = "27737")] issue = "27737")]
pub mod order { pub mod order {
use cmp; use cmp;

View file

@ -290,6 +290,7 @@ impl<T> Option<T> {
reason = "waiting for mut conventions", reason = "waiting for mut conventions",
issue = "27776")] issue = "27776")]
#[deprecated(since = "1.4.0", reason = "niche API, unclear of usefulness")] #[deprecated(since = "1.4.0", reason = "niche API, unclear of usefulness")]
#[allow(deprecated)]
pub fn as_mut_slice(&mut self) -> &mut [T] { pub fn as_mut_slice(&mut self) -> &mut [T] {
match *self { match *self {
Some(ref mut x) => { Some(ref mut x) => {
@ -694,6 +695,7 @@ impl<T> Option<T> {
#[unstable(feature = "as_slice", reason = "unsure of the utility here", #[unstable(feature = "as_slice", reason = "unsure of the utility here",
issue = "27776")] issue = "27776")]
#[deprecated(since = "1.4.0", reason = "niche API, unclear of usefulness")] #[deprecated(since = "1.4.0", reason = "niche API, unclear of usefulness")]
#[allow(deprecated)]
pub fn as_slice(&self) -> &[T] { pub fn as_slice(&self) -> &[T] {
match *self { match *self {
Some(ref x) => slice::ref_slice(x), Some(ref x) => slice::ref_slice(x),

View file

@ -408,6 +408,7 @@ impl<T, E> Result<T, E> {
#[unstable(feature = "as_slice", reason = "unsure of the utility here", #[unstable(feature = "as_slice", reason = "unsure of the utility here",
issue = "27776")] issue = "27776")]
#[deprecated(since = "1.4.0", reason = "niche API, unclear of usefulness")] #[deprecated(since = "1.4.0", reason = "niche API, unclear of usefulness")]
#[allow(deprecated)]
pub fn as_slice(&self) -> &[T] { pub fn as_slice(&self) -> &[T] {
match *self { match *self {
Ok(ref x) => slice::ref_slice(x), Ok(ref x) => slice::ref_slice(x),
@ -441,6 +442,7 @@ impl<T, E> Result<T, E> {
reason = "waiting for mut conventions", reason = "waiting for mut conventions",
issue = "27776")] issue = "27776")]
#[deprecated(since = "1.4.0", reason = "niche API, unclear of usefulness")] #[deprecated(since = "1.4.0", reason = "niche API, unclear of usefulness")]
#[allow(deprecated)]
pub fn as_mut_slice(&mut self) -> &mut [T] { pub fn as_mut_slice(&mut self) -> &mut [T] {
match *self { match *self {
Ok(ref mut x) => slice::mut_ref_slice(x), Ok(ref mut x) => slice::mut_ref_slice(x),

View file

@ -1412,6 +1412,7 @@ impl<'a, T> ExactSizeIterator for ChunksMut<'a, T> {}
/// Converts a reference to A into a slice of length 1 (without copying). /// Converts a reference to A into a slice of length 1 (without copying).
#[unstable(feature = "ref_slice", issue = "27774")] #[unstable(feature = "ref_slice", issue = "27774")]
#[deprecated(since = "1.5.0", reason = "unclear whether belongs in libstd")]
pub fn ref_slice<A>(s: &A) -> &[A] { pub fn ref_slice<A>(s: &A) -> &[A] {
unsafe { unsafe {
from_raw_parts(s, 1) from_raw_parts(s, 1)
@ -1420,6 +1421,7 @@ pub fn ref_slice<A>(s: &A) -> &[A] {
/// Converts a reference to A into a slice of length 1 (without copying). /// Converts a reference to A into a slice of length 1 (without copying).
#[unstable(feature = "ref_slice", issue = "27774")] #[unstable(feature = "ref_slice", issue = "27774")]
#[deprecated(since = "1.5.0", reason = "unclear whether belongs in libstd")]
pub fn mut_ref_slice<A>(s: &mut A) -> &mut [A] { pub fn mut_ref_slice<A>(s: &mut A) -> &mut [A] {
unsafe { unsafe {
from_raw_parts_mut(s, 1) from_raw_parts_mut(s, 1)

View file

@ -155,8 +155,7 @@ impl Utf8Error {
/// // the first byte is invalid here /// // the first byte is invalid here
/// assert_eq!(1, error.valid_up_to()); /// assert_eq!(1, error.valid_up_to());
/// ``` /// ```
#[unstable(feature = "utf8_error", reason = "method just added", #[stable(feature = "utf8_error", since = "1.5.0")]
issue = "27734")]
pub fn valid_up_to(&self) -> usize { self.valid_up_to } pub fn valid_up_to(&self) -> usize { self.valid_up_to }
} }
@ -882,9 +881,7 @@ generate_pattern_iterators! {
/// Created with the method `.rmatch_indices()`. /// Created with the method `.rmatch_indices()`.
struct RMatchIndices; struct RMatchIndices;
stability: stability:
#[unstable(feature = "str_match_indices", #[stable(feature = "str_match_indices", since = "1.5.0")]
reason = "type may be removed or have its iterator impl changed",
issue = "27743")]
internal: internal:
MatchIndicesInternal yielding ((usize, &'a str)); MatchIndicesInternal yielding ((usize, &'a str));
delegate double ended; delegate double ended;

View file

@ -87,8 +87,6 @@ impl IndependentSample<f64> for Exp {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use std::prelude::v1::*;
use distributions::{Sample, IndependentSample}; use distributions::{Sample, IndependentSample};
use super::Exp; use super::Exp;
@ -117,8 +115,6 @@ mod tests {
mod bench { mod bench {
extern crate test; extern crate test;
use std::prelude::v1::*;
use self::test::Bencher; use self::test::Bencher;
use std::mem::size_of; use std::mem::size_of;
use super::Exp; use super::Exp;

View file

@ -289,8 +289,6 @@ impl IndependentSample<f64> for StudentT {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use std::prelude::v1::*;
use distributions::{Sample, IndependentSample}; use distributions::{Sample, IndependentSample};
use super::{ChiSquared, StudentT, FisherF}; use super::{ChiSquared, StudentT, FisherF};
@ -351,7 +349,6 @@ mod tests {
#[cfg(test)] #[cfg(test)]
mod bench { mod bench {
extern crate test; extern crate test;
use std::prelude::v1::*;
use self::test::Bencher; use self::test::Bencher;
use std::mem::size_of; use std::mem::size_of;
use distributions::IndependentSample; use distributions::IndependentSample;

View file

@ -263,8 +263,6 @@ fn ziggurat<R: Rng, P, Z>(rng: &mut R,
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use std::prelude::v1::*;
use {Rng, Rand}; use {Rng, Rand};
use super::{RandSample, WeightedChoice, Weighted, Sample, IndependentSample}; use super::{RandSample, WeightedChoice, Weighted, Sample, IndependentSample};

View file

@ -144,8 +144,6 @@ impl IndependentSample<f64> for LogNormal {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use std::prelude::v1::*;
use distributions::{Sample, IndependentSample}; use distributions::{Sample, IndependentSample};
use super::{Normal, LogNormal}; use super::{Normal, LogNormal};
@ -184,7 +182,6 @@ mod tests {
#[cfg(test)] #[cfg(test)]
mod bench { mod bench {
extern crate test; extern crate test;
use std::prelude::v1::*;
use self::test::Bencher; use self::test::Bencher;
use std::mem::size_of; use std::mem::size_of;
use distributions::Sample; use distributions::Sample;

View file

@ -148,7 +148,6 @@ float_impl! { f64 }
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use std::prelude::v1::*;
use distributions::{Sample, IndependentSample}; use distributions::{Sample, IndependentSample};
use super::Range; use super::Range;

View file

@ -39,7 +39,7 @@
#![feature(custom_attribute)] #![feature(custom_attribute)]
#![allow(unused_attributes)] #![allow(unused_attributes)]
#![cfg_attr(test, feature(test, rand, rustc_private, iter_order))] #![cfg_attr(test, feature(test, rand, rustc_private, iter_order_deprecated))]
#![allow(deprecated)] #![allow(deprecated)]

View file

@ -123,7 +123,7 @@ impl Default for ReseedWithDefault {
mod tests { mod tests {
use std::prelude::v1::*; use std::prelude::v1::*;
use core::iter::{order, repeat}; use core::iter::order;
use super::{ReseedingRng, ReseedWithDefault}; use super::{ReseedingRng, ReseedWithDefault};
use {SeedableRng, Rng}; use {SeedableRng, Rng};

View file

@ -35,7 +35,6 @@
#![feature(duration_span)] #![feature(duration_span)]
#![feature(dynamic_lib)] #![feature(dynamic_lib)]
#![feature(enumset)] #![feature(enumset)]
#![feature(fs_canonicalize)]
#![feature(hashmap_hasher)] #![feature(hashmap_hasher)]
#![feature(into_cow)] #![feature(into_cow)]
#![feature(iter_cmp)] #![feature(iter_cmp)]
@ -43,18 +42,13 @@
#![feature(libc)] #![feature(libc)]
#![feature(nonzero)] #![feature(nonzero)]
#![feature(num_bits_bytes)] #![feature(num_bits_bytes)]
#![feature(path_ext)]
#![feature(quote)] #![feature(quote)]
#![feature(range_inclusive)]
#![feature(ref_slice)]
#![feature(rustc_diagnostic_macros)] #![feature(rustc_diagnostic_macros)]
#![feature(rustc_private)] #![feature(rustc_private)]
#![feature(scoped_tls)] #![feature(scoped_tls)]
#![feature(slice_splits)]
#![feature(slice_patterns)] #![feature(slice_patterns)]
#![feature(staged_api)] #![feature(staged_api)]
#![feature(str_char)] #![feature(str_char)]
#![feature(str_match_indices)]
#![feature(vec_push_all)] #![feature(vec_push_all)]
#![feature(wrapping)] #![feature(wrapping)]
#![feature(cell_extras)] #![feature(cell_extras)]

View file

@ -29,13 +29,13 @@ use middle::ty::*;
use middle::ty; use middle::ty;
use std::cmp::Ordering; use std::cmp::Ordering;
use std::fmt; use std::fmt;
use std::iter::{range_inclusive, FromIterator, IntoIterator, repeat}; use std::iter::{FromIterator, IntoIterator, repeat};
use std::slice;
use rustc_front::hir; use rustc_front::hir;
use rustc_front::hir::Pat; use rustc_front::hir::Pat;
use rustc_front::visit::{self, Visitor, FnKind}; use rustc_front::visit::{self, Visitor, FnKind};
use rustc_front::util as front_util; use rustc_front::util as front_util;
use rustc_back::slice;
use syntax::ast::{self, DUMMY_NODE_ID, NodeId}; use syntax::ast::{self, DUMMY_NODE_ID, NodeId};
use syntax::ast_util; use syntax::ast_util;
@ -615,7 +615,7 @@ fn all_constructors(_cx: &MatchCheckCtxt, left_ty: Ty,
ty::TyRef(_, ty::TypeAndMut { ty, .. }) => match ty.sty { ty::TyRef(_, ty::TypeAndMut { ty, .. }) => match ty.sty {
ty::TySlice(_) => ty::TySlice(_) =>
range_inclusive(0, max_slice_length).map(|length| Slice(length)).collect(), (0..max_slice_length+1).map(|length| Slice(length)).collect(),
_ => vec![Single] _ => vec![Single]
}, },
@ -790,7 +790,7 @@ fn pat_constructors(cx: &MatchCheckCtxt, p: &Pat,
match left_ty.sty { match left_ty.sty {
ty::TyArray(_, _) => vec!(Single), ty::TyArray(_, _) => vec!(Single),
_ => if slice.is_some() { _ => if slice.is_some() {
range_inclusive(before.len() + after.len(), max_slice_length) (before.len() + after.len()..max_slice_length+1)
.map(|length| Slice(length)) .map(|length| Slice(length))
.collect() .collect()
} else { } else {

View file

@ -15,7 +15,6 @@ use metadata::creader::CrateReader;
use plugin::registry::Registry; use plugin::registry::Registry;
use std::borrow::ToOwned; use std::borrow::ToOwned;
use std::dynamic_lib::DynamicLibrary;
use std::env; use std::env;
use std::mem; use std::mem;
use std::path::PathBuf; use std::path::PathBuf;
@ -103,10 +102,13 @@ impl<'a> PluginLoader<'a> {
} }
// Dynamically link a registrar function into the compiler process. // Dynamically link a registrar function into the compiler process.
#[allow(deprecated)]
fn dylink_registrar(&mut self, fn dylink_registrar(&mut self,
span: Span, span: Span,
path: PathBuf, path: PathBuf,
symbol: String) -> PluginRegistrarFun { symbol: String) -> PluginRegistrarFun {
use std::dynamic_lib::DynamicLibrary;
// Make sure the path contains a / or the linker will search for it. // Make sure the path contains a / or the linker will search for it.
let path = env::current_dir().unwrap().join(&path); let path = env::current_dir().unwrap().join(&path);

View file

@ -33,9 +33,7 @@
html_root_url = "https://doc.rust-lang.org/nightly/")] html_root_url = "https://doc.rust-lang.org/nightly/")]
#![feature(box_syntax)] #![feature(box_syntax)]
#![feature(fs_canonicalize)]
#![feature(libc)] #![feature(libc)]
#![feature(path_ext)]
#![feature(rand)] #![feature(rand)]
#![feature(rustc_private)] #![feature(rustc_private)]
#![feature(slice_bytes)] #![feature(slice_bytes)]
@ -57,3 +55,4 @@ pub mod rpath;
pub mod sha2; pub mod sha2;
pub mod svh; pub mod svh;
pub mod target; pub mod target;
pub mod slice;

View file

@ -0,0 +1,19 @@
// Copyright 2015 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.
use std::mem;
pub fn ref_slice<T>(ptr: &T) -> &[T; 1] {
unsafe { mem::transmute(ptr) }
}
pub fn mut_ref_slice<T>(ptr: &mut T) -> &mut [T; 1] {
unsafe { mem::transmute(ptr) }
}

View file

@ -35,7 +35,6 @@
#![feature(box_syntax)] #![feature(box_syntax)]
#![feature(num_bits_bytes)] #![feature(num_bits_bytes)]
#![feature(quote)] #![feature(quote)]
#![feature(ref_slice)]
#![feature(rustc_diagnostic_macros)] #![feature(rustc_diagnostic_macros)]
#![feature(rustc_private)] #![feature(rustc_private)]
#![feature(slice_patterns)] #![feature(slice_patterns)]
@ -48,6 +47,7 @@ extern crate rustc;
#[macro_use] #[macro_use]
extern crate log; extern crate log;
extern crate rustc_front; extern crate rustc_front;
extern crate rustc_back;
pub use rustc::lint as lint; pub use rustc::lint as lint;
pub use rustc::metadata as metadata; pub use rustc::metadata as metadata;

View file

@ -18,7 +18,6 @@ use lint::{LateContext, EarlyContext, LintContext, LintArray};
use lint::{LintPass, EarlyLintPass, LateLintPass}; use lint::{LintPass, EarlyLintPass, LateLintPass};
use std::collections::hash_map::Entry::{Occupied, Vacant}; use std::collections::hash_map::Entry::{Occupied, Vacant};
use std::slice;
use syntax::ast; use syntax::ast;
use syntax::attr::{self, AttrMetaMethods}; use syntax::attr::{self, AttrMetaMethods};
@ -26,8 +25,8 @@ use syntax::codemap::Span;
use syntax::feature_gate::{KNOWN_ATTRIBUTES, AttributeType}; use syntax::feature_gate::{KNOWN_ATTRIBUTES, AttributeType};
use syntax::ptr::P; use syntax::ptr::P;
use rustc_back::slice;
use rustc_front::hir; use rustc_front::hir;
use rustc_front::visit::FnKind; use rustc_front::visit::FnKind;
declare_lint! { declare_lint! {

View file

@ -18,7 +18,6 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
#![crate_type = "rlib"] #![crate_type = "rlib"]
#![crate_type = "dylib"] #![crate_type = "dylib"]
#![feature(ref_slice)]
#![feature(rustc_private)] #![feature(rustc_private)]
#![feature(into_cow)] #![feature(into_cow)]
@ -27,6 +26,7 @@ extern crate graphviz as dot;
extern crate rustc; extern crate rustc;
extern crate rustc_data_structures; extern crate rustc_data_structures;
extern crate rustc_front; extern crate rustc_front;
extern crate rustc_back;
extern crate syntax; extern crate syntax;
pub mod build; pub mod build;

View file

@ -13,12 +13,12 @@ use rustc::middle::def_id::DefId;
use rustc::middle::region::CodeExtent; use rustc::middle::region::CodeExtent;
use rustc::middle::subst::Substs; use rustc::middle::subst::Substs;
use rustc::middle::ty::{AdtDef, ClosureSubsts, Region, Ty}; use rustc::middle::ty::{AdtDef, ClosureSubsts, Region, Ty};
use rustc_back::slice;
use rustc_data_structures::fnv::FnvHashMap; use rustc_data_structures::fnv::FnvHashMap;
use rustc_front::hir::InlineAsm; use rustc_front::hir::InlineAsm;
use syntax::ast::Name; use syntax::ast::Name;
use syntax::codemap::Span; use syntax::codemap::Span;
use std::fmt::{Debug, Formatter, Error}; use std::fmt::{Debug, Formatter, Error};
use std::slice;
use std::u32; use std::u32;
/// Lowered representation of a single function. /// Lowered representation of a single function.

View file

@ -23,7 +23,6 @@
#![feature(borrow_state)] #![feature(borrow_state)]
#![feature(rustc_diagnostic_macros)] #![feature(rustc_diagnostic_macros)]
#![feature(rustc_private)] #![feature(rustc_private)]
#![feature(slice_splits)]
#![feature(staged_api)] #![feature(staged_api)]
#[macro_use] extern crate log; #[macro_use] extern crate log;

View file

@ -36,7 +36,7 @@ use std::ascii;
use std::char; use std::char;
use std::env; use std::env;
use std::ffi::OsString; use std::ffi::OsString;
use std::fs::{self, PathExt}; use std::fs;
use std::io::{self, Read, Write}; use std::io::{self, Read, Write};
use std::iter::once; use std::iter::once;
use std::mem; use std::mem;

View file

@ -33,16 +33,12 @@
#![feature(iter_cmp)] #![feature(iter_cmp)]
#![feature(iter_arith)] #![feature(iter_arith)]
#![feature(libc)] #![feature(libc)]
#![feature(path_ext)]
#![feature(path_ext)]
#![feature(path_relative_from)]
#![feature(path_relative_from)] #![feature(path_relative_from)]
#![feature(quote)] #![feature(quote)]
#![feature(rustc_diagnostic_macros)] #![feature(rustc_diagnostic_macros)]
#![feature(rustc_private)] #![feature(rustc_private)]
#![feature(staged_api)] #![feature(staged_api)]
#![feature(unicode)] #![feature(unicode)]
#![feature(unicode)]
#![feature(vec_push_all)] #![feature(vec_push_all)]
#![allow(trivial_casts)] #![allow(trivial_casts)]

View file

@ -66,7 +66,6 @@ use rscope::{self, UnelidableRscope, RegionScope, ElidableRscope,
use util::common::{ErrorReported, FN_OUTPUT_NAME}; use util::common::{ErrorReported, FN_OUTPUT_NAME};
use util::nodemap::FnvHashSet; use util::nodemap::FnvHashSet;
use std::slice;
use syntax::{abi, ast}; use syntax::{abi, ast};
use syntax::codemap::{Span, Pos}; use syntax::codemap::{Span, Pos};
use syntax::feature_gate::{GateIssue, emit_feature_err}; use syntax::feature_gate::{GateIssue, emit_feature_err};
@ -74,7 +73,7 @@ use syntax::parse::token;
use rustc_front::print::pprust; use rustc_front::print::pprust;
use rustc_front::hir; use rustc_front::hir;
use rustc_back::slice;
pub trait AstConv<'tcx> { pub trait AstConv<'tcx> {
fn tcx<'a>(&'a self) -> &'a ty::ctxt<'tcx>; fn tcx<'a>(&'a self) -> &'a ty::ctxt<'tcx>;

View file

@ -115,7 +115,6 @@ use util::lev_distance::lev_distance;
use std::cell::{Cell, Ref, RefCell}; use std::cell::{Cell, Ref, RefCell};
use std::collections::{HashSet}; use std::collections::{HashSet};
use std::mem::replace; use std::mem::replace;
use std::slice;
use syntax::abi; use syntax::abi;
use syntax::ast; use syntax::ast;
use syntax::attr; use syntax::attr;
@ -130,6 +129,7 @@ use rustc_front::hir;
use rustc_front::hir::Visibility; use rustc_front::hir::Visibility;
use rustc_front::hir::{Item, ItemImpl}; use rustc_front::hir::{Item, ItemImpl};
use rustc_front::print::pprust; use rustc_front::print::pprust;
use rustc_back::slice;
mod assoc; mod assoc;
pub mod dropck; pub mod dropck;

View file

@ -81,10 +81,8 @@ This API is completely unstable and subject to change.
#![feature(iter_cmp)] #![feature(iter_cmp)]
#![feature(iter_arith)] #![feature(iter_arith)]
#![feature(quote)] #![feature(quote)]
#![feature(ref_slice)]
#![feature(rustc_diagnostic_macros)] #![feature(rustc_diagnostic_macros)]
#![feature(rustc_private)] #![feature(rustc_private)]
#![feature(slice_splits)]
#![feature(staged_api)] #![feature(staged_api)]
#![feature(vec_push_all)] #![feature(vec_push_all)]
#![feature(cell_extras)] #![feature(cell_extras)]
@ -97,6 +95,7 @@ extern crate fmt_macros;
extern crate rustc; extern crate rustc;
extern crate rustc_platform_intrinsics as intrinsics; extern crate rustc_platform_intrinsics as intrinsics;
extern crate rustc_front; extern crate rustc_front;
extern crate rustc_back;
pub use rustc::front; pub use rustc::front;
pub use rustc::lint; pub use rustc::lint;

View file

@ -34,7 +34,6 @@
test(no_crate_inject))] test(no_crate_inject))]
#![no_std] #![no_std]
#![feature(char_from_unchecked)]
#![feature(core_char_ext)] #![feature(core_char_ext)]
#![feature(core_slice_ext)] #![feature(core_slice_ext)]
#![feature(core_str_ext)] #![feature(core_str_ext)]

View file

@ -24,7 +24,6 @@
#![feature(box_syntax)] #![feature(box_syntax)]
#![feature(dynamic_lib)] #![feature(dynamic_lib)]
#![feature(libc)] #![feature(libc)]
#![feature(path_ext)]
#![feature(path_relative_from)] #![feature(path_relative_from)]
#![feature(rustc_private)] #![feature(rustc_private)]
#![feature(set_stdio)] #![feature(set_stdio)]

View file

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#![allow(deprecated)]
use clean; use clean;
use std::dynamic_lib as dl; use std::dynamic_lib as dl;

View file

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#![allow(deprecated)]
use std::cell::{RefCell, Cell}; use std::cell::{RefCell, Cell};
use std::collections::{HashSet, HashMap}; use std::collections::{HashSet, HashMap};
use std::dynamic_lib::DynamicLibrary; use std::dynamic_lib::DynamicLibrary;

View file

@ -16,7 +16,9 @@
reason = "API has not been scrutinized and is highly likely to \ reason = "API has not been scrutinized and is highly likely to \
either disappear or change", either disappear or change",
issue = "27810")] issue = "27810")]
#![deprecated(since = "1.5.0", reason = "replaced with crates.io crates")]
#![allow(missing_docs)] #![allow(missing_docs)]
#![allow(deprecated)]
use prelude::v1::*; use prelude::v1::*;

View file

@ -955,8 +955,21 @@ pub fn read_link<P: AsRef<Path>>(path: P) -> io::Result<PathBuf> {
/// Returns the canonical form of a path with all intermediate components /// Returns the canonical form of a path with all intermediate components
/// normalized and symbolic links resolved. /// normalized and symbolic links resolved.
#[unstable(feature = "fs_canonicalize", reason = "recently added API", ///
issue = "27706")] /// This function may return an error in situations like where the path does not
/// exist, a component in the path is not a directory, or an I/O error happens.
///
/// # Examples
///
/// ```
/// use std::fs;
///
/// # fn foo() -> std::io::Result<()> {
/// let path = try!(fs::canonicalize("../a/../foo.txt"));
/// # Ok(())
/// # }
/// ```
#[stable(feature = "fs_canonicalize", since = "1.5.0")]
pub fn canonicalize<P: AsRef<Path>>(path: P) -> io::Result<PathBuf> { pub fn canonicalize<P: AsRef<Path>>(path: P) -> io::Result<PathBuf> {
fs_imp::canonicalize(path.as_ref()) fs_imp::canonicalize(path.as_ref())
} }
@ -1158,11 +1171,12 @@ impl Iterator for WalkDir {
} }
/// Utility methods for paths. /// Utility methods for paths.
#[unstable(feature = "path_ext", #[unstable(feature = "path_ext_deprecated",
reason = "The precise set of methods exposed on this trait may \ reason = "The precise set of methods exposed on this trait may \
change and some methods may be removed. For stable code, \ change and some methods may be removed. For stable code, \
see the std::fs::metadata function.", see the std::fs::metadata function.",
issue = "27725")] issue = "27725")]
#[deprecated(since = "1.5.0", reason = "replaced with inherent methods")]
pub trait PathExt { pub trait PathExt {
/// Gets information on the file, directory, etc at this path. /// Gets information on the file, directory, etc at this path.
/// ///
@ -1215,6 +1229,7 @@ pub trait PathExt {
fn is_dir(&self) -> bool; fn is_dir(&self) -> bool;
} }
#[allow(deprecated)]
impl PathExt for Path { impl PathExt for Path {
fn metadata(&self) -> io::Result<Metadata> { metadata(self) } fn metadata(&self) -> io::Result<Metadata> { metadata(self) }
fn symlink_metadata(&self) -> io::Result<Metadata> { symlink_metadata(self) } fn symlink_metadata(&self) -> io::Result<Metadata> { symlink_metadata(self) }

View file

@ -21,4 +21,5 @@
#![stable(feature = "rust1", since = "1.0.0")] #![stable(feature = "rust1", since = "1.0.0")]
pub use super::{Read, Write, BufRead, Seek}; pub use super::{Read, Write, BufRead, Seek};
#[allow(deprecated)]
pub use fs::PathExt; pub use fs::PathExt;

View file

@ -210,7 +210,6 @@
#![feature(borrow_state)] #![feature(borrow_state)]
#![feature(box_syntax)] #![feature(box_syntax)]
#![feature(cfg_target_vendor)] #![feature(cfg_target_vendor)]
#![feature(char_from_unchecked)]
#![feature(char_internals)] #![feature(char_internals)]
#![feature(clone_from_slice)] #![feature(clone_from_slice)]
#![feature(collections)] #![feature(collections)]
@ -225,7 +224,6 @@
#![feature(heap_api)] #![feature(heap_api)]
#![feature(int_error_internals)] #![feature(int_error_internals)]
#![feature(into_cow)] #![feature(into_cow)]
#![feature(iter_order)]
#![feature(lang_items)] #![feature(lang_items)]
#![feature(libc)] #![feature(libc)]
#![feature(linkage, thread_local, asm)] #![feature(linkage, thread_local, asm)]
@ -251,7 +249,6 @@
#![feature(decode_utf16)] #![feature(decode_utf16)]
#![feature(unwind_attributes)] #![feature(unwind_attributes)]
#![feature(vec_push_all)] #![feature(vec_push_all)]
#![feature(vec_resize)]
#![feature(wrapping)] #![feature(wrapping)]
#![feature(zero_one)] #![feature(zero_one)]
#![cfg_attr(windows, feature(str_utf16))] #![cfg_attr(windows, feature(str_utf16))]

View file

@ -101,12 +101,14 @@
use ascii::*; use ascii::*;
use borrow::{Borrow, IntoCow, ToOwned, Cow}; use borrow::{Borrow, IntoCow, ToOwned, Cow};
use cmp; use cmp;
use fmt;
use fs;
use io;
use iter; use iter;
use mem; use mem;
use ops::{self, Deref}; use ops::{self, Deref};
use string::String; use string::String;
use vec::Vec; use vec::Vec;
use fmt;
use ffi::{OsStr, OsString}; use ffi::{OsStr, OsString};
@ -1689,6 +1691,81 @@ impl Path {
pub fn display(&self) -> Display { pub fn display(&self) -> Display {
Display { path: self } Display { path: self }
} }
/// Gets information on the file, directory, etc at this path.
///
/// Consult the `fs::metadata` documentation for more info.
///
/// This call preserves identical runtime/error semantics with
/// `fs::metadata`.
#[stable(feature = "path_ext", since = "1.5.0")]
pub fn metadata(&self) -> io::Result<fs::Metadata> {
fs::metadata(self)
}
/// Gets information on the file, directory, etc at this path.
///
/// Consult the `fs::symlink_metadata` documentation for more info.
///
/// This call preserves identical runtime/error semantics with
/// `fs::symlink_metadata`.
#[stable(feature = "path_ext", since = "1.5.0")]
pub fn symlink_metadata(&self) -> io::Result<fs::Metadata> {
fs::symlink_metadata(self)
}
/// Returns the canonical form of a path, normalizing all components and
/// eliminate all symlinks.
///
/// This call preserves identical runtime/error semantics with
/// `fs::canonicalize`.
#[stable(feature = "path_ext", since = "1.5.0")]
pub fn canonicalize(&self) -> io::Result<PathBuf> {
fs::canonicalize(self)
}
/// Reads the symlink at this path.
///
/// For more information see `fs::read_link`.
#[stable(feature = "path_ext", since = "1.5.0")]
pub fn read_link(&self) -> io::Result<PathBuf> {
fs::read_link(self)
}
/// Reads the directory at this path.
///
/// For more information see `fs::read_dir`.
#[stable(feature = "path_ext", since = "1.5.0")]
pub fn read_dir(&self) -> io::Result<fs::ReadDir> {
fs::read_dir(self)
}
/// Boolean value indicator whether the underlying file exists on the local
/// filesystem. Returns false in exactly the cases where `fs::stat` fails.
#[stable(feature = "path_ext", since = "1.5.0")]
pub fn exists(&self) -> bool {
fs::metadata(self).is_ok()
}
/// Whether the underlying implementation (be it a file path, or something
/// else) points at a "regular file" on the FS. Will return false for paths
/// to non-existent locations or directories or other non-regular files
/// (named pipes, etc). Follows links when making this determination.
#[stable(feature = "path_ext", since = "1.5.0")]
pub fn is_file(&self) -> bool {
fs::metadata(self).map(|m| m.is_file()).unwrap_or(false)
}
/// Whether the underlying implementation (be it a file path, or something
/// else) is pointing at a directory in the underlying FS. Will return
/// false for paths to non-existent locations or if the item is not a
/// directory (eg files, named pipes, etc). Follows links when making this
/// determination.
#[stable(feature = "path_ext", since = "1.5.0")]
pub fn is_dir(&self) -> bool {
fs::metadata(self).map(|m| m.is_dir()).unwrap_or(false)
}
} }
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]

View file

@ -21,12 +21,12 @@ use time::Duration;
/// A type indicating whether a timed wait on a condition variable returned /// A type indicating whether a timed wait on a condition variable returned
/// due to a time out or not. /// due to a time out or not.
#[derive(Debug, PartialEq, Eq, Copy, Clone)] #[derive(Debug, PartialEq, Eq, Copy, Clone)]
#[unstable(feature = "wait_timeout", reason = "newly added", issue = "27772")] #[stable(feature = "wait_timeout", since = "1.5.0")]
pub struct WaitTimeoutResult(bool); pub struct WaitTimeoutResult(bool);
impl WaitTimeoutResult { impl WaitTimeoutResult {
/// Returns whether the wait was known to have timed out. /// Returns whether the wait was known to have timed out.
#[unstable(feature = "wait_timeout", reason = "newly added", issue = "27772")] #[stable(feature = "wait_timeout", since = "1.5.0")]
pub fn timed_out(&self) -> bool { pub fn timed_out(&self) -> bool {
self.0 self.0
} }
@ -189,8 +189,7 @@ impl Condvar {
/// ///
/// Like `wait`, the lock specified will be re-acquired when this function /// Like `wait`, the lock specified will be re-acquired when this function
/// returns, regardless of whether the timeout elapsed or not. /// returns, regardless of whether the timeout elapsed or not.
#[unstable(feature = "wait_timeout", reason = "waiting for Duration", #[stable(feature = "wait_timeout", since = "1.5.0")]
issue = "27772")]
pub fn wait_timeout<'a, T>(&self, guard: MutexGuard<'a, T>, pub fn wait_timeout<'a, T>(&self, guard: MutexGuard<'a, T>,
dur: Duration) dur: Duration)
-> LockResult<(MutexGuard<'a, T>, WaitTimeoutResult)> { -> LockResult<(MutexGuard<'a, T>, WaitTimeoutResult)> {

View file

@ -81,12 +81,12 @@ use sys_common::mutex::Mutex;
#[path = "seh.rs"] #[doc(hidden)] #[path = "seh.rs"] #[doc(hidden)]
pub mod imp; pub mod imp;
// SNAP: i686-pc-windows-gnu // stage0: i686-pc-windows-gnu
#[cfg(all(stage0, windows, target_arch = "x86_64", target_env = "gnu"))] #[cfg(all(stage0, windows, target_arch = "x86_64", target_env = "gnu"))]
#[path = "seh64_gnu.rs"] #[doc(hidden)] #[path = "seh64_gnu.rs"] #[doc(hidden)]
pub mod imp; pub mod imp;
// SNAP: x86_64-pc-windows-msvc // stage0: x86_64-pc-windows-msvc
#[cfg(all(stage0, windows, target_arch = "x86_64", target_env = "msvc"))] #[cfg(all(stage0, windows, target_arch = "x86_64", target_env = "msvc"))]
#[path = "seh.rs"] #[doc(hidden)] #[path = "seh.rs"] #[doc(hidden)]
pub mod imp; pub mod imp;

View file

@ -178,21 +178,23 @@ impl MetadataExt for fs::Metadata {
} }
/// Add special unix types (block/char device, fifo and socket) /// Add special unix types (block/char device, fifo and socket)
#[unstable(feature = "file_type_ext", reason = "recently added API", #[stable(feature = "file_type_ext", since = "1.5.0")]
issue = "27796")]
pub trait FileTypeExt { pub trait FileTypeExt {
/// Returns whether this file type is a block device. /// Returns whether this file type is a block device.
#[stable(feature = "file_type_ext", since = "1.5.0")]
fn is_block_device(&self) -> bool; fn is_block_device(&self) -> bool;
/// Returns whether this file type is a char device. /// Returns whether this file type is a char device.
#[stable(feature = "file_type_ext", since = "1.5.0")]
fn is_char_device(&self) -> bool; fn is_char_device(&self) -> bool;
/// Returns whether this file type is a fifo. /// Returns whether this file type is a fifo.
#[stable(feature = "file_type_ext", since = "1.5.0")]
fn is_fifo(&self) -> bool; fn is_fifo(&self) -> bool;
/// Returns whether this file type is a socket. /// Returns whether this file type is a socket.
#[stable(feature = "file_type_ext", since = "1.5.0")]
fn is_socket(&self) -> bool; fn is_socket(&self) -> bool;
} }
#[unstable(feature = "file_type_ext", reason = "recently added API", #[stable(feature = "file_type_ext", since = "1.5.0")]
issue = "27796")]
impl FileTypeExt for fs::FileType { impl FileTypeExt for fs::FileType {
fn is_block_device(&self) -> bool { self.as_inner().is(libc::S_IFBLK) } fn is_block_device(&self) -> bool { self.as_inner().is(libc::S_IFBLK) }
fn is_char_device(&self) -> bool { self.as_inner().is(libc::S_IFCHR) } fn is_char_device(&self) -> bool { self.as_inner().is(libc::S_IFCHR) }

View file

@ -543,7 +543,7 @@ pub fn canonicalize(p: &Path) -> io::Result<PathBuf> {
} }
pub fn copy(from: &Path, to: &Path) -> io::Result<u64> { pub fn copy(from: &Path, to: &Path) -> io::Result<u64> {
use fs::{File, PathExt, set_permissions}; use fs::{File, set_permissions};
if !from.is_file() { if !from.is_file() {
return Err(Error::new(ErrorKind::InvalidInput, return Err(Error::new(ErrorKind::InvalidInput,
"the source path is not an existing regular file")) "the source path is not an existing regular file"))

View file

@ -356,6 +356,7 @@ pub mod guard {
// but that caused Debian to detect an unnecessarily strict versioned // but that caused Debian to detect an unnecessarily strict versioned
// dependency on libc6 (#23628). // dependency on libc6 (#23628).
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
#[allow(deprecated)]
fn min_stack_size(attr: *const libc::pthread_attr_t) -> usize { fn min_stack_size(attr: *const libc::pthread_attr_t) -> usize {
use dynamic_lib::DynamicLibrary; use dynamic_lib::DynamicLibrary;
use sync::Once; use sync::Once;

View file

@ -22,7 +22,7 @@
//! copy of that function in my mingw install (maybe it was broken?). Instead, //! copy of that function in my mingw install (maybe it was broken?). Instead,
//! this takes the route of using StackWalk64 in order to walk the stack. //! this takes the route of using StackWalk64 in order to walk the stack.
#![allow(dead_code)] #![allow(dead_code, deprecated)]
use io::prelude::*; use io::prelude::*;

View file

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#![allow(deprecated)]
use dynamic_lib::DynamicLibrary; use dynamic_lib::DynamicLibrary;
use io; use io;
use io::prelude::*; use io::prelude::*;

View file

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#![allow(deprecated)]
use sys_common::backtrace::{output, output_fileline}; use sys_common::backtrace::{output, output_fileline};
use ffi::CStr; use ffi::CStr;
use dynamic_lib::DynamicLibrary; use dynamic_lib::DynamicLibrary;

View file

@ -29,7 +29,6 @@
#![feature(drain)] #![feature(drain)]
#![feature(filling_drop)] #![feature(filling_drop)]
#![feature(libc)] #![feature(libc)]
#![feature(ref_slice)]
#![feature(rustc_private)] #![feature(rustc_private)]
#![feature(set_stdio)] #![feature(set_stdio)]
#![feature(staged_api)] #![feature(staged_api)]
@ -37,7 +36,6 @@
#![feature(str_escape)] #![feature(str_escape)]
#![feature(unicode)] #![feature(unicode)]
#![feature(vec_push_all)] #![feature(vec_push_all)]
#![feature(vec_resize)]
extern crate fmt_macros; extern crate fmt_macros;
extern crate serialize; extern crate serialize;

View file

@ -422,7 +422,7 @@ impl<'a> Parser<'a> {
this_token_str))) this_token_str)))
} }
} else { } else {
self.expect_one_of(slice::ref_slice(t), &[]) self.expect_one_of(unsafe { slice::from_raw_parts(t, 1) }, &[])
} }
} }

View file

@ -65,7 +65,6 @@ impl<T> SmallVector<T> {
result result
} }
One(ref v) => { One(ref v) => {
// FIXME: Could be replaced with `slice::ref_slice(v)` when it is stable.
unsafe { slice::from_raw_parts(v, 1) } unsafe { slice::from_raw_parts(v, 1) }
} }
Many(ref vs) => vs Many(ref vs) => vs

View file

@ -57,7 +57,6 @@
#![deny(missing_docs)] #![deny(missing_docs)]
#![feature(box_syntax)] #![feature(box_syntax)]
#![feature(path_ext)]
#![feature(rustc_private)] #![feature(rustc_private)]
#![feature(staged_api)] #![feature(staged_api)]
#![feature(str_char)] #![feature(str_char)]

View file

@ -13,12 +13,12 @@
// ignore-cross-compile // ignore-cross-compile
#![feature(rustc_private, path_ext)] #![feature(rustc_private)]
extern crate rustc_back; extern crate rustc_back;
use std::ffi::CString; use std::ffi::CString;
use std::fs::{self, File, PathExt}; use std::fs::{self, File};
use rustc_back::tempdir::TempDir; use rustc_back::tempdir::TempDir;
fn rename_directory() { fn rename_directory() {