Skip to content

Commit 9128f61

Browse files
committed
Fix a few impl stability attributes
The versions show up in rustdoc.
1 parent 010c3e2 commit 9128f61

28 files changed

+116
-93
lines changed

src/libcollections/binary_heap.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,7 @@ impl<'a, T: 'a> ExactSizeIterator for Drain<'a, T> {
10881088
#[unstable(feature = "fused", issue = "35602")]
10891089
impl<'a, T: 'a> FusedIterator for Drain<'a, T> {}
10901090

1091-
#[stable(feature = "rust1", since = "1.0.0")]
1091+
#[stable(feature = "binary_heap_extras_15", since = "1.5.0")]
10921092
impl<T: Ord> From<Vec<T>> for BinaryHeap<T> {
10931093
fn from(vec: Vec<T>) -> BinaryHeap<T> {
10941094
let mut heap = BinaryHeap { data: vec };
@@ -1097,7 +1097,7 @@ impl<T: Ord> From<Vec<T>> for BinaryHeap<T> {
10971097
}
10981098
}
10991099

1100-
#[stable(feature = "rust1", since = "1.0.0")]
1100+
#[stable(feature = "binary_heap_extras_15", since = "1.5.0")]
11011101
impl<T> From<BinaryHeap<T>> for Vec<T> {
11021102
fn from(heap: BinaryHeap<T>) -> Vec<T> {
11031103
heap.data

src/libcore/char.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ impl ExactSizeIterator for EscapeUnicode {
588588
#[unstable(feature = "fused", issue = "35602")]
589589
impl FusedIterator for EscapeUnicode {}
590590

591-
#[stable(feature = "char_struct_display", since = "1.17.0")]
591+
#[stable(feature = "char_struct_display", since = "1.16.0")]
592592
impl fmt::Display for EscapeUnicode {
593593
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
594594
for c in self.clone() {
@@ -701,7 +701,7 @@ impl ExactSizeIterator for EscapeDefault {
701701
#[unstable(feature = "fused", issue = "35602")]
702702
impl FusedIterator for EscapeDefault {}
703703

704-
#[stable(feature = "char_struct_display", since = "1.17.0")]
704+
#[stable(feature = "char_struct_display", since = "1.16.0")]
705705
impl fmt::Display for EscapeDefault {
706706
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
707707
for c in self.clone() {
@@ -735,7 +735,7 @@ impl ExactSizeIterator for EscapeDebug { }
735735
#[unstable(feature = "fused", issue = "35602")]
736736
impl FusedIterator for EscapeDebug {}
737737

738-
#[stable(feature = "char_struct_display", since = "1.17.0")]
738+
#[unstable(feature = "char_escape_debug", issue = "35068")]
739739
impl fmt::Display for EscapeDebug {
740740
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
741741
fmt::Display::fmt(&self.0, f)

src/libcore/internal_macros.rs

+12-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
// based on "op T" where T is expected to be `Copy`able
1414
macro_rules! forward_ref_unop {
1515
(impl $imp:ident, $method:ident for $t:ty) => {
16-
#[stable(feature = "rust1", since = "1.0.0")]
16+
forward_ref_unop!(impl $imp, $method for $t,
17+
#[stable(feature = "rust1", since = "1.0.0")]);
18+
};
19+
(impl $imp:ident, $method:ident for $t:ty, #[$attr:meta]) => {
20+
#[$attr]
1721
impl<'a> $imp for &'a $t {
1822
type Output = <$t as $imp>::Output;
1923

@@ -29,7 +33,11 @@ macro_rules! forward_ref_unop {
2933
// based on "T op U" where T and U are expected to be `Copy`able
3034
macro_rules! forward_ref_binop {
3135
(impl $imp:ident, $method:ident for $t:ty, $u:ty) => {
32-
#[stable(feature = "rust1", since = "1.0.0")]
36+
forward_ref_binop!(impl $imp, $method for $t, $u,
37+
#[stable(feature = "rust1", since = "1.0.0")]);
38+
};
39+
(impl $imp:ident, $method:ident for $t:ty, $u:ty, #[$attr:meta]) => {
40+
#[$attr]
3341
impl<'a> $imp<$u> for &'a $t {
3442
type Output = <$t as $imp<$u>>::Output;
3543

@@ -39,7 +47,7 @@ macro_rules! forward_ref_binop {
3947
}
4048
}
4149

42-
#[stable(feature = "rust1", since = "1.0.0")]
50+
#[$attr]
4351
impl<'a> $imp<&'a $u> for $t {
4452
type Output = <$t as $imp<$u>>::Output;
4553

@@ -49,7 +57,7 @@ macro_rules! forward_ref_binop {
4957
}
5058
}
5159

52-
#[stable(feature = "rust1", since = "1.0.0")]
60+
#[$attr]
5361
impl<'a, 'b> $imp<&'a $u> for &'b $t {
5462
type Output = <$t as $imp<$u>>::Output;
5563

src/libcore/iter/traits.rs

+11-7
Original file line numberDiff line numberDiff line change
@@ -603,38 +603,42 @@ pub trait Product<A = Self>: Sized {
603603

604604
// NB: explicitly use Add and Mul here to inherit overflow checks
605605
macro_rules! integer_sum_product {
606-
(@impls $zero:expr, $one:expr, $($a:ty)*) => ($(
607-
#[stable(feature = "iter_arith_traits", since = "1.12.0")]
606+
(@impls $zero:expr, $one:expr, #[$attr:meta], $($a:ty)*) => ($(
607+
#[$attr]
608608
impl Sum for $a {
609609
fn sum<I: Iterator<Item=$a>>(iter: I) -> $a {
610610
iter.fold($zero, Add::add)
611611
}
612612
}
613613

614-
#[stable(feature = "iter_arith_traits", since = "1.12.0")]
614+
#[$attr]
615615
impl Product for $a {
616616
fn product<I: Iterator<Item=$a>>(iter: I) -> $a {
617617
iter.fold($one, Mul::mul)
618618
}
619619
}
620620

621-
#[stable(feature = "iter_arith_traits", since = "1.12.0")]
621+
#[$attr]
622622
impl<'a> Sum<&'a $a> for $a {
623623
fn sum<I: Iterator<Item=&'a $a>>(iter: I) -> $a {
624624
iter.fold($zero, Add::add)
625625
}
626626
}
627627

628-
#[stable(feature = "iter_arith_traits", since = "1.12.0")]
628+
#[$attr]
629629
impl<'a> Product<&'a $a> for $a {
630630
fn product<I: Iterator<Item=&'a $a>>(iter: I) -> $a {
631631
iter.fold($one, Mul::mul)
632632
}
633633
}
634634
)*);
635635
($($a:ty)*) => (
636-
integer_sum_product!(@impls 0, 1, $($a)+);
637-
integer_sum_product!(@impls Wrapping(0), Wrapping(1), $(Wrapping<$a>)+);
636+
integer_sum_product!(@impls 0, 1,
637+
#[stable(feature = "iter_arith_traits", since = "1.12.0")],
638+
$($a)+);
639+
integer_sum_product!(@impls Wrapping(0), Wrapping(1),
640+
#[stable(feature = "wrapping_iter_arith", since = "1.14.0")],
641+
$(Wrapping<$a>)+);
638642
);
639643
}
640644

src/libcore/num/int_macros.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212

1313
macro_rules! int_module {
1414
($T:ident) => (int_module!($T, #[stable(feature = "rust1", since = "1.0.0")]););
15-
($T:ident, $($attr: tt)*) => (
15+
($T:ident, #[$attr:meta]) => (
1616
/// The smallest value that can be represented by this integer type.
17-
$($attr)*
17+
#[$attr]
1818
pub const MIN: $T = $T::min_value();
1919
/// The largest value that can be represented by this integer type.
20-
$($attr)*
20+
#[$attr]
2121
pub const MAX: $T = $T::max_value();
2222
)
2323
}

src/libcore/num/uint_macros.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212

1313
macro_rules! uint_module {
1414
($T:ident) => (uint_module!($T, #[stable(feature = "rust1", since = "1.0.0")]););
15-
($T:ident, $($attr: tt)*) => (
15+
($T:ident, #[$attr:meta]) => (
1616
/// The smallest value that can be represented by this integer type.
17-
$($attr)*
17+
#[$attr]
1818
pub const MIN: $T = $T::min_value();
1919
/// The largest value that can be represented by this integer type.
20-
$($attr)*
20+
#[$attr]
2121
pub const MAX: $T = $T::max_value();
2222
)
2323
}

src/libcore/num/wrapping.rs

+20-10
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ macro_rules! wrapping_impl {
131131
Wrapping(self.0.wrapping_add(other.0))
132132
}
133133
}
134-
forward_ref_binop! { impl Add, add for Wrapping<$t>, Wrapping<$t> }
134+
forward_ref_binop! { impl Add, add for Wrapping<$t>, Wrapping<$t>,
135+
#[stable(feature = "wrapping_ref", since = "1.14.0")] }
135136

136137
#[stable(feature = "op_assign_traits", since = "1.8.0")]
137138
impl AddAssign for Wrapping<$t> {
@@ -150,7 +151,8 @@ macro_rules! wrapping_impl {
150151
Wrapping(self.0.wrapping_sub(other.0))
151152
}
152153
}
153-
forward_ref_binop! { impl Sub, sub for Wrapping<$t>, Wrapping<$t> }
154+
forward_ref_binop! { impl Sub, sub for Wrapping<$t>, Wrapping<$t>,
155+
#[stable(feature = "wrapping_ref", since = "1.14.0")] }
154156

155157
#[stable(feature = "op_assign_traits", since = "1.8.0")]
156158
impl SubAssign for Wrapping<$t> {
@@ -169,7 +171,8 @@ macro_rules! wrapping_impl {
169171
Wrapping(self.0.wrapping_mul(other.0))
170172
}
171173
}
172-
forward_ref_binop! { impl Mul, mul for Wrapping<$t>, Wrapping<$t> }
174+
forward_ref_binop! { impl Mul, mul for Wrapping<$t>, Wrapping<$t>,
175+
#[stable(feature = "wrapping_ref", since = "1.14.0")] }
173176

174177
#[stable(feature = "op_assign_traits", since = "1.8.0")]
175178
impl MulAssign for Wrapping<$t> {
@@ -188,7 +191,8 @@ macro_rules! wrapping_impl {
188191
Wrapping(self.0.wrapping_div(other.0))
189192
}
190193
}
191-
forward_ref_binop! { impl Div, div for Wrapping<$t>, Wrapping<$t> }
194+
forward_ref_binop! { impl Div, div for Wrapping<$t>, Wrapping<$t>,
195+
#[stable(feature = "wrapping_ref", since = "1.14.0")] }
192196

193197
#[stable(feature = "op_assign_traits", since = "1.8.0")]
194198
impl DivAssign for Wrapping<$t> {
@@ -207,7 +211,8 @@ macro_rules! wrapping_impl {
207211
Wrapping(self.0.wrapping_rem(other.0))
208212
}
209213
}
210-
forward_ref_binop! { impl Rem, rem for Wrapping<$t>, Wrapping<$t> }
214+
forward_ref_binop! { impl Rem, rem for Wrapping<$t>, Wrapping<$t>,
215+
#[stable(feature = "wrapping_ref", since = "1.14.0")] }
211216

212217
#[stable(feature = "op_assign_traits", since = "1.8.0")]
213218
impl RemAssign for Wrapping<$t> {
@@ -226,7 +231,8 @@ macro_rules! wrapping_impl {
226231
Wrapping(!self.0)
227232
}
228233
}
229-
forward_ref_unop! { impl Not, not for Wrapping<$t> }
234+
forward_ref_unop! { impl Not, not for Wrapping<$t>,
235+
#[stable(feature = "wrapping_ref", since = "1.14.0")] }
230236

231237
#[stable(feature = "rust1", since = "1.0.0")]
232238
impl BitXor for Wrapping<$t> {
@@ -237,7 +243,8 @@ macro_rules! wrapping_impl {
237243
Wrapping(self.0 ^ other.0)
238244
}
239245
}
240-
forward_ref_binop! { impl BitXor, bitxor for Wrapping<$t>, Wrapping<$t> }
246+
forward_ref_binop! { impl BitXor, bitxor for Wrapping<$t>, Wrapping<$t>,
247+
#[stable(feature = "wrapping_ref", since = "1.14.0")] }
241248

242249
#[stable(feature = "op_assign_traits", since = "1.8.0")]
243250
impl BitXorAssign for Wrapping<$t> {
@@ -256,7 +263,8 @@ macro_rules! wrapping_impl {
256263
Wrapping(self.0 | other.0)
257264
}
258265
}
259-
forward_ref_binop! { impl BitOr, bitor for Wrapping<$t>, Wrapping<$t> }
266+
forward_ref_binop! { impl BitOr, bitor for Wrapping<$t>, Wrapping<$t>,
267+
#[stable(feature = "wrapping_ref", since = "1.14.0")] }
260268

261269
#[stable(feature = "op_assign_traits", since = "1.8.0")]
262270
impl BitOrAssign for Wrapping<$t> {
@@ -275,7 +283,8 @@ macro_rules! wrapping_impl {
275283
Wrapping(self.0 & other.0)
276284
}
277285
}
278-
forward_ref_binop! { impl BitAnd, bitand for Wrapping<$t>, Wrapping<$t> }
286+
forward_ref_binop! { impl BitAnd, bitand for Wrapping<$t>, Wrapping<$t>,
287+
#[stable(feature = "wrapping_ref", since = "1.14.0")] }
279288

280289
#[stable(feature = "op_assign_traits", since = "1.8.0")]
281290
impl BitAndAssign for Wrapping<$t> {
@@ -293,7 +302,8 @@ macro_rules! wrapping_impl {
293302
Wrapping(0) - self
294303
}
295304
}
296-
forward_ref_unop! { impl Neg, neg for Wrapping<$t> }
305+
forward_ref_unop! { impl Neg, neg for Wrapping<$t>,
306+
#[stable(feature = "wrapping_ref", since = "1.14.0")] }
297307
)*)
298308
}
299309

src/libcore/slice.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ pub trait SliceIndex<T> {
616616
fn index_mut(self, slice: &mut [T]) -> &mut Self::Output;
617617
}
618618

619-
#[stable(feature = "slice-get-slice-impls", since = "1.13.0")]
619+
#[stable(feature = "slice-get-slice-impls", since = "1.15.0")]
620620
impl<T> SliceIndex<T> for usize {
621621
type Output = T;
622622

@@ -665,7 +665,7 @@ impl<T> SliceIndex<T> for usize {
665665
}
666666
}
667667

668-
#[stable(feature = "slice-get-slice-impls", since = "1.13.0")]
668+
#[stable(feature = "slice-get-slice-impls", since = "1.15.0")]
669669
impl<T> SliceIndex<T> for ops::Range<usize> {
670670
type Output = [T];
671671

@@ -726,7 +726,7 @@ impl<T> SliceIndex<T> for ops::Range<usize> {
726726
}
727727
}
728728

729-
#[stable(feature = "slice-get-slice-impls", since = "1.13.0")]
729+
#[stable(feature = "slice-get-slice-impls", since = "1.15.0")]
730730
impl<T> SliceIndex<T> for ops::RangeTo<usize> {
731731
type Output = [T];
732732

@@ -761,7 +761,7 @@ impl<T> SliceIndex<T> for ops::RangeTo<usize> {
761761
}
762762
}
763763

764-
#[stable(feature = "slice-get-slice-impls", since = "1.13.0")]
764+
#[stable(feature = "slice-get-slice-impls", since = "1.15.0")]
765765
impl<T> SliceIndex<T> for ops::RangeFrom<usize> {
766766
type Output = [T];
767767

@@ -796,7 +796,7 @@ impl<T> SliceIndex<T> for ops::RangeFrom<usize> {
796796
}
797797
}
798798

799-
#[stable(feature = "slice-get-slice-impls", since = "1.13.0")]
799+
#[stable(feature = "slice-get-slice-impls", since = "1.15.0")]
800800
impl<T> SliceIndex<T> for ops::RangeFull {
801801
type Output = [T];
802802

@@ -832,7 +832,7 @@ impl<T> SliceIndex<T> for ops::RangeFull {
832832
}
833833

834834

835-
#[stable(feature = "slice-get-slice-impls", since = "1.13.0")]
835+
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
836836
impl<T> SliceIndex<T> for ops::RangeInclusive<usize> {
837837
type Output = [T];
838838

@@ -895,7 +895,7 @@ impl<T> SliceIndex<T> for ops::RangeInclusive<usize> {
895895
}
896896
}
897897

898-
#[stable(feature = "slice-get-slice-impls", since = "1.13.0")]
898+
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
899899
impl<T> SliceIndex<T> for ops::RangeToInclusive<usize> {
900900
type Output = [T];
901901

src/libstd/ascii.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ impl ExactSizeIterator for EscapeDefault {}
399399
#[unstable(feature = "fused", issue = "35602")]
400400
impl FusedIterator for EscapeDefault {}
401401

402-
#[stable(feature = "std_debug", since = "1.15.0")]
402+
#[stable(feature = "std_debug", since = "1.16.0")]
403403
impl fmt::Debug for EscapeDefault {
404404
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
405405
f.pad("EscapeDefault { .. }")

0 commit comments

Comments
 (0)