mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
Document when slice::from_ptr_range[_mut]
panic
This commit is contained in:
parent
47b2eee173
commit
bc1216e046
@ -188,6 +188,10 @@ pub const fn from_mut<T>(s: &mut T) -> &mut [T] {
|
||||
///
|
||||
/// Note that a range created from [`slice::as_ptr_range`] fulfills these requirements.
|
||||
///
|
||||
/// # Panics
|
||||
///
|
||||
/// This function panics if `T` is a Zero-Sized Type (“ZST”).
|
||||
///
|
||||
/// # Caveat
|
||||
///
|
||||
/// The lifetime for the returned slice is inferred from its usage. To
|
||||
@ -247,6 +251,10 @@ pub const unsafe fn from_ptr_range<'a, T>(range: Range<*const T>) -> &'a [T] {
|
||||
///
|
||||
/// Note that a range created from [`slice::as_mut_ptr_range`] fulfills these requirements.
|
||||
///
|
||||
/// # Panics
|
||||
///
|
||||
/// This function panics if `T` is a Zero-Sized Type (“ZST”).
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
|
Loading…
Reference in New Issue
Block a user