aboutsummaryrefslogtreecommitdiff
path: root/libcore/ops.rs
diff options
context:
space:
mode:
Diffstat (limited to 'libcore/ops.rs')
-rw-r--r--libcore/ops.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/libcore/ops.rs b/libcore/ops.rs
index 35374db..3f9d3ac 100644
--- a/libcore/ops.rs
+++ b/libcore/ops.rs
@@ -208,6 +208,7 @@ macro_rules! add_impl {
type Output = $t;
#[inline]
+ #[rustc_inherit_overflow_checks]
fn add(self, other: $t) -> $t { self + other }
}
@@ -263,6 +264,7 @@ macro_rules! sub_impl {
type Output = $t;
#[inline]
+ #[rustc_inherit_overflow_checks]
fn sub(self, other: $t) -> $t { self - other }
}
@@ -318,6 +320,7 @@ macro_rules! mul_impl {
type Output = $t;
#[inline]
+ #[rustc_inherit_overflow_checks]
fn mul(self, other: $t) -> $t { self * other }
}
@@ -519,6 +522,7 @@ macro_rules! neg_impl_core {
type Output = $t;
#[inline]
+ #[rustc_inherit_overflow_checks]
fn neg(self) -> $t { let $id = self; $body }
}
@@ -798,6 +802,7 @@ macro_rules! shl_impl {
type Output = $t;
#[inline]
+ #[rustc_inherit_overflow_checks]
fn shl(self, other: $f) -> $t {
self << other
}
@@ -869,6 +874,7 @@ macro_rules! shr_impl {
type Output = $t;
#[inline]
+ #[rustc_inherit_overflow_checks]
fn shr(self, other: $f) -> $t {
self >> other
}
@@ -933,6 +939,7 @@ macro_rules! add_assign_impl {
#[stable(feature = "op_assign_traits", since = "1.8.0")]
impl AddAssign for $t {
#[inline]
+ #[rustc_inherit_overflow_checks]
fn add_assign(&mut self, other: $t) { *self += other }
}
)+)
@@ -979,6 +986,7 @@ macro_rules! sub_assign_impl {
#[stable(feature = "op_assign_traits", since = "1.8.0")]
impl SubAssign for $t {
#[inline]
+ #[rustc_inherit_overflow_checks]
fn sub_assign(&mut self, other: $t) { *self -= other }
}
)+)
@@ -1025,6 +1033,7 @@ macro_rules! mul_assign_impl {
#[stable(feature = "op_assign_traits", since = "1.8.0")]
impl MulAssign for $t {
#[inline]
+ #[rustc_inherit_overflow_checks]
fn mul_assign(&mut self, other: $t) { *self *= other }
}
)+)
@@ -1295,6 +1304,7 @@ macro_rules! shl_assign_impl {
#[stable(feature = "op_assign_traits", since = "1.8.0")]
impl ShlAssign<$f> for $t {
#[inline]
+ #[rustc_inherit_overflow_checks]
fn shl_assign(&mut self, other: $f) {
*self <<= other
}
@@ -1357,6 +1367,7 @@ macro_rules! shr_assign_impl {
#[stable(feature = "op_assign_traits", since = "1.8.0")]
impl ShrAssign<$f> for $t {
#[inline]
+ #[rustc_inherit_overflow_checks]
fn shr_assign(&mut self, other: $f) {
*self >>= other
}