Test fixes and rebase conflicts, round 2

This commit is contained in:
Alex Crichton 2015-03-31 11:41:18 -07:00
parent 554946c81e
commit 30532884f8
15 changed files with 80 additions and 91 deletions

View File

@ -213,7 +213,7 @@ impl<'a, B: ?Sized> Cow<'a, B> where B: ToOwned {
/// ///
/// let hello = cow.to_mut(); /// let hello = cow.to_mut();
/// ///
/// assert_eq!(&[1, 2, 3], hello); /// assert_eq!(hello, &[1, 2, 3]);
/// ``` /// ```
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
pub fn to_mut(&mut self) -> &mut <B as ToOwned>::Owned { pub fn to_mut(&mut self) -> &mut <B as ToOwned>::Owned {

View File

@ -95,13 +95,6 @@ impl<'a, T: ?Sized, U: ?Sized> AsMut<U> for &'a mut T where T: AsMut<U> {
// } // }
// } // }
// From itself is always itself
impl<T> From<T> for T {
fn from(t: T) -> T {
t
}
}
// From implies Into // From implies Into
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl<T, U> Into<U> for T where U: From<T> { impl<T, U> Into<U> for T where U: From<T> {

View File

@ -12,25 +12,26 @@
//! //!
//! # The `Iterator` trait //! # The `Iterator` trait
//! //!
//! This module defines Rust's core iteration trait. The `Iterator` trait has one //! This module defines Rust's core iteration trait. The `Iterator` trait has
//! unimplemented method, `next`. All other methods are derived through default //! one unimplemented method, `next`. All other methods are derived through
//! methods to perform operations such as `zip`, `chain`, `enumerate`, and `fold`. //! default methods to perform operations such as `zip`, `chain`, `enumerate`,
//! and `fold`.
//! //!
//! The goal of this module is to unify iteration across all containers in Rust. //! The goal of this module is to unify iteration across all containers in Rust.
//! An iterator can be considered as a state machine which is used to track which //! An iterator can be considered as a state machine which is used to track
//! element will be yielded next. //! which element will be yielded next.
//! //!
//! There are various extensions also defined in this module to assist with various //! There are various extensions also defined in this module to assist with
//! types of iteration, such as the `DoubleEndedIterator` for iterating in reverse, //! various types of iteration, such as the `DoubleEndedIterator` for iterating
//! the `FromIterator` trait for creating a container from an iterator, and much //! in reverse, the `FromIterator` trait for creating a container from an
//! more. //! iterator, and much more.
//! //!
//! ## Rust's `for` loop //! ## Rust's `for` loop
//! //!
//! The special syntax used by rust's `for` loop is based around the `Iterator` //! The special syntax used by rust's `for` loop is based around the `Iterator`
//! trait defined in this module. For loops can be viewed as a syntactical expansion //! trait defined in this module. For loops can be viewed as a syntactical
//! into a `loop`, for example, the `for` loop in this example is essentially //! expansion into a `loop`, for example, the `for` loop in this example is
//! translated to the `loop` below. //! essentially translated to the `loop` below.
//! //!
//! ``` //! ```
//! let values = vec![1, 2, 3]; //! let values = vec![1, 2, 3];
@ -64,8 +65,8 @@ use cmp::Ord;
use default::Default; use default::Default;
use marker; use marker;
use mem; use mem;
use num::{Int, Zero, One, ToPrimitive}; use num::{Int, Zero, One};
use ops::{Add, Sub, FnMut, RangeFrom}; use ops::{self, Add, Sub, FnMut, RangeFrom};
use option::Option::{self, Some, None}; use option::Option::{self, Some, None};
use marker::Sized; use marker::Sized;
use usize; use usize;
@ -84,21 +85,22 @@ fn _assert_is_object_safe(_: &Iterator) {}
/// else. /// else.
#[lang="iterator"] #[lang="iterator"]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_on_unimplemented = "`{Self}` is not an iterator; maybe try calling `.iter()` or a similar \ #[rustc_on_unimplemented = "`{Self}` is not an iterator; maybe try calling \
method"] `.iter()` or a similar method"]
pub trait Iterator { pub trait Iterator {
/// The type of the elements being iterated /// The type of the elements being iterated
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
type Item; type Item;
/// Advance the iterator and return the next value. Return `None` when the end is reached. /// Advance the iterator and return the next value. Return `None` when the
/// end is reached.
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
fn next(&mut self) -> Option<Self::Item>; fn next(&mut self) -> Option<Self::Item>;
/// Returns a lower and upper bound on the remaining length of the iterator. /// Returns a lower and upper bound on the remaining length of the iterator.
/// ///
/// An upper bound of `None` means either there is no known upper bound, or the upper bound /// An upper bound of `None` means either there is no known upper bound, or
/// does not fit within a `usize`. /// the upper bound does not fit within a `usize`.
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
fn size_hint(&self) -> (usize, Option<usize>) { (0, None) } fn size_hint(&self) -> (usize, Option<usize>) { (0, None) }
@ -274,7 +276,8 @@ pub trait Iterator {
/// iterator plus the current index of iteration. /// iterator plus the current index of iteration.
/// ///
/// `enumerate` keeps its count as a `usize`. If you want to count by a /// `enumerate` keeps its count as a `usize`. If you want to count by a
/// different sized integer, the `zip` function provides similar functionality. /// different sized integer, the `zip` function provides similar
/// functionality.
/// ///
/// # Examples /// # Examples
/// ///
@ -612,7 +615,8 @@ pub trait Iterator {
true true
} }
/// Tests whether any element of an iterator satisfies the specified predicate. /// Tests whether any element of an iterator satisfies the specified
/// predicate.
/// ///
/// Does not consume the iterator past the first found element. /// Does not consume the iterator past the first found element.
/// ///
@ -776,7 +780,8 @@ pub trait Iterator {
/// element in the iterator and all elements are equal. /// element in the iterator and all elements are equal.
/// ///
/// On an iterator of length `n`, `min_max` does `1.5 * n` comparisons, /// On an iterator of length `n`, `min_max` does `1.5 * n` comparisons,
/// and so is faster than calling `min` and `max` separately which does `2 * n` comparisons. /// and so is faster than calling `min` and `max` separately which does `2 *
/// n` comparisons.
/// ///
/// # Examples /// # Examples
/// ///
@ -810,10 +815,11 @@ pub trait Iterator {
}; };
loop { loop {
// `first` and `second` are the two next elements we want to look at. // `first` and `second` are the two next elements we want to look
// We first compare `first` and `second` (#1). The smaller one is then compared to // at. We first compare `first` and `second` (#1). The smaller one
// current minimum (#2). The larger one is compared to current maximum (#3). This // is then compared to current minimum (#2). The larger one is
// way we do 3 comparisons for 2 elements. // compared to current maximum (#3). This way we do 3 comparisons
// for 2 elements.
let first = match self.next() { let first = match self.next() {
None => break, None => break,
Some(x) => x Some(x) => x
@ -1038,7 +1044,8 @@ pub trait FromIterator<A> {
/// assert_eq!(colors_set.len(), 3); /// assert_eq!(colors_set.len(), 3);
/// ``` /// ```
/// ///
/// `FromIterator` is more commonly used implicitly via the `Iterator::collect` method: /// `FromIterator` is more commonly used implicitly via the
/// `Iterator::collect` method:
/// ///
/// ``` /// ```
/// use std::collections::HashSet; /// use std::collections::HashSet;
@ -1105,12 +1112,13 @@ impl<'a, I: DoubleEndedIterator + ?Sized> DoubleEndedIterator for &'a mut I {
/// An object implementing random access indexing by `usize` /// An object implementing random access indexing by `usize`
/// ///
/// A `RandomAccessIterator` should be either infinite or a `DoubleEndedIterator`. /// A `RandomAccessIterator` should be either infinite or a
/// Calling `next()` or `next_back()` on a `RandomAccessIterator` /// `DoubleEndedIterator`. Calling `next()` or `next_back()` on a
/// reduces the indexable range accordingly. That is, `it.idx(1)` will become `it.idx(0)` /// `RandomAccessIterator` reduces the indexable range accordingly. That is,
/// after `it.next()` is called. /// `it.idx(1)` will become `it.idx(0)` after `it.next()` is called.
#[unstable(feature = "core", #[unstable(feature = "core",
reason = "not widely used, may be better decomposed into Index and ExactSizeIterator")] reason = "not widely used, may be better decomposed into Index \
and ExactSizeIterator")]
pub trait RandomAccessIterator: Iterator { pub trait RandomAccessIterator: Iterator {
/// Return the number of indexable elements. At most `std::usize::MAX` /// Return the number of indexable elements. At most `std::usize::MAX`
/// elements are indexable, even if the iterator represents a longer range. /// elements are indexable, even if the iterator represents a longer range.
@ -1155,13 +1163,15 @@ impl<I: ExactSizeIterator, F> ExactSizeIterator for Inspect<I, F> where
F: FnMut(&I::Item), F: FnMut(&I::Item),
{} {}
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl<I> ExactSizeIterator for Rev<I> where I: ExactSizeIterator + DoubleEndedIterator {} impl<I> ExactSizeIterator for Rev<I>
where I: ExactSizeIterator + DoubleEndedIterator {}
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl<B, I: ExactSizeIterator, F> ExactSizeIterator for Map<I, F> where impl<B, I: ExactSizeIterator, F> ExactSizeIterator for Map<I, F> where
F: FnMut(I::Item) -> B, F: FnMut(I::Item) -> B,
{} {}
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl<A, B> ExactSizeIterator for Zip<A, B> where A: ExactSizeIterator, B: ExactSizeIterator {} impl<A, B> ExactSizeIterator for Zip<A, B>
where A: ExactSizeIterator, B: ExactSizeIterator {}
/// An double-ended iterator with the direction inverted /// An double-ended iterator with the direction inverted
#[derive(Clone)] #[derive(Clone)]
@ -1188,7 +1198,9 @@ impl<I> DoubleEndedIterator for Rev<I> where I: DoubleEndedIterator {
} }
#[unstable(feature = "core", reason = "trait is experimental")] #[unstable(feature = "core", reason = "trait is experimental")]
impl<I> RandomAccessIterator for Rev<I> where I: DoubleEndedIterator + RandomAccessIterator { impl<I> RandomAccessIterator for Rev<I>
where I: DoubleEndedIterator + RandomAccessIterator
{
#[inline] #[inline]
fn indexable(&self) -> usize { self.iter.indexable() } fn indexable(&self) -> usize { self.iter.indexable() }
#[inline] #[inline]
@ -1291,7 +1303,8 @@ impl_multiplicative! { usize, 1 }
impl_multiplicative! { f32, 1.0 } impl_multiplicative! { f32, 1.0 }
impl_multiplicative! { f64, 1.0 } impl_multiplicative! { f64, 1.0 }
/// `MinMaxResult` is an enum returned by `min_max`. See `Iterator::min_max` for more detail. /// `MinMaxResult` is an enum returned by `min_max`. See `Iterator::min_max` for
/// more detail.
#[derive(Clone, PartialEq, Debug)] #[derive(Clone, PartialEq, Debug)]
#[unstable(feature = "core", #[unstable(feature = "core",
reason = "unclear whether such a fine-grained result is widely useful")] reason = "unclear whether such a fine-grained result is widely useful")]
@ -1302,15 +1315,17 @@ pub enum MinMaxResult<T> {
/// Iterator with one element, so the minimum and maximum are the same /// Iterator with one element, so the minimum and maximum are the same
OneElement(T), OneElement(T),
/// More than one element in the iterator, the first element is not larger than the second /// More than one element in the iterator, the first element is not larger
/// than the second
MinMax(T, T) MinMax(T, T)
} }
impl<T: Clone> MinMaxResult<T> { impl<T: Clone> MinMaxResult<T> {
/// `into_option` creates an `Option` of type `(T,T)`. The returned `Option` has variant /// `into_option` creates an `Option` of type `(T,T)`. The returned `Option`
/// `None` if and only if the `MinMaxResult` has variant `NoElements`. Otherwise variant /// has variant `None` if and only if the `MinMaxResult` has variant
/// `Some(x,y)` is returned where `x <= y`. If `MinMaxResult` has variant `OneElement(x)`, /// `NoElements`. Otherwise variant `Some(x,y)` is returned where `x <= y`.
/// performing this operation will make one clone of `x`. /// If `MinMaxResult` has variant `OneElement(x)`, performing this operation
/// will make one clone of `x`.
/// ///
/// # Examples /// # Examples
/// ///
@ -2522,7 +2537,7 @@ impl<A: Step> RangeFrom<A> {
} }
#[allow(deprecated)] #[allow(deprecated)]
impl<A: Step> ::ops::Range<A> { impl<A: Step> ops::Range<A> {
/// Creates an iterator with the same range, but stepping by the /// Creates an iterator with the same range, but stepping by the
/// given amount at each iteration. /// given amount at each iteration.
/// ///
@ -2588,7 +2603,9 @@ pub struct RangeInclusive<A> {
#[inline] #[inline]
#[unstable(feature = "core", #[unstable(feature = "core",
reason = "likely to be replaced by range notation and adapters")] reason = "likely to be replaced by range notation and adapters")]
pub fn range_inclusive<A: Int>(start: A, stop: A) -> RangeInclusive<A> { pub fn range_inclusive<A>(start: A, stop: A) -> RangeInclusive<A>
where A: Step + One + Clone
{
RangeInclusive { RangeInclusive {
range: start..stop, range: start..stop,
done: false, done: false,
@ -2597,7 +2614,7 @@ pub fn range_inclusive<A: Int>(start: A, stop: A) -> RangeInclusive<A> {
#[unstable(feature = "core", #[unstable(feature = "core",
reason = "likely to be replaced by range notation and adapters")] reason = "likely to be replaced by range notation and adapters")]
impl<A: Int + ToPrimitive> Iterator for RangeInclusive<A> { impl<A: Step + One + Clone> Iterator for RangeInclusive<A> {
type Item = A; type Item = A;
#[inline] #[inline]
@ -2633,12 +2650,15 @@ impl<A: Int + ToPrimitive> Iterator for RangeInclusive<A> {
#[unstable(feature = "core", #[unstable(feature = "core",
reason = "likely to be replaced by range notation and adapters")] reason = "likely to be replaced by range notation and adapters")]
impl<A: Int + ToPrimitive> DoubleEndedIterator for RangeInclusive<A> { impl<A> DoubleEndedIterator for RangeInclusive<A>
where A: Step + One + Clone,
for<'a> &'a A: Sub<Output=A>
{
#[inline] #[inline]
fn next_back(&mut self) -> Option<A> { fn next_back(&mut self) -> Option<A> {
if self.range.end > self.range.start { if self.range.end > self.range.start {
let result = self.range.end.clone(); let result = self.range.end.clone();
self.range.end = self.range.end - A::one(); self.range.end = &self.range.end - &A::one();
Some(result) Some(result)
} else if !self.done && self.range.start == self.range.end { } else if !self.done && self.range.start == self.range.end {
self.done = true; self.done = true;
@ -2651,7 +2671,7 @@ impl<A: Int + ToPrimitive> DoubleEndedIterator for RangeInclusive<A> {
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[allow(deprecated)] #[allow(deprecated)]
impl<A: Step + Zero + Clone> Iterator for StepBy<A, ::ops::Range<A>> { impl<A: Step + Zero + Clone> Iterator for StepBy<A, ops::Range<A>> {
type Item = A; type Item = A;
#[inline] #[inline]
@ -2754,13 +2774,13 @@ impl<A: Int> Iterator for RangeStepInclusive<A> {
macro_rules! range_exact_iter_impl { macro_rules! range_exact_iter_impl {
($($t:ty)*) => ($( ($($t:ty)*) => ($(
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl ExactSizeIterator for ::ops::Range<$t> { } impl ExactSizeIterator for ops::Range<$t> { }
)*) )*)
} }
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[allow(deprecated)] #[allow(deprecated)]
impl<A: Step + One + Clone> Iterator for ::ops::Range<A> { impl<A: Step + One + Clone> Iterator for ops::Range<A> {
type Item = A; type Item = A;
#[inline] #[inline]
@ -2799,7 +2819,7 @@ range_exact_iter_impl!(usize u8 u16 u32 isize i8 i16 i32);
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[allow(deprecated)] #[allow(deprecated)]
impl<A: Step + One + Clone> DoubleEndedIterator for ::ops::Range<A> where impl<A: Step + One + Clone> DoubleEndedIterator for ops::Range<A> where
for<'a> &'a A: Sub<&'a A, Output = A> for<'a> &'a A: Sub<&'a A, Output = A>
{ {
#[inline] #[inline]
@ -2815,7 +2835,7 @@ impl<A: Step + One + Clone> DoubleEndedIterator for ::ops::Range<A> where
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[allow(deprecated)] #[allow(deprecated)]
impl<A: Step + One> Iterator for ::ops::RangeFrom<A> { impl<A: Step + One> Iterator for ops::RangeFrom<A> {
type Item = A; type Item = A;
#[inline] #[inline]

View File

@ -46,7 +46,7 @@ use str::{FromStr, StrExt};
/// intended to have wrapping semantics. /// intended to have wrapping semantics.
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Debug)] #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Debug)]
pub struct Wrapping<T>(pub T); pub struct Wrapping<T>(#[stable(feature = "rust1", since = "1.0.0")] pub T);
#[unstable(feature = "core", reason = "may be removed or relocated")] #[unstable(feature = "core", reason = "may be removed or relocated")]
pub mod wrapping; pub mod wrapping;

View File

@ -37,7 +37,6 @@
#![feature(unsafe_destructor)] #![feature(unsafe_destructor)]
#![feature(staged_api)] #![feature(staged_api)]
#![feature(std_misc)] #![feature(std_misc)]
#![feature(io)]
#![feature(path_ext)] #![feature(path_ext)]
#![feature(str_words)] #![feature(str_words)]
#![feature(str_char)] #![feature(str_char)]

View File

@ -27,7 +27,6 @@
#![feature(box_syntax)] #![feature(box_syntax)]
#![feature(collections)] #![feature(collections)]
#![feature(core)]
#![feature(libc)] #![feature(libc)]
#![feature(quote)] #![feature(quote)]
#![feature(rustc_diagnostic_macros)] #![feature(rustc_diagnostic_macros)]

View File

@ -30,7 +30,6 @@
#![feature(libc)] #![feature(libc)]
#![feature(link_args)] #![feature(link_args)]
#![feature(staged_api)] #![feature(staged_api)]
#![cfg_attr(unix, feature(convert))]
extern crate libc; extern crate libc;
#[macro_use] #[no_link] extern crate rustc_bitflags; #[macro_use] #[no_link] extern crate rustc_bitflags;

View File

@ -195,8 +195,8 @@ mod imp {
impl Lock { impl Lock {
pub fn new(p: &Path) -> Lock { pub fn new(p: &Path) -> Lock {
let p: &OsStr = p.as_ref(); let os: &OsStr = p.as_ref();
let mut p_16: Vec<_> = p.encode_wide().collect(); let mut p_16: Vec<_> = os.encode_wide().collect();
p_16.push(0); p_16.push(0);
let handle = unsafe { let handle = unsafe {
libc::CreateFileW(p_16.as_ptr(), libc::CreateFileW(p_16.as_ptr(),

View File

@ -23,7 +23,6 @@
#![feature(box_patterns)] #![feature(box_patterns)]
#![feature(box_syntax)] #![feature(box_syntax)]
#![feature(collections)] #![feature(collections)]
#![feature(core)]
#![feature(exit_status)] #![feature(exit_status)]
#![feature(set_stdio)] #![feature(set_stdio)]
#![feature(libc)] #![feature(libc)]

View File

@ -10,7 +10,7 @@
#![unstable(feature = "std_misc")] #![unstable(feature = "std_misc")]
use convert::Into; use convert::{Into, From};
use cmp::{PartialEq, Eq, PartialOrd, Ord, Ordering}; use cmp::{PartialEq, Eq, PartialOrd, Ord, Ordering};
use error::Error; use error::Error;
use fmt; use fmt;

View File

@ -141,7 +141,7 @@ mod darwin_fd_limit {
// sysctl value, and bump the soft resource limit for maxfiles up to the sysctl value. // sysctl value, and bump the soft resource limit for maxfiles up to the sysctl value.
use ptr::null_mut; use ptr::null_mut;
use mem::size_of_val; use mem::size_of_val;
use os::last_os_error; use io;
// Fetch the kern.maxfilesperproc value // Fetch the kern.maxfilesperproc value
let mut mib: [libc::c_int; 2] = [CTL_KERN, KERN_MAXFILESPERPROC]; let mut mib: [libc::c_int; 2] = [CTL_KERN, KERN_MAXFILESPERPROC];
@ -149,14 +149,14 @@ mod darwin_fd_limit {
let mut size: libc::size_t = size_of_val(&maxfiles) as libc::size_t; let mut size: libc::size_t = size_of_val(&maxfiles) as libc::size_t;
if sysctl(&mut mib[0], 2, &mut maxfiles as *mut libc::c_int as *mut libc::c_void, &mut size, if sysctl(&mut mib[0], 2, &mut maxfiles as *mut libc::c_int as *mut libc::c_void, &mut size,
null_mut(), 0) != 0 { null_mut(), 0) != 0 {
let err = last_os_error(); let err = io::Error::last_os_error();
panic!("raise_fd_limit: error calling sysctl: {}", err); panic!("raise_fd_limit: error calling sysctl: {}", err);
} }
// Fetch the current resource limits // Fetch the current resource limits
let mut rlim = rlimit{rlim_cur: 0, rlim_max: 0}; let mut rlim = rlimit{rlim_cur: 0, rlim_max: 0};
if getrlimit(RLIMIT_NOFILE, &mut rlim) != 0 { if getrlimit(RLIMIT_NOFILE, &mut rlim) != 0 {
let err = last_os_error(); let err = io::Error::last_os_error();
panic!("raise_fd_limit: error calling getrlimit: {}", err); panic!("raise_fd_limit: error calling getrlimit: {}", err);
} }
@ -165,7 +165,7 @@ mod darwin_fd_limit {
// Set our newly-increased resource limit // Set our newly-increased resource limit
if setrlimit(RLIMIT_NOFILE, &rlim) != 0 { if setrlimit(RLIMIT_NOFILE, &rlim) != 0 {
let err = last_os_error(); let err = io::Error::last_os_error();
panic!("raise_fd_limit: error calling setrlimit: {}", err); panic!("raise_fd_limit: error calling setrlimit: {}", err);
} }
} }

View File

@ -254,7 +254,6 @@ mod imp {
use io; use io;
use mem; use mem;
use old_io::{IoResult, IoError}; use old_io::{IoResult, IoError};
use os;
use rand::Rng; use rand::Rng;
use libc::types::os::arch::extra::{LONG_PTR}; use libc::types::os::arch::extra::{LONG_PTR};
use libc::{DWORD, BYTE, LPCSTR, BOOL}; use libc::{DWORD, BYTE, LPCSTR, BOOL};

View File

@ -135,13 +135,6 @@ impl FileDesc {
_ => Err(super::last_error()), _ => Err(super::last_error()),
} }
} }
/// Extract the actual filedescriptor without closing it.
pub fn unwrap(self) -> fd_t {
let fd = self.fd;
unsafe { mem::forget(self) };
fd
}
} }
impl Drop for FileDesc { impl Drop for FileDesc {

View File

@ -24,7 +24,6 @@ use old_io::process::{ProcessExit, ExitStatus};
use old_io::{IoResult, IoError}; use old_io::{IoResult, IoError};
use old_io; use old_io;
use fs::PathExt; use fs::PathExt;
use os;
use old_path::{BytesContainer, GenericPath}; use old_path::{BytesContainer, GenericPath};
use ptr; use ptr;
use str; use str;

View File

@ -161,10 +161,6 @@ enum Status {
/// currently being considered for addition/removal. /// currently being considered for addition/removal.
Active, Active,
/// Represents a feature gate that is temporarily enabling deprecated behavior.
/// This gate will never be accepted.
Deprecated,
/// Represents a feature which has since been removed (it was once Active) /// Represents a feature which has since been removed (it was once Active)
Removed, Removed,
@ -699,13 +695,6 @@ fn check_crate_inner<F>(cm: &CodeMap, span_handler: &SpanHandler,
Some(&(name, _, Active)) => { Some(&(name, _, Active)) => {
cx.features.push(name); cx.features.push(name);
} }
Some(&(name, _, Deprecated)) => {
cx.features.push(name);
span_handler.span_warn(
mi.span,
"feature is deprecated and will only be available \
for a limited time, please rewrite code that relies on it");
}
Some(&(_, _, Removed)) => { Some(&(_, _, Removed)) => {
span_handler.span_err(mi.span, "feature has been removed"); span_handler.span_err(mi.span, "feature has been removed");
} }