diff --git a/nodrop/Cargo.toml b/nodrop/Cargo.toml index fe9890a..a7c0145 100644 --- a/nodrop/Cargo.toml +++ b/nodrop/Cargo.toml @@ -18,10 +18,6 @@ default = ["std"] # Use libstd std = ["odds/std"] -# Optional, nightly channel -# Use no drop flag. See API doc for more info. -no_drop_flag = [] - # Optional, nightly channel # Use `needs_drop` to skip overwriting if not necessary use_needs_drop = [] diff --git a/nodrop/src/lib.rs b/nodrop/src/lib.rs index 6627b3d..e9ea1e3 100644 --- a/nodrop/src/lib.rs +++ b/nodrop/src/lib.rs @@ -9,16 +9,8 @@ //! - Optional //! - Requires nightly channel. //! - Use `needs_drop` to skip overwriting if not necessary -//! - `no_drop_flag`. -//! - Optional. -//! - Requires nightly channel. -//! - Use no drop flag on the **NoDrop** type, -//! which means less space overhead. Use with care and report a bug if anything -//! changes behavior with this feature. -//! //! -#![cfg_attr(feature="no_drop_flag", feature(unsafe_no_drop_flag))] #![cfg_attr(feature="use_needs_drop", feature(core_intrinsics))] #![cfg_attr(not(any(test, feature="std")), no_std)] @@ -41,7 +33,6 @@ enum Flag { } /// A type holding **T** that will not call its destructor on drop -#[cfg_attr(feature="no_drop_flag", unsafe_no_drop_flag)] pub struct NoDrop(Flag); impl NoDrop { @@ -82,7 +73,6 @@ fn needs_drop() -> bool { impl Drop for NoDrop { fn drop(&mut self) { if needs_drop::() { - // no drop flag info: writing repeatedly is idempotent // inhibit drop unsafe { ptr::write(&mut self.0, Flag::Dropped);