about summary refs log tree commit diff
diff options
context:
space:
mode:
authorScott McMurray <scottmcm@users.noreply.github.com>2017-05-29 23:56:37 -0700
committerScott McMurray <scottmcm@users.noreply.github.com>2017-05-31 22:35:34 -0700
commit1723e063c9d29bbcfe7622789869818cb635bdeb (patch)
tree4e81a2963f893c15779f6316e04e529778b25735
parent0967e2495d7a631cdb0daa01507e3b2350878db1 (diff)
Deprecate iter::range::StepBy
Only exposed as DeprecatedStepBy (as of PR 41439)
-rw-r--r--src/libcore/iter/mod.rs3
-rw-r--r--src/libcore/iter/range.rs12
2 files changed, 15 insertions, 0 deletions
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::iterator::Iterator;
 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 @@ step_impl_no_between!(u128 i128);
 #[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<A, R> {
     step_by: A,
     range: R,
@@ -274,6 +277,7 @@ impl<A: Step> ops::RangeFrom<A> {
                issue = "27741")]
     #[rustc_deprecated(since = "1.19.0",
                        reason = "replaced by `Iterator::step_by`")]
+    #[allow(deprecated)]
     pub fn step_by(self, by: A) -> StepBy<A, Self> {
         StepBy {
             step_by: by,
@@ -301,6 +305,7 @@ impl<A: Step> ops::Range<A> {
                issue = "27741")]
     #[rustc_deprecated(since = "1.19.0",
                        reason = "replaced by `Iterator::step_by`")]
+    #[allow(deprecated)]
     pub fn step_by(self, by: A) -> StepBy<A, Self> {
         StepBy {
             step_by: by,
@@ -327,6 +332,7 @@ impl<A: Step> ops::RangeInclusive<A> {
                issue = "27741")]
     #[rustc_deprecated(since = "1.19.0",
                        reason = "replaced by `Iterator::step_by`")]
+    #[allow(deprecated)]
     pub fn step_by(self, by: A) -> StepBy<A, Self> {
         StepBy {
             step_by: by,
@@ -337,6 +343,7 @@ impl<A: Step> ops::RangeInclusive<A> {
 
 #[unstable(feature = "step_by", reason = "recent addition",
            issue = "27741")]
+#[allow(deprecated)]
 impl<A> Iterator for StepBy<A, ops::RangeFrom<A>> where
     A: Clone,
     for<'a> &'a A: Add<&'a A, Output = A>
@@ -357,11 +364,13 @@ impl<A> Iterator for StepBy<A, ops::RangeFrom<A>> where
 }
 
 #[unstable(feature = "fused", issue = "35602")]
+#[allow(deprecated)]
 impl<A> FusedIterator for StepBy<A, ops::RangeFrom<A>>
     where A: Clone, for<'a> &'a A: Add<&'a A, Output = A> {}
 
 #[unstable(feature = "step_by", reason = "recent addition",
            issue = "27741")]
+#[allow(deprecated)]
 impl<A: Step + Clone> Iterator for StepBy<A, ops::Range<A>> {
     type Item = A;
 
@@ -399,11 +408,13 @@ impl<A: Step + Clone> Iterator for StepBy<A, ops::Range<A>> {
 }
 
 #[unstable(feature = "fused", issue = "35602")]
+#[allow(deprecated)]
 impl<A: Step + Clone> FusedIterator for StepBy<A, ops::Range<A>> {}
 
 #[unstable(feature = "inclusive_range",
            reason = "recently added, follows RFC",
            issue = "28237")]
+#[allow(deprecated)]
 impl<A: Step + Clone> Iterator for StepBy<A, ops::RangeInclusive<A>> {
     type Item = A;
 
@@ -443,6 +454,7 @@ impl<A: Step + Clone> Iterator for StepBy<A, ops::RangeInclusive<A>> {
 }
 
 #[unstable(feature = "fused", issue = "35602")]
+#[allow(deprecated)]
 impl<A: Step + Clone> FusedIterator for StepBy<A, ops::RangeInclusive<A>> {}
 
 macro_rules! range_exact_iter_impl {