Skip to content

Commit

Permalink
FIX: Remove unused Copy/Clone for MaybeUninit
Browse files Browse the repository at this point in the history
  • Loading branch information
bluss committed Dec 22, 2018
1 parent 85d9a06 commit 06930d2
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/maybe_uninit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +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 {
Expand Down

0 comments on commit 06930d2

Please sign in to comment.