about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libcore/iter/range.rs31
-rw-r--r--src/test/compile-fail/range-1.rs1
2 files changed, 8 insertions, 24 deletions
diff --git a/src/libcore/iter/range.rs b/src/libcore/iter/range.rs
index 1dad8157948..11a8f8f7ee6 100644
--- a/src/libcore/iter/range.rs
+++ b/src/libcore/iter/range.rs
@@ -277,9 +277,7 @@ macro_rules! range_incl_trusted_len_impl {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<A: Step> Iterator for ops::Range<A> where
-    for<'a> &'a A: Add<&'a A, Output = A>
-{
+impl<A: Step> Iterator for ops::Range<A> {
     type Item = A;
 
     #[inline]
@@ -317,10 +315,7 @@ range_trusted_len_impl!(usize isize u8 i8 u16 i16 u32 i32 i64 u64);
 range_incl_trusted_len_impl!(usize isize u8 i8 u16 i16 u32 i32 i64 u64);
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<A: Step + Clone> DoubleEndedIterator for ops::Range<A> where
-    for<'a> &'a A: Add<&'a A, Output = A>,
-    for<'a> &'a A: Sub<&'a A, Output = A>
-{
+impl<A: Step + Clone> DoubleEndedIterator for ops::Range<A> {
     #[inline]
     fn next_back(&mut self) -> Option<A> {
         if self.start < self.end {
@@ -333,13 +328,10 @@ impl<A: Step + Clone> DoubleEndedIterator for ops::Range<A> where
 }
 
 #[unstable(feature = "fused", issue = "35602")]
-impl<A> FusedIterator for ops::Range<A>
-    where A: Step, for<'a> &'a A: Add<&'a A, Output = A> {}
+impl<A: Step> FusedIterator for ops::Range<A> {}
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<A: Step> Iterator for ops::RangeFrom<A> where
-    for<'a> &'a A: Add<&'a A, Output = A>
-{
+impl<A: Step> Iterator for ops::RangeFrom<A> {
     type Item = A;
 
     #[inline]
@@ -356,13 +348,10 @@ impl<A: Step> Iterator for ops::RangeFrom<A> where
 }
 
 #[unstable(feature = "fused", issue = "35602")]
-impl<A> FusedIterator for ops::RangeFrom<A>
-    where A: Step, for<'a> &'a A: Add<&'a A, Output = A> {}
+impl<A: Step> FusedIterator for ops::RangeFrom<A> {}
 
 #[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
-impl<A: Step> Iterator for ops::RangeInclusive<A> where
-    for<'a> &'a A: Add<&'a A, Output = A>
-{
+impl<A: Step> Iterator for ops::RangeInclusive<A> {
     type Item = A;
 
     #[inline]
@@ -397,10 +386,7 @@ impl<A: Step> Iterator for ops::RangeInclusive<A> where
 }
 
 #[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
-impl<A: Step> DoubleEndedIterator for ops::RangeInclusive<A> where
-    for<'a> &'a A: Add<&'a A, Output = A>,
-    for<'a> &'a A: Sub<&'a A, Output = A>
-{
+impl<A: Step> DoubleEndedIterator for ops::RangeInclusive<A> {
     #[inline]
     fn next_back(&mut self) -> Option<A> {
         use cmp::Ordering::*;
@@ -421,5 +407,4 @@ impl<A: Step> DoubleEndedIterator for ops::RangeInclusive<A> where
 }
 
 #[unstable(feature = "fused", issue = "35602")]
-impl<A> FusedIterator for ops::RangeInclusive<A>
-    where A: Step, for<'a> &'a A: Add<&'a A, Output = A> {}
+impl<A: Step> FusedIterator for ops::RangeInclusive<A> {}
diff --git a/src/test/compile-fail/range-1.rs b/src/test/compile-fail/range-1.rs
index dc6833163a4..58794e3b35d 100644
--- a/src/test/compile-fail/range-1.rs
+++ b/src/test/compile-fail/range-1.rs
@@ -18,7 +18,6 @@ pub fn main() {
     // Bool => does not implement iterator.
     for i in false..true {}
     //~^ ERROR `bool: std::iter::Step` is not satisfied
-    //~^^ ERROR `for<'a> &'a bool: std::ops::Add` is not satisfied
 
     // Unsized type.
     let arr: &[_] = &[1, 2, 3];