From dc607deac7293e9fa767248fa2613f65a8c6a849 Mon Sep 17 00:00:00 2001 From: Matthew Piziak Date: Sun, 9 Oct 2016 06:35:07 -0400 Subject: [PATCH] use UFCS with Add::add and Sub::sub instead of unstable attributes --- src/libcore/iter/range.rs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/libcore/iter/range.rs b/src/libcore/iter/range.rs index a9487b7f46db..6cfec06b0baa 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]