Skip to content

Commit 1723e06

Browse files
committed
Deprecate iter::range::StepBy
Only exposed as DeprecatedStepBy (as of PR 41439)
1 parent 0967e24 commit 1723e06

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/libcore/iter/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,9 @@ pub use self::iterator::Iterator;
313313
pub use self::range::Step;
314314
#[unstable(feature = "step_by", reason = "recent addition",
315315
issue = "27741")]
316+
#[rustc_deprecated(since = "1.19.0",
317+
reason = "replaced by `iter::StepBy`")]
318+
#[allow(deprecated)]
316319
pub use self::range::StepBy as DeprecatedStepBy;
317320

318321
#[stable(feature = "rust1", since = "1.0.0")]

src/libcore/iter/range.rs

+12
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,9 @@ step_impl_no_between!(u128 i128);
252252
#[derive(Clone, Debug)]
253253
#[unstable(feature = "step_by", reason = "recent addition",
254254
issue = "27741")]
255+
#[rustc_deprecated(since = "1.19.0",
256+
reason = "replaced by `iter::StepBy`")]
257+
#[allow(deprecated)]
255258
pub struct StepBy<A, R> {
256259
step_by: A,
257260
range: R,
@@ -274,6 +277,7 @@ impl<A: Step> ops::RangeFrom<A> {
274277
issue = "27741")]
275278
#[rustc_deprecated(since = "1.19.0",
276279
reason = "replaced by `Iterator::step_by`")]
280+
#[allow(deprecated)]
277281
pub fn step_by(self, by: A) -> StepBy<A, Self> {
278282
StepBy {
279283
step_by: by,
@@ -301,6 +305,7 @@ impl<A: Step> ops::Range<A> {
301305
issue = "27741")]
302306
#[rustc_deprecated(since = "1.19.0",
303307
reason = "replaced by `Iterator::step_by`")]
308+
#[allow(deprecated)]
304309
pub fn step_by(self, by: A) -> StepBy<A, Self> {
305310
StepBy {
306311
step_by: by,
@@ -327,6 +332,7 @@ impl<A: Step> ops::RangeInclusive<A> {
327332
issue = "27741")]
328333
#[rustc_deprecated(since = "1.19.0",
329334
reason = "replaced by `Iterator::step_by`")]
335+
#[allow(deprecated)]
330336
pub fn step_by(self, by: A) -> StepBy<A, Self> {
331337
StepBy {
332338
step_by: by,
@@ -337,6 +343,7 @@ impl<A: Step> ops::RangeInclusive<A> {
337343

338344
#[unstable(feature = "step_by", reason = "recent addition",
339345
issue = "27741")]
346+
#[allow(deprecated)]
340347
impl<A> Iterator for StepBy<A, ops::RangeFrom<A>> where
341348
A: Clone,
342349
for<'a> &'a A: Add<&'a A, Output = A>
@@ -357,11 +364,13 @@ impl<A> Iterator for StepBy<A, ops::RangeFrom<A>> where
357364
}
358365

359366
#[unstable(feature = "fused", issue = "35602")]
367+
#[allow(deprecated)]
360368
impl<A> FusedIterator for StepBy<A, ops::RangeFrom<A>>
361369
where A: Clone, for<'a> &'a A: Add<&'a A, Output = A> {}
362370

363371
#[unstable(feature = "step_by", reason = "recent addition",
364372
issue = "27741")]
373+
#[allow(deprecated)]
365374
impl<A: Step + Clone> Iterator for StepBy<A, ops::Range<A>> {
366375
type Item = A;
367376

@@ -399,11 +408,13 @@ impl<A: Step + Clone> Iterator for StepBy<A, ops::Range<A>> {
399408
}
400409

401410
#[unstable(feature = "fused", issue = "35602")]
411+
#[allow(deprecated)]
402412
impl<A: Step + Clone> FusedIterator for StepBy<A, ops::Range<A>> {}
403413

404414
#[unstable(feature = "inclusive_range",
405415
reason = "recently added, follows RFC",
406416
issue = "28237")]
417+
#[allow(deprecated)]
407418
impl<A: Step + Clone> Iterator for StepBy<A, ops::RangeInclusive<A>> {
408419
type Item = A;
409420

@@ -443,6 +454,7 @@ impl<A: Step + Clone> Iterator for StepBy<A, ops::RangeInclusive<A>> {
443454
}
444455

445456
#[unstable(feature = "fused", issue = "35602")]
457+
#[allow(deprecated)]
446458
impl<A: Step + Clone> FusedIterator for StepBy<A, ops::RangeInclusive<A>> {}
447459

448460
macro_rules! range_exact_iter_impl {

0 commit comments

Comments
 (0)