about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorMatthew Piziak <matthew.piziak@gmail.com>2016-09-09 12:21:01 -0400
committerMatthew Piziak <matthew.piziak@gmail.com>2016-09-09 12:21:01 -0400
commitf6c4fcf12850602588d3c2dacffbf4b01308cb04 (patch)
treeaeceebca8f0acbd6c95a60e47151986b70c6ab44 /src/libcore
parentf1f40f850e2546c2c187514e3d61d17544ba433f (diff)
downloadrust-f6c4fcf12850602588d3c2dacffbf4b01308cb04.tar.gz
rust-f6c4fcf12850602588d3c2dacffbf4b01308cb04.zip
fix silent overflows on `Step` impls
r? @eddyb
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/iter/range.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libcore/iter/range.rs b/src/libcore/iter/range.rs
index 66d05d81d80..a9487b7f46d 100644
--- a/src/libcore/iter/range.rs
+++ b/src/libcore/iter/range.rs
@@ -95,11 +95,13 @@ macro_rules! step_impl_unsigned {
             }
 
             #[inline]
+            #[rustc_inherit_overflow_checks]
             fn add_one(&self) -> Self {
                 *self + 1
             }
 
             #[inline]
+            #[rustc_inherit_overflow_checks]
             fn sub_one(&self) -> Self {
                 *self - 1
             }
@@ -166,11 +168,13 @@ macro_rules! step_impl_signed {
             }
 
             #[inline]
+            #[rustc_inherit_overflow_checks]
             fn add_one(&self) -> Self {
                 *self + 1
             }
 
             #[inline]
+            #[rustc_inherit_overflow_checks]
             fn sub_one(&self) -> Self {
                 *self - 1
             }
@@ -215,11 +219,13 @@ macro_rules! step_impl_no_between {
             }
 
             #[inline]
+            #[rustc_inherit_overflow_checks]
             fn add_one(&self) -> Self {
                 *self + 1
             }
 
             #[inline]
+            #[rustc_inherit_overflow_checks]
             fn sub_one(&self) -> Self {
                 *self - 1
             }