From 1723e063c9d29bbcfe7622789869818cb635bdeb Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Mon, 29 May 2017 23:56:37 -0700 Subject: [PATCH] Deprecate iter::range::StepBy Only exposed as DeprecatedStepBy (as of PR 41439) --- src/libcore/iter/mod.rs | 3 +++ src/libcore/iter/range.rs | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/libcore/iter/mod.rs b/src/libcore/iter/mod.rs index 07aed65f7a0..34563c88d0a 100644 --- a/src/libcore/iter/mod.rs +++ b/src/libcore/iter/mod.rs @@ -313,6 +313,9 @@ pub use self::range::Step; #[unstable(feature = "step_by", reason = "recent addition", issue = "27741")] +#[rustc_deprecated(since = "1.19.0", + reason = "replaced by `iter::StepBy`")] +#[allow(deprecated)] pub use self::range::StepBy as DeprecatedStepBy; #[stable(feature = "rust1", since = "1.0.0")] diff --git a/src/libcore/iter/range.rs b/src/libcore/iter/range.rs index f80ecca08a9..9aea4477fb7 100644 --- a/src/libcore/iter/range.rs +++ b/src/libcore/iter/range.rs @@ -252,6 +252,9 @@ fn steps_between_by_one(start: &Self, end: &Self) -> Option { #[derive(Clone, Debug)] #[unstable(feature = "step_by", reason = "recent addition", issue = "27741")] +#[rustc_deprecated(since = "1.19.0", + reason = "replaced by `iter::StepBy`")] +#[allow(deprecated)] pub struct StepBy { step_by: A, range: R, @@ -274,6 +277,7 @@ impl ops::RangeFrom { issue = "27741")] #[rustc_deprecated(since = "1.19.0", reason = "replaced by `Iterator::step_by`")] + #[allow(deprecated)] pub fn step_by(self, by: A) -> StepBy { StepBy { step_by: by, @@ -301,6 +305,7 @@ impl ops::Range { issue = "27741")] #[rustc_deprecated(since = "1.19.0", reason = "replaced by `Iterator::step_by`")] + #[allow(deprecated)] pub fn step_by(self, by: A) -> StepBy { StepBy { step_by: by, @@ -327,6 +332,7 @@ impl ops::RangeInclusive { issue = "27741")] #[rustc_deprecated(since = "1.19.0", reason = "replaced by `Iterator::step_by`")] + #[allow(deprecated)] pub fn step_by(self, by: A) -> StepBy { StepBy { step_by: by, @@ -337,6 +343,7 @@ pub fn step_by(self, by: A) -> StepBy { #[unstable(feature = "step_by", reason = "recent addition", issue = "27741")] +#[allow(deprecated)] impl Iterator for StepBy> where A: Clone, for<'a> &'a A: Add<&'a A, Output = A> @@ -357,11 +364,13 @@ fn size_hint(&self) -> (usize, Option) { } #[unstable(feature = "fused", issue = "35602")] +#[allow(deprecated)] impl FusedIterator for StepBy> where A: Clone, for<'a> &'a A: Add<&'a A, Output = A> {} #[unstable(feature = "step_by", reason = "recent addition", issue = "27741")] +#[allow(deprecated)] impl Iterator for StepBy> { type Item = A; @@ -399,11 +408,13 @@ fn size_hint(&self) -> (usize, Option) { } #[unstable(feature = "fused", issue = "35602")] +#[allow(deprecated)] impl FusedIterator for StepBy> {} #[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")] +#[allow(deprecated)] impl Iterator for StepBy> { type Item = A; @@ -443,6 +454,7 @@ fn size_hint(&self) -> (usize, Option) { } #[unstable(feature = "fused", issue = "35602")] +#[allow(deprecated)] impl FusedIterator for StepBy> {} macro_rules! range_exact_iter_impl { -- 2.44.0