Skip to content

Commit

Permalink
Correct some stability versions
Browse files Browse the repository at this point in the history
These were found by running tidy on stable versions of rust and finding
features stabilised with the wrong version numbers.
  • Loading branch information
ollie27 committed May 20, 2017
1 parent 9f15631 commit 2f703e4
Show file tree
Hide file tree
Showing 20 changed files with 98 additions and 98 deletions.
2 changes: 1 addition & 1 deletion src/liballoc/boxed.rs
Expand Up @@ -445,7 +445,7 @@ impl<'a> From<&'a str> for Box<str> {
}
}

#[stable(feature = "boxed_str_conv", since = "1.18.0")]
#[stable(feature = "boxed_str_conv", since = "1.19.0")]
impl From<Box<str>> for Box<[u8]> {
fn from(s: Box<str>) -> Self {
unsafe {
Expand Down
14 changes: 7 additions & 7 deletions src/libcollections/string.rs
Expand Up @@ -1869,28 +1869,28 @@ impl ops::Index<ops::RangeToInclusive<usize>> for String {
}
}

#[stable(feature = "derefmut_for_string", since = "1.2.0")]
#[stable(feature = "derefmut_for_string", since = "1.3.0")]
impl ops::IndexMut<ops::Range<usize>> for String {
#[inline]
fn index_mut(&mut self, index: ops::Range<usize>) -> &mut str {
&mut self[..][index]
}
}
#[stable(feature = "derefmut_for_string", since = "1.2.0")]
#[stable(feature = "derefmut_for_string", since = "1.3.0")]
impl ops::IndexMut<ops::RangeTo<usize>> for String {
#[inline]
fn index_mut(&mut self, index: ops::RangeTo<usize>) -> &mut str {
&mut self[..][index]
}
}
#[stable(feature = "derefmut_for_string", since = "1.2.0")]
#[stable(feature = "derefmut_for_string", since = "1.3.0")]
impl ops::IndexMut<ops::RangeFrom<usize>> for String {
#[inline]
fn index_mut(&mut self, index: ops::RangeFrom<usize>) -> &mut str {
&mut self[..][index]
}
}
#[stable(feature = "derefmut_for_string", since = "1.2.0")]
#[stable(feature = "derefmut_for_string", since = "1.3.0")]
impl ops::IndexMut<ops::RangeFull> for String {
#[inline]
fn index_mut(&mut self, _index: ops::RangeFull) -> &mut str {
Expand Down Expand Up @@ -1922,7 +1922,7 @@ impl ops::Deref for String {
}
}

#[stable(feature = "derefmut_for_string", since = "1.2.0")]
#[stable(feature = "derefmut_for_string", since = "1.3.0")]
impl ops::DerefMut for String {
#[inline]
fn deref_mut(&mut self) -> &mut str {
Expand Down Expand Up @@ -2080,14 +2080,14 @@ impl<'a> From<&'a str> for String {

// note: test pulls in libstd, which causes errors here
#[cfg(not(test))]
#[stable(feature = "string_from_box", since = "1.17.0")]
#[stable(feature = "string_from_box", since = "1.18.0")]
impl From<Box<str>> for String {
fn from(s: Box<str>) -> String {
s.into_string()
}
}

#[stable(feature = "box_from_str", since = "1.17.0")]
#[stable(feature = "box_from_str", since = "1.18.0")]
impl Into<Box<str>> for String {
fn into(self) -> Box<str> {
self.into_boxed_str()
Expand Down
10 changes: 5 additions & 5 deletions src/libcollections/vec.rs
Expand Up @@ -2034,7 +2034,7 @@ impl<'a, T: Clone> From<&'a [T]> for Vec<T> {
}
}

#[stable(feature = "vec_from_mut", since = "1.21.0")]
#[stable(feature = "vec_from_mut", since = "1.19.0")]
impl<'a, T: Clone> From<&'a mut [T]> for Vec<T> {
#[cfg(not(test))]
fn from(s: &'a mut [T]) -> Vec<T> {
Expand All @@ -2055,14 +2055,14 @@ impl<'a, T> From<Cow<'a, [T]>> for Vec<T> where [T]: ToOwned<Owned=Vec<T>> {

// note: test pulls in libstd, which causes errors here
#[cfg(not(test))]
#[stable(feature = "vec_from_box", since = "1.17.0")]
#[stable(feature = "vec_from_box", since = "1.18.0")]
impl<T> From<Box<[T]>> for Vec<T> {
fn from(s: Box<[T]>) -> Vec<T> {
s.into_vec()
}
}

#[stable(feature = "box_from_vec", since = "1.17.0")]
#[stable(feature = "box_from_vec", since = "1.18.0")]
impl<T> Into<Box<[T]>> for Vec<T> {
fn into(self) -> Box<[T]> {
self.into_boxed_slice()
Expand All @@ -2080,14 +2080,14 @@ impl<'a> From<&'a str> for Vec<u8> {
// Clone-on-write
////////////////////////////////////////////////////////////////////////////////

#[stable(feature = "cow_from_vec", since = "1.7.0")]
#[stable(feature = "cow_from_vec", since = "1.8.0")]
impl<'a, T: Clone> From<&'a [T]> for Cow<'a, [T]> {
fn from(s: &'a [T]) -> Cow<'a, [T]> {
Cow::Borrowed(s)
}
}

#[stable(feature = "cow_from_vec", since = "1.7.0")]
#[stable(feature = "cow_from_vec", since = "1.8.0")]
impl<'a, T: Clone> From<Vec<T>> for Cow<'a, [T]> {
fn from(v: Vec<T>) -> Cow<'a, [T]> {
Cow::Owned(v)
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/cell.rs
Expand Up @@ -1145,7 +1145,7 @@ impl<T: ?Sized> UnsafeCell<T> {
}
}

#[stable(feature = "unsafe_cell_default", since = "1.9.0")]
#[stable(feature = "unsafe_cell_default", since = "1.10.0")]
impl<T: Default> Default for UnsafeCell<T> {
/// Creates an `UnsafeCell`, with the `Default` value for T.
fn default() -> UnsafeCell<T> {
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/iter/mod.rs
Expand Up @@ -1655,7 +1655,7 @@ impl<I> Iterator for Skip<I> where I: Iterator {
#[stable(feature = "rust1", since = "1.0.0")]
impl<I> ExactSizeIterator for Skip<I> where I: ExactSizeIterator {}

#[stable(feature = "double_ended_skip_iterator", since = "1.8.0")]
#[stable(feature = "double_ended_skip_iterator", since = "1.9.0")]
impl<I> DoubleEndedIterator for Skip<I> where I: DoubleEndedIterator + ExactSizeIterator {
fn next_back(&mut self) -> Option<Self::Item> {
if self.len() > 0 {
Expand Down
90 changes: 45 additions & 45 deletions src/libcore/num/mod.rs
Expand Up @@ -2682,8 +2682,8 @@ pub use num::dec2flt::ParseFloatError;
// Conversions T -> T are covered by a blanket impl and therefore excluded
// Some conversions from and to usize/isize are not implemented due to portability concerns
macro_rules! impl_from {
($Small: ty, $Large: ty) => {
#[stable(feature = "lossless_prim_conv", since = "1.5.0")]
($Small: ty, $Large: ty, #[$attr:meta]) => {
#[$attr]
impl From<$Small> for $Large {
#[inline]
fn from(small: $Small) -> $Large {
Expand All @@ -2694,60 +2694,60 @@ macro_rules! impl_from {
}

// Unsigned -> Unsigned
impl_from! { u8, u16 }
impl_from! { u8, u32 }
impl_from! { u8, u64 }
impl_from! { u8, u128 }
impl_from! { u8, usize }
impl_from! { u16, u32 }
impl_from! { u16, u64 }
impl_from! { u16, u128 }
impl_from! { u32, u64 }
impl_from! { u32, u128 }
impl_from! { u64, u128 }
impl_from! { u8, u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
impl_from! { u8, u32, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
impl_from! { u8, u64, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
impl_from! { u8, u128, #[unstable(feature = "i128", issue = "35118")] }
impl_from! { u8, usize, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
impl_from! { u16, u32, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
impl_from! { u16, u64, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
impl_from! { u16, u128, #[unstable(feature = "i128", issue = "35118")] }
impl_from! { u32, u64, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
impl_from! { u32, u128, #[unstable(feature = "i128", issue = "35118")] }
impl_from! { u64, u128, #[unstable(feature = "i128", issue = "35118")] }

// Signed -> Signed
impl_from! { i8, i16 }
impl_from! { i8, i32 }
impl_from! { i8, i64 }
impl_from! { i8, i128 }
impl_from! { i8, isize }
impl_from! { i16, i32 }
impl_from! { i16, i64 }
impl_from! { i16, i128 }
impl_from! { i32, i64 }
impl_from! { i32, i128 }
impl_from! { i64, i128 }
impl_from! { i8, i16, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
impl_from! { i8, i32, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
impl_from! { i8, i64, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
impl_from! { i8, i128, #[unstable(feature = "i128", issue = "35118")] }
impl_from! { i8, isize, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
impl_from! { i16, i32, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
impl_from! { i16, i64, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
impl_from! { i16, i128, #[unstable(feature = "i128", issue = "35118")] }
impl_from! { i32, i64, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
impl_from! { i32, i128, #[unstable(feature = "i128", issue = "35118")] }
impl_from! { i64, i128, #[unstable(feature = "i128", issue = "35118")] }

// Unsigned -> Signed
impl_from! { u8, i16 }
impl_from! { u8, i32 }
impl_from! { u8, i64 }
impl_from! { u8, i128 }
impl_from! { u16, i32 }
impl_from! { u16, i64 }
impl_from! { u16, i128 }
impl_from! { u32, i64 }
impl_from! { u32, i128 }
impl_from! { u64, i128 }
impl_from! { u8, i16, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
impl_from! { u8, i32, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
impl_from! { u8, i64, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
impl_from! { u8, i128, #[unstable(feature = "i128", issue = "35118")] }
impl_from! { u16, i32, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
impl_from! { u16, i64, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
impl_from! { u16, i128, #[unstable(feature = "i128", issue = "35118")] }
impl_from! { u32, i64, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
impl_from! { u32, i128, #[unstable(feature = "i128", issue = "35118")] }
impl_from! { u64, i128, #[unstable(feature = "i128", issue = "35118")] }

// Note: integers can only be represented with full precision in a float if
// they fit in the significand, which is 24 bits in f32 and 53 bits in f64.
// Lossy float conversions are not implemented at this time.

// Signed -> Float
impl_from! { i8, f32 }
impl_from! { i8, f64 }
impl_from! { i16, f32 }
impl_from! { i16, f64 }
impl_from! { i32, f64 }
impl_from! { i8, f32, #[stable(feature = "lossless_float_conv", since = "1.6.0")] }
impl_from! { i8, f64, #[stable(feature = "lossless_float_conv", since = "1.6.0")] }
impl_from! { i16, f32, #[stable(feature = "lossless_float_conv", since = "1.6.0")] }
impl_from! { i16, f64, #[stable(feature = "lossless_float_conv", since = "1.6.0")] }
impl_from! { i32, f64, #[stable(feature = "lossless_float_conv", since = "1.6.0")] }

// Unsigned -> Float
impl_from! { u8, f32 }
impl_from! { u8, f64 }
impl_from! { u16, f32 }
impl_from! { u16, f64 }
impl_from! { u32, f64 }
impl_from! { u8, f32, #[stable(feature = "lossless_float_conv", since = "1.6.0")] }
impl_from! { u8, f64, #[stable(feature = "lossless_float_conv", since = "1.6.0")] }
impl_from! { u16, f32, #[stable(feature = "lossless_float_conv", since = "1.6.0")] }
impl_from! { u16, f64, #[stable(feature = "lossless_float_conv", since = "1.6.0")] }
impl_from! { u32, f64, #[stable(feature = "lossless_float_conv", since = "1.6.0")] }

// Float -> Float
impl_from! { f32, f64 }
impl_from! { f32, f64, #[stable(feature = "lossless_float_conv", since = "1.6.0")] }
2 changes: 1 addition & 1 deletion src/libcore/slice/mod.rs
Expand Up @@ -1450,7 +1450,7 @@ impl<'a, T> Clone for Iter<'a, T> {
fn clone(&self) -> Iter<'a, T> { Iter { ptr: self.ptr, end: self.end, _marker: self._marker } }
}

#[stable(feature = "slice_iter_as_ref", since = "1.12.0")]
#[stable(feature = "slice_iter_as_ref", since = "1.13.0")]
impl<'a, T> AsRef<[T]> for Iter<'a, T> {
fn as_ref(&self) -> &[T] {
self.as_slice()
Expand Down
8 changes: 4 additions & 4 deletions src/libcore/str/mod.rs
Expand Up @@ -1597,7 +1597,7 @@ mod traits {
/// byte offset of a character (as defined by `is_char_boundary`).
/// Requires that `begin <= end` and `end <= len` where `len` is the
/// length of the string.
#[stable(feature = "derefmut_for_string", since = "1.2.0")]
#[stable(feature = "derefmut_for_string", since = "1.3.0")]
impl ops::IndexMut<ops::Range<usize>> for str {
#[inline]
fn index_mut(&mut self, index: ops::Range<usize>) -> &mut str {
Expand Down Expand Up @@ -1632,7 +1632,7 @@ mod traits {
/// `end`.
///
/// Equivalent to `&mut self[0 .. end]`.
#[stable(feature = "derefmut_for_string", since = "1.2.0")]
#[stable(feature = "derefmut_for_string", since = "1.3.0")]
impl ops::IndexMut<ops::RangeTo<usize>> for str {
#[inline]
fn index_mut(&mut self, index: ops::RangeTo<usize>) -> &mut str {
Expand Down Expand Up @@ -1672,7 +1672,7 @@ mod traits {
/// to the end of the string.
///
/// Equivalent to `&mut self[begin .. len]`.
#[stable(feature = "derefmut_for_string", since = "1.2.0")]
#[stable(feature = "derefmut_for_string", since = "1.3.0")]
impl ops::IndexMut<ops::RangeFrom<usize>> for str {
#[inline]
fn index_mut(&mut self, index: ops::RangeFrom<usize>) -> &mut str {
Expand Down Expand Up @@ -1708,7 +1708,7 @@ mod traits {
/// never panic.
///
/// Equivalent to `&mut self[0 .. len]`.
#[stable(feature = "derefmut_for_string", since = "1.2.0")]
#[stable(feature = "derefmut_for_string", since = "1.3.0")]
impl ops::IndexMut<ops::RangeFull> for str {
#[inline]
fn index_mut(&mut self, _index: ops::RangeFull) -> &mut str {
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/env.rs
Expand Up @@ -680,7 +680,7 @@ impl ExactSizeIterator for Args {
fn is_empty(&self) -> bool { self.inner.is_empty() }
}

#[stable(feature = "env_iterators", since = "1.11.0")]
#[stable(feature = "env_iterators", since = "1.12.0")]
impl DoubleEndedIterator for Args {
fn next_back(&mut self) -> Option<String> {
self.inner.next_back().map(|s| s.into_string().unwrap())
Expand All @@ -707,7 +707,7 @@ impl ExactSizeIterator for ArgsOs {
fn is_empty(&self) -> bool { self.inner.is_empty() }
}

#[stable(feature = "env_iterators", since = "1.11.0")]
#[stable(feature = "env_iterators", since = "1.12.0")]
impl DoubleEndedIterator for ArgsOs {
fn next_back(&mut self) -> Option<OsString> { self.inner.next_back() }
}
Expand Down
6 changes: 3 additions & 3 deletions src/libstd/error.rs
Expand Up @@ -193,7 +193,7 @@ impl From<String> for Box<Error + Send + Sync> {
}
}

#[stable(feature = "string_box_error", since = "1.7.0")]
#[stable(feature = "string_box_error", since = "1.6.0")]
impl From<String> for Box<Error> {
fn from(str_err: String) -> Box<Error> {
let err1: Box<Error + Send + Sync> = From::from(str_err);
Expand All @@ -209,7 +209,7 @@ impl<'a, 'b> From<&'b str> for Box<Error + Send + Sync + 'a> {
}
}

#[stable(feature = "string_box_error", since = "1.7.0")]
#[stable(feature = "string_box_error", since = "1.6.0")]
impl<'a> From<&'a str> for Box<Error> {
fn from(err: &'a str) -> Box<Error> {
From::from(String::from(err))
Expand Down Expand Up @@ -282,7 +282,7 @@ impl Error for char::DecodeUtf16Error {
}
}

#[stable(feature = "box_error", since = "1.7.0")]
#[stable(feature = "box_error", since = "1.8.0")]
impl<T: Error> Error for Box<T> {
fn description(&self) -> &str {
Error::description(&**self)
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/ffi/c_str.rs
Expand Up @@ -419,14 +419,14 @@ impl<'a> From<&'a CStr> for Box<CStr> {
}
}

#[stable(feature = "c_string_from_box", since = "1.17.0")]
#[stable(feature = "c_string_from_box", since = "1.18.0")]
impl From<Box<CStr>> for CString {
fn from(s: Box<CStr>) -> CString {
s.into_c_string()
}
}

#[stable(feature = "box_from_c_string", since = "1.17.0")]
#[stable(feature = "box_from_c_string", since = "1.18.0")]
impl Into<Box<CStr>> for CString {
fn into(self) -> Box<CStr> {
self.into_boxed_c_str()
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/ffi/os_str.rs
Expand Up @@ -529,14 +529,14 @@ impl<'a> From<&'a OsStr> for Box<OsStr> {
}
}

#[stable(feature = "os_string_from_box", since = "1.17.0")]
#[stable(feature = "os_string_from_box", since = "1.18.0")]
impl<'a> From<Box<OsStr>> for OsString {
fn from(boxed: Box<OsStr>) -> OsString {
boxed.into_os_string()
}
}

#[stable(feature = "box_from_c_string", since = "1.17.0")]
#[stable(feature = "box_from_os_string", since = "1.18.0")]
impl Into<Box<OsStr>> for OsString {
fn into(self) -> Box<OsStr> {
self.into_boxed_os_str()
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/macros.rs
Expand Up @@ -143,7 +143,7 @@ macro_rules! println {
///
/// Panics if writing to `io::stderr` fails.
#[macro_export]
#[stable(feature = "eprint", since="1.18.0")]
#[stable(feature = "eprint", since = "1.19.0")]
#[allow_internal_unstable]
macro_rules! eprint {
($($arg:tt)*) => ($crate::io::_eprint(format_args!($($arg)*)));
Expand All @@ -162,7 +162,7 @@ macro_rules! eprint {
///
/// Panics if writing to `io::stderr` fails.
#[macro_export]
#[stable(feature = "eprint", since="1.18.0")]
#[stable(feature = "eprint", since = "1.19.0")]
macro_rules! eprintln {
() => (eprint!("\n"));
($fmt:expr) => (eprint!(concat!($fmt, "\n")));
Expand Down

0 comments on commit 2f703e4

Please sign in to comment.