FEAT: Update nodrop for stable needs_drop

This commit is contained in:
bluss
2017-10-16 22:13:53 +02:00
parent f9a9158185
commit 545ae6e609
3 changed files with 53 additions and 5 deletions
+2 -5
View File
@@ -3,11 +3,10 @@
//!
//! - `std`
//! - Optional, enabled by default
//! - Requires Rust 1.6 *to disable*
//! - Use libstd
//! - `use_needs_drop`
//! - Optional
//! - Requires nightly channel.
//! - Requires Rust 1.21
//! - Use `needs_drop` to skip overwriting if not necessary
//! - `use_union`
//! - Optional
@@ -16,8 +15,6 @@
//! for example the fact that `NoDrop<T>` never has a destructor anymore.
//!
#![cfg_attr(feature="use_needs_drop", feature(core_intrinsics))]
#![cfg_attr(not(any(test, feature="std")), no_std)]
#[cfg(not(any(test, feature="std")))]
extern crate core as std;
@@ -81,7 +78,7 @@ mod imp {
#[inline]
fn needs_drop<T>() -> bool {
unsafe {
::std::intrinsics::needs_drop::<T>()
::std::mem::needs_drop::<T>()
}
}