Gate const core::mem::needs_drop behind const_needs_drop

This commit is contained in:
Michael Bradshaw 2018-09-26 14:46:14 -07:00
parent c0769545b0
commit 2c3c8822e0
2 changed files with 3 additions and 0 deletions

View File

@ -483,6 +483,7 @@ pub fn align_of_val<T: ?Sized>(val: &T) -> usize {
/// ```
#[inline]
#[stable(feature = "needs_drop", since = "1.21.0")]
#[rustc_const_unstable(feature = "const_needs_drop")]
#[cfg(not(stage0))]
pub const fn needs_drop<T>() -> bool {
intrinsics::needs_drop::<T>()

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(const_needs_drop)]
use std::mem;
struct Trivial(u8, f32);