Merge branch '0.4' of https://github.com/bluss/arrayvec
* '0.4' of https://github.com/bluss/arrayvec: 0.4.10 FIX: Remove unused Copy/Clone for MaybeUninit FIX: Use repr(C) MaybeUninit after discussion with RalfJung
This commit is contained in:
+1
-6
@@ -6,18 +6,13 @@ use std::mem::ManuallyDrop;
|
||||
/// A combination of ManuallyDrop and “maybe uninitialized”;
|
||||
/// this wraps a value that can be wholly or partially uninitialized;
|
||||
/// it also has no drop regardless of the type of T.
|
||||
#[derive(Copy)]
|
||||
#[repr(C)] // for cast from self ptr to value
|
||||
pub union MaybeUninit<T> {
|
||||
empty: (),
|
||||
value: ManuallyDrop<T>,
|
||||
}
|
||||
// Why we don't use std's MaybeUninit on nightly? See the ptr method
|
||||
|
||||
impl<T> Clone for MaybeUninit<T> where T: Copy
|
||||
{
|
||||
fn clone(&self) -> Self { *self }
|
||||
}
|
||||
|
||||
impl<T> MaybeUninit<T> {
|
||||
/// Create a new MaybeUninit with uninitialized interior
|
||||
pub unsafe fn uninitialized() -> Self {
|
||||
|
||||
Reference in New Issue
Block a user