about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDylan MacKenzie <ecstaticmorse@gmail.com>2018-04-07 15:51:25 -0700
committerDylan MacKenzie <ecstaticmorse@gmail.com>2018-04-07 15:51:25 -0700
commitee259e4dd340f9532511b7249e4eb961f111b63f (patch)
tree040b6275aad0ff8f42884d6cf80b21c5e6f9abca
parent8b8091d370fa31844d6ed55f4ccdd32e5dbd20f9 (diff)
downloadrust-ee259e4dd340f9532511b7249e4eb961f111b63f.tar.gz
rust-ee259e4dd340f9532511b7249e4eb961f111b63f.zip
Change `write_bytes` test causing UB to `no_run`
This also fixes improper text wrapping.
-rw-r--r--src/libcore/intrinsics.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs
index d6bd2b86855..8e3180cd2a6 100644
--- a/src/libcore/intrinsics.rs
+++ b/src/libcore/intrinsics.rs
@@ -992,11 +992,11 @@ extern "rust-intrinsic" {
     ///
     /// * The two regions of memory must *not* overlap.
     ///
-    /// Additionally, if `T` is not [`Copy`](../marker/trait.Copy), only the region at `src` *or* the
-    /// region at `dst` can be used or dropped after calling
-    /// `copy_nonoverlapping`. `copy_nonoverlapping` creates bitwise copies of
-    /// `T`, regardless of whether `T: Copy`, which can result in undefined
-    /// behavior if both copies are used.
+    /// Additionally, if `T` is not [`Copy`](../marker/trait.Copy), only the
+    /// region at `src` *or* the region at `dst` can be used or dropped after
+    /// calling `copy_nonoverlapping`.  `copy_nonoverlapping` creates bitwise
+    /// copies of `T`, regardless of whether `T: Copy`, which can result in
+    /// undefined behavior if both copies are used.
     ///
     /// [Undefined Behavior]: ../../reference/behavior-considered-undefined.html
     ///
@@ -1149,7 +1149,7 @@ extern "rust-intrinsic" {
     ///
     /// Creating an invalid value:
     ///
-    /// ```ignore
+    /// ```no_run
     /// use std::{mem, ptr};
     ///
     /// let mut v = Box::new(0i32);
@@ -1161,6 +1161,7 @@ extern "rust-intrinsic" {
     /// }
     ///
     /// // At this point, using or dropping `v` results in undefined behavior.
+    /// // v = Box::new(0i32); // ERROR
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn write_bytes<T>(dst: *mut T, val: u8, count: usize);