From fd325a1b485b1698f86e791a5586cda79e64fdbd Mon Sep 17 00:00:00 2001 From: Oliver Middleton Date: Tue, 18 Apr 2017 23:33:38 +0100 Subject: [PATCH] Fix a few stability attributes These show up in rustdoc so need to be correct. --- src/libcollections/btree/map.rs | 5 +++++ src/libcollections/btree/set.rs | 5 +++++ src/libcollections/vec_deque.rs | 2 +- src/libcore/macros.rs | 10 +++++----- src/libstd/error.rs | 2 +- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/libcollections/btree/map.rs b/src/libcollections/btree/map.rs index b986c0275502c..fb0b852d10271 100644 --- a/src/libcollections/btree/map.rs +++ b/src/libcollections/btree/map.rs @@ -1442,6 +1442,7 @@ impl<'a, K, V> Clone for Values<'a, K, V> { } } +#[stable(feature = "btree_range", since = "1.17.0")] impl<'a, K, V> Iterator for Range<'a, K, V> { type Item = (&'a K, &'a V); @@ -1517,6 +1518,7 @@ impl<'a, K, V> Range<'a, K, V> { } } +#[stable(feature = "btree_range", since = "1.17.0")] impl<'a, K, V> DoubleEndedIterator for Range<'a, K, V> { fn next_back(&mut self) -> Option<(&'a K, &'a V)> { if self.front == self.back { @@ -1562,6 +1564,7 @@ impl<'a, K, V> Range<'a, K, V> { #[unstable(feature = "fused", issue = "35602")] impl<'a, K, V> FusedIterator for Range<'a, K, V> {} +#[stable(feature = "btree_range", since = "1.17.0")] impl<'a, K, V> Clone for Range<'a, K, V> { fn clone(&self) -> Range<'a, K, V> { Range { @@ -1571,6 +1574,7 @@ impl<'a, K, V> Clone for Range<'a, K, V> { } } +#[stable(feature = "btree_range", since = "1.17.0")] impl<'a, K, V> Iterator for RangeMut<'a, K, V> { type Item = (&'a K, &'a mut V); @@ -1615,6 +1619,7 @@ impl<'a, K, V> RangeMut<'a, K, V> { } } +#[stable(feature = "btree_range", since = "1.17.0")] impl<'a, K, V> DoubleEndedIterator for RangeMut<'a, K, V> { fn next_back(&mut self) -> Option<(&'a K, &'a mut V)> { if self.front == self.back { diff --git a/src/libcollections/btree/set.rs b/src/libcollections/btree/set.rs index ffca6964c5fdf..dfff44e30c597 100644 --- a/src/libcollections/btree/set.rs +++ b/src/libcollections/btree/set.rs @@ -941,11 +941,14 @@ impl ExactSizeIterator for IntoIter { #[unstable(feature = "fused", issue = "35602")] impl FusedIterator for IntoIter {} +#[stable(feature = "btree_range", since = "1.17.0")] impl<'a, T> Clone for Range<'a, T> { fn clone(&self) -> Range<'a, T> { Range { iter: self.iter.clone() } } } + +#[stable(feature = "btree_range", since = "1.17.0")] impl<'a, T> Iterator for Range<'a, T> { type Item = &'a T; @@ -953,6 +956,8 @@ impl<'a, T> Iterator for Range<'a, T> { self.iter.next().map(|(k, _)| k) } } + +#[stable(feature = "btree_range", since = "1.17.0")] impl<'a, T> DoubleEndedIterator for Range<'a, T> { fn next_back(&mut self) -> Option<&'a T> { self.iter.next_back().map(|(k, _)| k) diff --git a/src/libcollections/vec_deque.rs b/src/libcollections/vec_deque.rs index 2ce3b92843bd7..2a73a78adbe5f 100644 --- a/src/libcollections/vec_deque.rs +++ b/src/libcollections/vec_deque.rs @@ -2272,7 +2272,7 @@ macro_rules! __impl_slice_eq1 { __impl_slice_eq1! { $Lhs, $Rhs, Sized } }; ($Lhs: ty, $Rhs: ty, $Bound: ident) => { - #[stable(feature = "vec-deque-partial-eq-slice", since = "1.16.0")] + #[stable(feature = "vec-deque-partial-eq-slice", since = "1.17.0")] impl<'a, 'b, A: $Bound, B> PartialEq<$Rhs> for $Lhs where A: PartialEq { fn eq(&self, other: &$Rhs) -> bool { if self.len() != other.len() { diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs index 2a28d108df77d..bf4e414d41684 100644 --- a/src/libcore/macros.rs +++ b/src/libcore/macros.rs @@ -150,7 +150,7 @@ macro_rules! assert_eq { /// assert_ne!(a, b, "we are testing that the values are not equal"); /// ``` #[macro_export] -#[stable(feature = "assert_ne", since = "1.12.0")] +#[stable(feature = "assert_ne", since = "1.13.0")] macro_rules! assert_ne { ($left:expr, $right:expr) => ({ match (&$left, &$right) { @@ -268,7 +268,7 @@ macro_rules! debug_assert_eq { /// debug_assert_ne!(a, b); /// ``` #[macro_export] -#[stable(feature = "assert_ne", since = "1.12.0")] +#[stable(feature = "assert_ne", since = "1.13.0")] macro_rules! debug_assert_ne { ($($arg:tt)*) => (if cfg!(debug_assertions) { assert_ne!($($arg)*); }) } @@ -379,7 +379,7 @@ macro_rules! try { /// assert_eq!(v, b"s = \"abc 123\""); /// ``` #[macro_export] -#[stable(feature = "core", since = "1.6.0")] +#[stable(feature = "rust1", since = "1.0.0")] macro_rules! write { ($dst:expr, $($arg:tt)*) => ($dst.write_fmt(format_args!($($arg)*))) } @@ -479,7 +479,7 @@ macro_rules! writeln { /// } /// ``` #[macro_export] -#[stable(feature = "core", since = "1.6.0")] +#[stable(feature = "rust1", since = "1.0.0")] macro_rules! unreachable { () => ({ panic!("internal error: entered unreachable code") @@ -540,7 +540,7 @@ macro_rules! unreachable { /// } /// ``` #[macro_export] -#[stable(feature = "core", since = "1.6.0")] +#[stable(feature = "rust1", since = "1.0.0")] macro_rules! unimplemented { () => (panic!("not yet implemented")) } diff --git a/src/libstd/error.rs b/src/libstd/error.rs index 3d80120f6b2bd..9ff7d7467338b 100644 --- a/src/libstd/error.rs +++ b/src/libstd/error.rs @@ -216,7 +216,7 @@ impl<'a> From<&'a str> for Box { } } -#[stable(feature = "never_error", since = "1.18.0")] +#[unstable(feature = "never_type_impls", issue = "35121")] impl Error for ! { fn description(&self) -> &str { *self } }