We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 85d9a06 commit 06930d2Copy full SHA for 06930d2
src/maybe_uninit.rs
@@ -6,19 +6,13 @@ use std::mem::ManuallyDrop;
6
/// A combination of ManuallyDrop and “maybe uninitialized”;
7
/// this wraps a value that can be wholly or partially uninitialized;
8
/// it also has no drop regardless of the type of T.
9
-#[derive(Copy)]
10
#[repr(C)] // for cast from self ptr to value
11
pub union MaybeUninit<T> {
12
empty: (),
13
value: ManuallyDrop<T>,
14
}
15
// Why we don't use std's MaybeUninit on nightly? See the ptr method
16
17
-impl<T> Clone for MaybeUninit<T> where T: Copy
18
-{
19
- fn clone(&self) -> Self { *self }
20
-}
21
-
22
impl<T> MaybeUninit<T> {
23
/// Create a new MaybeUninit with uninitialized interior
24
pub unsafe fn uninitialized() -> Self {
0 commit comments