1
Fork 0

Fix Safety docs for from_raw_parts_mut

This commit is contained in:
aticu 2020-07-17 19:47:25 +02:00
parent 3014f23ddd
commit 4127ed1732

View file

@ -6095,7 +6095,7 @@ pub unsafe fn from_raw_parts<'a, T>(data: *const T, len: usize) -> &'a [T] {
/// ///
/// Behavior is undefined if any of the following conditions are violated: /// Behavior is undefined if any of the following conditions are violated:
/// ///
/// * `data` must be [valid] for writes for `len * mem::size_of::<T>()` many bytes, /// * `data` must be [valid] for boths reads and writes for `len * mem::size_of::<T>()` many bytes,
/// and it must be properly aligned. This means in particular: /// and it must be properly aligned. This means in particular:
/// ///
/// * The entire memory range of this slice must be contained within a single allocated object! /// * The entire memory range of this slice must be contained within a single allocated object!