about summary refs log tree commit diff
path: root/src/libcore/ops
diff options
context:
space:
mode:
authorOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>2017-12-06 09:25:29 +0100
committerOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>2017-12-06 09:25:29 +0100
commitacdf83f2288e1b80259dafeca4a0cee9a42973c3 (patch)
treeef7ffe46fee2f0b9f331a206af4a71d23fabe0a1 /src/libcore/ops
parentd4c442d65c150b99d18202a5cce4a2cbdbd4dc83 (diff)
downloadrust-acdf83f2288e1b80259dafeca4a0cee9a42973c3.tar.gz
rust-acdf83f2288e1b80259dafeca4a0cee9a42973c3.zip
Update miri to rustc changes
Diffstat (limited to 'src/libcore/ops')
-rw-r--r--src/libcore/ops/arith.rs10
-rw-r--r--src/libcore/ops/bit.rs10
-rw-r--r--src/libcore/ops/deref.rs8
-rw-r--r--src/libcore/ops/generator.rs4
-rw-r--r--src/libcore/ops/mod.rs2
-rw-r--r--src/libcore/ops/try.rs31
-rw-r--r--src/libcore/ops/unsize.rs2
7 files changed, 41 insertions, 26 deletions
diff --git a/src/libcore/ops/arith.rs b/src/libcore/ops/arith.rs
index 62007caedd3..8b3d662a6db 100644
--- a/src/libcore/ops/arith.rs
+++ b/src/libcore/ops/arith.rs
@@ -662,6 +662,8 @@ macro_rules! add_assign_impl {
             #[rustc_inherit_overflow_checks]
             fn add_assign(&mut self, other: $t) { *self += other }
         }
+
+        forward_ref_op_assign! { impl AddAssign, add_assign for $t, $t }
     )+)
 }
 
@@ -713,6 +715,8 @@ macro_rules! sub_assign_impl {
             #[rustc_inherit_overflow_checks]
             fn sub_assign(&mut self, other: $t) { *self -= other }
         }
+
+        forward_ref_op_assign! { impl SubAssign, sub_assign for $t, $t }
     )+)
 }
 
@@ -755,6 +759,8 @@ macro_rules! mul_assign_impl {
             #[rustc_inherit_overflow_checks]
             fn mul_assign(&mut self, other: $t) { *self *= other }
         }
+
+        forward_ref_op_assign! { impl MulAssign, mul_assign for $t, $t }
     )+)
 }
 
@@ -796,6 +802,8 @@ macro_rules! div_assign_impl {
             #[inline]
             fn div_assign(&mut self, other: $t) { *self /= other }
         }
+
+        forward_ref_op_assign! { impl DivAssign, div_assign for $t, $t }
     )+)
 }
 
@@ -841,6 +849,8 @@ macro_rules! rem_assign_impl {
             #[inline]
             fn rem_assign(&mut self, other: $t) { *self %= other }
         }
+
+        forward_ref_op_assign! { impl RemAssign, rem_assign for $t, $t }
     )+)
 }
 
diff --git a/src/libcore/ops/bit.rs b/src/libcore/ops/bit.rs
index 0bc5e554cb3..7ac5fc4debf 100644
--- a/src/libcore/ops/bit.rs
+++ b/src/libcore/ops/bit.rs
@@ -593,6 +593,8 @@ macro_rules! bitand_assign_impl {
             #[inline]
             fn bitand_assign(&mut self, other: $t) { *self &= other }
         }
+
+        forward_ref_op_assign! { impl BitAndAssign, bitand_assign for $t, $t }
     )+)
 }
 
@@ -638,6 +640,8 @@ macro_rules! bitor_assign_impl {
             #[inline]
             fn bitor_assign(&mut self, other: $t) { *self |= other }
         }
+
+        forward_ref_op_assign! { impl BitOrAssign, bitor_assign for $t, $t }
     )+)
 }
 
@@ -683,6 +687,8 @@ macro_rules! bitxor_assign_impl {
             #[inline]
             fn bitxor_assign(&mut self, other: $t) { *self ^= other }
         }
+
+        forward_ref_op_assign! { impl BitXorAssign, bitxor_assign for $t, $t }
     )+)
 }
 
@@ -729,6 +735,8 @@ macro_rules! shl_assign_impl {
                 *self <<= other
             }
         }
+
+        forward_ref_op_assign! { impl ShlAssign, shl_assign for $t, $f }
     )
 }
 
@@ -793,6 +801,8 @@ macro_rules! shr_assign_impl {
                 *self >>= other
             }
         }
+
+        forward_ref_op_assign! { impl ShrAssign, shr_assign for $t, $f }
     )
 }
 
diff --git a/src/libcore/ops/deref.rs b/src/libcore/ops/deref.rs
index ea8dd820878..80c48c7b28e 100644
--- a/src/libcore/ops/deref.rs
+++ b/src/libcore/ops/deref.rs
@@ -18,7 +18,7 @@
 /// Implementing `Deref` for smart pointers makes accessing the data behind them
 /// convenient, which is why they implement `Deref`. On the other hand, the
 /// rules regarding `Deref` and [`DerefMut`] were designed specifically to
-/// accomodate smart pointers. Because of this, **`Deref` should only be
+/// accommodate smart pointers. Because of this, **`Deref` should only be
 /// implemented for smart pointers** to avoid confusion.
 ///
 /// For similar reasons, **this trait should never fail**. Failure during
@@ -40,7 +40,7 @@
 /// [book]: ../../book/second-edition/ch15-02-deref.html
 /// [`DerefMut`]: trait.DerefMut.html
 /// [more]: #more-on-deref-coercion
-/// [ref-deref-op]: ../../reference/expressions.html#the-dereference-operator
+/// [ref-deref-op]: ../../reference/expressions/operator-expr.html#the-dereference-operator
 /// [ref-deref-trait]: ../../reference/the-deref-trait.html
 /// [type coercions]: ../../reference/type-coercions.html
 ///
@@ -103,7 +103,7 @@ impl<'a, T: ?Sized> Deref for &'a mut T {
 /// Implementing `DerefMut` for smart pointers makes mutating the data behind
 /// them convenient, which is why they implement `DerefMut`. On the other hand,
 /// the rules regarding [`Deref`] and `DerefMut` were designed specifically to
-/// accomodate smart pointers. Because of this, **`DerefMut` should only be
+/// accommodate smart pointers. Because of this, **`DerefMut` should only be
 /// implemented for smart pointers** to avoid confusion.
 ///
 /// For similar reasons, **this trait should never fail**. Failure during
@@ -127,7 +127,7 @@ impl<'a, T: ?Sized> Deref for &'a mut T {
 /// [book]: ../../book/second-edition/ch15-02-deref.html
 /// [`Deref`]: trait.Deref.html
 /// [more]: #more-on-deref-coercion
-/// [ref-deref-op]: ../../reference/expressions.html#the-dereference-operator
+/// [ref-deref-op]: ../../reference/expressions/operator-expr.html#the-dereference-operator
 /// [ref-deref-trait]: ../../reference/the-deref-trait.html
 /// [type coercions]: ../../reference/type-coercions.html
 ///
diff --git a/src/libcore/ops/generator.rs b/src/libcore/ops/generator.rs
index 798c182bc6e..dc7669d195c 100644
--- a/src/libcore/ops/generator.rs
+++ b/src/libcore/ops/generator.rs
@@ -14,7 +14,7 @@
 /// possible return values of a generator. Currently this corresponds to either
 /// a suspension point (`Yielded`) or a termination point (`Complete`).
 #[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
-#[cfg_attr(not(stage0), lang = "generator_state")]
+#[lang = "generator_state"]
 #[unstable(feature = "generator_trait", issue = "43122")]
 pub enum GeneratorState<Y, R> {
     /// The generator suspended with a value.
@@ -70,7 +70,7 @@ pub enum GeneratorState<Y, R> {
 /// More documentation of generators can be found in the unstable book.
 ///
 /// [RFC 2033]: https://github.com/rust-lang/rfcs/pull/2033
-#[cfg_attr(not(stage0), lang = "generator")]
+#[lang = "generator"]
 #[unstable(feature = "generator_trait", issue = "43122")]
 #[fundamental]
 pub trait Generator {
diff --git a/src/libcore/ops/mod.rs b/src/libcore/ops/mod.rs
index 8975b680ca7..70ef4487334 100644
--- a/src/libcore/ops/mod.rs
+++ b/src/libcore/ops/mod.rs
@@ -150,7 +150,7 @@
 //! [`Sub`]: trait.Sub.html
 //! [`Mul`]: trait.Mul.html
 //! [`clone`]: ../clone/trait.Clone.html#tymethod.clone
-//! [operator precedence]: ../../reference/expressions.html#operator-precedence
+//! [operator precedence]: ../../reference/expressions.html#expression-precedence
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
diff --git a/src/libcore/ops/try.rs b/src/libcore/ops/try.rs
index e788b66a1ec..81e5cb5c350 100644
--- a/src/libcore/ops/try.rs
+++ b/src/libcore/ops/try.rs
@@ -15,24 +15,19 @@
 /// extracting those success or failure values from an existing instance and
 /// creating a new instance from a success or failure value.
 #[unstable(feature = "try_trait", issue = "42327")]
-#[cfg_attr(stage0,
-           rustc_on_unimplemented = "the `?` operator can only be used in a \
-                                     function that returns `Result` \
-                                     (or another type that implements `{Try}`)")]
-#[cfg_attr(not(stage0),
-           rustc_on_unimplemented(
-               on(all(
-                   any(from_method="from_error", from_method="from_ok"),
-                   from_desugaring="?"),
-                  message="the `?` operator can only be used in a \
-                           function that returns `Result` \
-                           (or another type that implements `{Try}`)",
-                  label="cannot use the `?` operator in a function that returns `{Self}`"),
-               on(all(from_method="into_result", from_desugaring="?"),
-                  message="the `?` operator can only be applied to values \
-                           that implement `{Try}`",
-                  label="the `?` operator cannot be applied to type `{Self}`")
-))]
+#[rustc_on_unimplemented(
+   on(all(
+       any(from_method="from_error", from_method="from_ok"),
+       from_desugaring="?"),
+      message="the `?` operator can only be used in a \
+               function that returns `Result` \
+               (or another type that implements `{Try}`)",
+      label="cannot use the `?` operator in a function that returns `{Self}`"),
+   on(all(from_method="into_result", from_desugaring="?"),
+      message="the `?` operator can only be applied to values \
+               that implement `{Try}`",
+      label="the `?` operator cannot be applied to type `{Self}`")
+)]
 pub trait Try {
     /// The type of this value when viewed as successful.
     #[unstable(feature = "try_trait", issue = "42327")]
diff --git a/src/libcore/ops/unsize.rs b/src/libcore/ops/unsize.rs
index 58da290cfb6..cd896859b16 100644
--- a/src/libcore/ops/unsize.rs
+++ b/src/libcore/ops/unsize.rs
@@ -42,7 +42,7 @@ use marker::Unsize;
 /// [unsize]: ../marker/trait.Unsize.html
 /// [nomicon-coerce]: ../../nomicon/coercions.html
 #[unstable(feature = "coerce_unsized", issue = "27732")]
-#[lang="coerce_unsized"]
+#[lang = "coerce_unsized"]
 pub trait CoerceUnsized<T> {
     // Empty.
 }