about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthew Piziak <matthew.piziak@gmail.com>2016-10-09 06:35:07 -0400
committerMatthew Piziak <matthew.piziak@gmail.com>2016-10-09 06:35:07 -0400
commitdc607deac7293e9fa767248fa2613f65a8c6a849 (patch)
treed919d55770946f20e9250a57382f4ef52647ff55
parent19fd7fcce90fe41edd4a25f1f9d3cd90d7e285bb (diff)
downloadrust-dc607deac7293e9fa767248fa2613f65a8c6a849.tar.gz
rust-dc607deac7293e9fa767248fa2613f65a8c6a849.zip
use UFCS with Add::add and Sub::sub instead of unstable attributes
-rw-r--r--src/libcore/iter/range.rs18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/libcore/iter/range.rs b/src/libcore/iter/range.rs
index a9487b7f46d..6cfec06b0ba 100644
--- a/src/libcore/iter/range.rs
+++ b/src/libcore/iter/range.rs
@@ -95,15 +95,13 @@ macro_rules! step_impl_unsigned {
             }
 
             #[inline]
-            #[rustc_inherit_overflow_checks]
             fn add_one(&self) -> Self {
-                *self + 1
+                Add::add(*self, 1);
             }
 
             #[inline]
-            #[rustc_inherit_overflow_checks]
             fn sub_one(&self) -> Self {
-                *self - 1
+                Sub::sub(*self, 1);
             }
 
             #[inline]
@@ -168,15 +166,13 @@ macro_rules! step_impl_signed {
             }
 
             #[inline]
-            #[rustc_inherit_overflow_checks]
             fn add_one(&self) -> Self {
-                *self + 1
+                Add::add(*self, 1);
             }
 
             #[inline]
-            #[rustc_inherit_overflow_checks]
             fn sub_one(&self) -> Self {
-                *self - 1
+                Sub::sub(*self, 1);
             }
 
             #[inline]
@@ -219,15 +215,13 @@ macro_rules! step_impl_no_between {
             }
 
             #[inline]
-            #[rustc_inherit_overflow_checks]
             fn add_one(&self) -> Self {
-                *self + 1
+                Add::add(*self, 1);
             }
 
             #[inline]
-            #[rustc_inherit_overflow_checks]
             fn sub_one(&self) -> Self {
-                *self - 1
+                Sub::sub(*self, 1);
             }
 
             #[inline]