#![stable(feature = "rust1", since = "1.0.0")]
-use clone::Clone;
use intrinsics;
use ops::{CoerceUnsized, Deref};
use fmt;
use hash;
-use option::Option::{self, Some, None};
-use marker::{Copy, PhantomData, Send, Sized, Sync, Unsize};
+use marker::{PhantomData, Unsize};
use mem;
use nonzero::NonZero;
-use cmp::{PartialEq, Eq, Ord, PartialOrd};
use cmp::Ordering::{self, Less, Equal, Greater};
// FIXME #19649: intrinsic docs don't render, so these have no docs :(
tmp
}
-#[allow(missing_docs)]
-#[inline(always)]
-#[unstable(feature = "filling_drop",
- reason = "may play a larger role in std::ptr future extensions",
- issue = "5016")]
-pub unsafe fn read_and_drop<T>(dest: *mut T) -> T {
- // Copy the data out from `dest`:
- let tmp = read(&*dest);
-
- // Now mark `dest` as dropped:
- write_bytes(dest, mem::POST_DROP_U8, 1);
-
- tmp
-}
-
/// Overwrites a memory location with the given value without reading or
/// dropping the old value.
///