1
Fork 0

Change write_bytes test causing UB to no_run

This also fixes improper text wrapping.
This commit is contained in:
Dylan MacKenzie 2018-04-07 15:51:25 -07:00
parent 8b8091d370
commit ee259e4dd3

View file

@ -992,11 +992,11 @@ extern "rust-intrinsic" {
/// ///
/// * The two regions of memory must *not* overlap. /// * The two regions of memory must *not* overlap.
/// ///
/// Additionally, if `T` is not [`Copy`](../marker/trait.Copy), only the region at `src` *or* the /// Additionally, if `T` is not [`Copy`](../marker/trait.Copy), only the
/// region at `dst` can be used or dropped after calling /// region at `src` *or* the region at `dst` can be used or dropped after
/// `copy_nonoverlapping`. `copy_nonoverlapping` creates bitwise copies of /// calling `copy_nonoverlapping`. `copy_nonoverlapping` creates bitwise
/// `T`, regardless of whether `T: Copy`, which can result in undefined /// copies of `T`, regardless of whether `T: Copy`, which can result in
/// behavior if both copies are used. /// undefined behavior if both copies are used.
/// ///
/// [Undefined Behavior]: ../../reference/behavior-considered-undefined.html /// [Undefined Behavior]: ../../reference/behavior-considered-undefined.html
/// ///
@ -1149,7 +1149,7 @@ extern "rust-intrinsic" {
/// ///
/// Creating an invalid value: /// Creating an invalid value:
/// ///
/// ```ignore /// ```no_run
/// use std::{mem, ptr}; /// use std::{mem, ptr};
/// ///
/// let mut v = Box::new(0i32); /// let mut v = Box::new(0i32);
@ -1161,6 +1161,7 @@ extern "rust-intrinsic" {
/// } /// }
/// ///
/// // At this point, using or dropping `v` results in undefined behavior. /// // At this point, using or dropping `v` results in undefined behavior.
/// // v = Box::new(0i32); // ERROR
/// ``` /// ```
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
pub fn write_bytes<T>(dst: *mut T, val: u8, count: usize); pub fn write_bytes<T>(dst: *mut T, val: u8, count: usize);