summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-09-28 18:31:07 -0700
committerGitHub <noreply@github.com>2016-09-28 18:31:07 -0700
commiteee2d04d877fe909309c39b6bdf711dc586d0a1e (patch)
tree22a6509d6a61cab58cf5b054e9bcc37d7c8e3736 /src/libcore
parent86affcdf6c622278a89b73bb7f1b8ac00e970888 (diff)
parentbd1ae637f8c9ecb94614831c4e6642d09f508dfb (diff)
downloadrust-eee2d04d877fe909309c39b6bdf711dc586d0a1e.tar.gz
rust-eee2d04d877fe909309c39b6bdf711dc586d0a1e.zip
Auto merge of #36395 - durka:rangeinclusive-no-esi, r=alexcrichton
remove ExactSizeIterator from RangeInclusive<{u,i}{32,size}>

Fixes #36386.

This is a [breaking-change] for nightly users of `#![feature(inclusive_range_syntax)]` and/or `#![feature(inclusive_range)]`.
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/iter/range.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libcore/iter/range.rs b/src/libcore/iter/range.rs
index 66d05d81d80..38afcb6a65e 100644
--- a/src/libcore/iter/range.rs
+++ b/src/libcore/iter/range.rs
@@ -466,7 +466,11 @@ macro_rules! range_exact_iter_impl {
     ($($t:ty)*) => ($(
         #[stable(feature = "rust1", since = "1.0.0")]
         impl ExactSizeIterator for ops::Range<$t> { }
+    )*)
+}
 
+macro_rules! range_incl_exact_iter_impl {
+    ($($t:ty)*) => ($(
         #[unstable(feature = "inclusive_range",
                    reason = "recently added, follows RFC",
                    issue = "28237")]
@@ -500,9 +504,12 @@ impl<A: Step> Iterator for ops::Range<A> where
     }
 }
 
-// Ranges of u64 and i64 are excluded because they cannot guarantee having
-// a length <= usize::MAX, which is required by ExactSizeIterator.
+// These macros generate `ExactSizeIterator` impls for various range types.
+// Range<{u,i}64> and RangeInclusive<{u,i}{32,64,size}> are excluded
+// because they cannot guarantee having a length <= usize::MAX, which is
+// required by ExactSizeIterator.
 range_exact_iter_impl!(usize u8 u16 u32 isize i8 i16 i32);
+range_incl_exact_iter_impl!(u8 u16 i8 i16);
 
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<A: Step + Clone> DoubleEndedIterator for ops::Range<A> where