FIX: Remove unused Copy/Clone for MaybeUninit
This commit is contained in:
@@ -6,7 +6,6 @@ use std::mem::ManuallyDrop;
|
|||||||
/// A combination of ManuallyDrop and “maybe uninitialized”;
|
/// A combination of ManuallyDrop and “maybe uninitialized”;
|
||||||
/// this wraps a value that can be wholly or partially uninitialized;
|
/// this wraps a value that can be wholly or partially uninitialized;
|
||||||
/// it also has no drop regardless of the type of T.
|
/// it also has no drop regardless of the type of T.
|
||||||
#[derive(Copy)]
|
|
||||||
#[repr(C)] // for cast from self ptr to value
|
#[repr(C)] // for cast from self ptr to value
|
||||||
pub union MaybeUninit<T> {
|
pub union MaybeUninit<T> {
|
||||||
empty: (),
|
empty: (),
|
||||||
@@ -14,11 +13,6 @@ pub union MaybeUninit<T> {
|
|||||||
}
|
}
|
||||||
// Why we don't use std's MaybeUninit on nightly? See the ptr method
|
// 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> {
|
impl<T> MaybeUninit<T> {
|
||||||
/// Create a new MaybeUninit with uninitialized interior
|
/// Create a new MaybeUninit with uninitialized interior
|
||||||
pub unsafe fn uninitialized() -> Self {
|
pub unsafe fn uninitialized() -> Self {
|
||||||
|
|||||||
Reference in New Issue
Block a user