We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
slice::from_ptr_range[_mut]
1 parent 47b2eee commit bc1216eCopy full SHA for bc1216e
library/core/src/slice/raw.rs
@@ -188,6 +188,10 @@ pub const fn from_mut<T>(s: &mut T) -> &mut [T] {
188
///
189
/// Note that a range created from [`slice::as_ptr_range`] fulfills these requirements.
190
191
+/// # Panics
192
+///
193
+/// This function panics if `T` is a Zero-Sized Type (“ZST”).
194
195
/// # Caveat
196
197
/// 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] {
247
251
248
252
/// Note that a range created from [`slice::as_mut_ptr_range`] fulfills these requirements.
249
253
254
255
256
257
250
258
/// # Examples
259
260
/// ```
0 commit comments