std: Stabilize slice::from_raw_parts
These new APIs have had some time to bake now, and no pressing issues have come up so they should be ok for stabilizing. Specifically, these two APIs were stabilized: * `slice::from_raw_parts` * `slice::from_raw_parts_mut`
This commit is contained in:
parent
698c1008d6
commit
0ad874111e
@ -1446,7 +1446,7 @@ pub fn mut_ref_slice<'a, A>(s: &'a mut A) -> &'a mut [A] {
|
||||
/// }
|
||||
/// ```
|
||||
#[inline]
|
||||
#[unstable(feature = "core")]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub unsafe fn from_raw_parts<'a, T>(p: *const T, len: usize) -> &'a [T] {
|
||||
transmute(RawSlice { data: p, len: len })
|
||||
}
|
||||
@ -1458,7 +1458,7 @@ pub unsafe fn from_raw_parts<'a, T>(p: *const T, len: usize) -> &'a [T] {
|
||||
/// as not being able to provide a non-aliasing guarantee of the returned
|
||||
/// mutable slice.
|
||||
#[inline]
|
||||
#[unstable(feature = "core")]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub unsafe fn from_raw_parts_mut<'a, T>(p: *mut T, len: usize) -> &'a mut [T] {
|
||||
transmute(RawSlice { data: p, len: len })
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user