add tracking issue
This commit is contained in:
@@ -20,14 +20,14 @@ mod iter;
|
|||||||
pub use iter::IntoIter;
|
pub use iter::IntoIter;
|
||||||
|
|
||||||
/// Converts a reference to `T` into a reference to an array of length 1 (without copying).
|
/// Converts a reference to `T` into a reference to an array of length 1 (without copying).
|
||||||
#[unstable(feature = "array_from_ref", issue = "none")]
|
#[unstable(feature = "array_from_ref", issue = "77101")]
|
||||||
pub fn from_ref<T>(s: &T) -> &[T; 1] {
|
pub fn from_ref<T>(s: &T) -> &[T; 1] {
|
||||||
// SAFETY: Converting `&T` to `&[T; 1]` is sound.
|
// SAFETY: Converting `&T` to `&[T; 1]` is sound.
|
||||||
unsafe { &*(s as *const T).cast::<[T; 1]>() }
|
unsafe { &*(s as *const T).cast::<[T; 1]>() }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Converts a mutable reference to `T` into a mutable reference to an array of length 1 (without copying).
|
/// Converts a mutable reference to `T` into a mutable reference to an array of length 1 (without copying).
|
||||||
#[unstable(feature = "array_from_ref", issue = "none")]
|
#[unstable(feature = "array_from_ref", issue = "77101")]
|
||||||
pub fn from_mut<T>(s: &mut T) -> &mut [T; 1] {
|
pub fn from_mut<T>(s: &mut T) -> &mut [T; 1] {
|
||||||
// SAFETY: Converting `&mut T` to `&mut [T; 1]` is sound.
|
// SAFETY: Converting `&mut T` to `&mut [T; 1]` is sound.
|
||||||
unsafe { &mut *(s as *mut T).cast::<[T; 1]>() }
|
unsafe { &mut *(s as *mut T).cast::<[T; 1]>() }
|
||||||
|
|||||||
Reference in New Issue
Block a user