Stabilize iter::repeat_n · patricklam/verify-rust-std@126935f (original) (raw)

`@@ -18,7 +18,6 @@ use crate::num::NonZero;

`

18

18

`/// Basic usage:

`

19

19

`///

`

20

20

```` /// ```


`21`

``

`-

/// #![feature(iter_repeat_n)]

`

`22`

`21`

`/// use std::iter;

`

`23`

`22`

`///

`

`24`

`23`

`/// // four of the number four:

`

`@@ -36,7 +35,6 @@ use crate::num::NonZero;

`

`36`

`35`

`` /// For non-`Copy` types,

``

`37`

`36`

`///

`

`38`

`37`

```` /// ```

39

``

`-

/// #![feature(iter_repeat_n)]

`

40

38

`/// use std::iter;

`

41

39

`///

`

42

40

`/// let v: Vec = Vec::with_capacity(123);

`

`@@ -58,7 +56,7 @@ use crate::num::NonZero;

`

58

56

`/// assert_eq!(None, it.next());

`

59

57

```` /// ```

````

60

58

`#[inline]

`

61

``

`-

#[unstable(feature = "iter_repeat_n", issue = "104434")]

`

``

59

`+

#[stable(feature = "iter_repeat_n", since = "CURRENT_RUSTC_VERSION")]

`

62

60

`pub fn repeat_n<T: Clone>(element: T, count: usize) -> RepeatN {

`

63

61

`let mut element = ManuallyDrop::new(element);

`

64

62

``

`@@ -77,7 +75,7 @@ pub fn repeat_n<T: Clone>(element: T, count: usize) -> RepeatN {

`

77

75

`` /// This struct is created by the [repeat_n()] function.

``

78

76

`/// See its documentation for more.

`

79

77

`#[derive(Clone, Debug)]

`

80

``

`-

#[unstable(feature = "iter_repeat_n", issue = "104434")]

`

``

78

`+

#[stable(feature = "iter_repeat_n", since = "CURRENT_RUSTC_VERSION")]

`

81

79

`pub struct RepeatN {

`

82

80

`count: usize,

`

83

81

`// Invariant: has been dropped iff count == 0.

`

`@@ -101,14 +99,14 @@ impl RepeatN {

`

101

99

`}

`

102

100

`}

`

103

101

``

104

``

`-

#[unstable(feature = "iter_repeat_n", issue = "104434")]

`

``

102

`+

#[stable(feature = "iter_repeat_n", since = "CURRENT_RUSTC_VERSION")]

`

105

103

`impl Drop for RepeatN {

`

106

104

`fn drop(&mut self) {

`

107

105

`self.take_element();

`

108

106

`}

`

109

107

`}

`

110

108

``

111

``

`-

#[unstable(feature = "iter_repeat_n", issue = "104434")]

`

``

109

`+

#[stable(feature = "iter_repeat_n", since = "CURRENT_RUSTC_VERSION")]

`

112

110

`impl<A: Clone> Iterator for RepeatN {

`

113

111

`type Item = A;

`

114

112

``

`@@ -156,14 +154,14 @@ impl<A: Clone> Iterator for RepeatN {

`

156

154

`}

`

157

155

`}

`

158

156

``

159

``

`-

#[unstable(feature = "iter_repeat_n", issue = "104434")]

`

``

157

`+

#[stable(feature = "iter_repeat_n", since = "CURRENT_RUSTC_VERSION")]

`

160

158

`impl<A: Clone> ExactSizeIterator for RepeatN {

`

161

159

`fn len(&self) -> usize {

`

162

160

`self.count

`

163

161

`}

`

164

162

`}

`

165

163

``

166

``

`-

#[unstable(feature = "iter_repeat_n", issue = "104434")]

`

``

164

`+

#[stable(feature = "iter_repeat_n", since = "CURRENT_RUSTC_VERSION")]

`

167

165

`impl<A: Clone> DoubleEndedIterator for RepeatN {

`

168

166

`#[inline]

`

169

167

`fn next_back(&mut self) -> Option {

`

`@@ -181,12 +179,12 @@ impl<A: Clone> DoubleEndedIterator for RepeatN {

`

181

179

`}

`

182

180

`}

`

183

181

``

184

``

`-

#[unstable(feature = "iter_repeat_n", issue = "104434")]

`

``

182

`+

#[stable(feature = "iter_repeat_n", since = "CURRENT_RUSTC_VERSION")]

`

185

183

`impl<A: Clone> FusedIterator for RepeatN {}

`

186

184

``

187

185

`#[unstable(feature = "trusted_len", issue = "37572")]

`

188

186

`unsafe impl<A: Clone> TrustedLen for RepeatN {}

`

189

``

`-

#[unstable(feature = "trusted_len_next_unchecked", issue = "37572")]

`

``

187

`+

#[stable(feature = "iter_repeat_n", since = "CURRENT_RUSTC_VERSION")]

`

190

188

`impl<A: Clone> UncheckedIterator for RepeatN {

`

191

189

`#[inline]

`

192

190

`unsafe fn next_unchecked(&mut self) -> Self::Item {

`