@@ -3873,9 +3873,11 @@ unsafe impl<'a, T> TrustedRandomAccess for ExactChunksMut<'a, T> {
3873
3873
/// valid for `len` elements, nor whether the lifetime inferred is a suitable
3874
3874
/// lifetime for the returned slice.
3875
3875
///
3876
- /// `p` must be non-null and aligned, even for zero-length slices, as is
3877
- /// required for all references. However, for zero-length slices, `p` can be
3878
- /// a bogus non-dereferencable pointer such as [`NonNull::dangling()`].
3876
+ /// `data` must be non-null and aligned, even for zero-length slices. One
3877
+ /// reason for this is that enum layout optimizations may rely on references
3878
+ /// (including slices of any length) being aligned and non-null to distinguish
3879
+ /// them from other data. You can obtain a pointer that is usable as `data`
3880
+ /// for zero-length slices using [`NonNull::dangling()`].
3879
3881
///
3880
3882
/// # Caveat
3881
3883
///
@@ -3910,8 +3912,8 @@ pub unsafe fn from_raw_parts<'a, T>(data: *const T, len: usize) -> &'a [T] {
3910
3912
///
3911
3913
/// This function is unsafe for the same reasons as `from_raw_parts`, as well
3912
3914
/// as not being able to provide a non-aliasing guarantee of the returned
3913
- /// mutable slice. `p ` must be non-null and aligned even for zero-length slices as with
3914
- /// `from_raw_parts`.
3915
+ /// mutable slice. `data ` must be non-null and aligned even for zero-length
3916
+ /// slices as with `from_raw_parts`.
3915
3917
#[ inline]
3916
3918
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
3917
3919
pub unsafe fn from_raw_parts_mut < ' a , T > ( data : * mut T , len : usize ) -> & ' a mut [ T ] {
0 commit comments