diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs index 13c0b89f5df..dd3775bff5e 100644 --- a/src/libcore/mem.rs +++ b/src/libcore/mem.rs @@ -483,6 +483,7 @@ pub fn align_of_val(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() -> bool { intrinsics::needs_drop::() diff --git a/src/test/run-pass/const-needs_drop.rs b/src/test/run-pass/const-needs_drop.rs index 2e381593b77..edf3a6b3dcd 100644 --- a/src/test/run-pass/const-needs_drop.rs +++ b/src/test/run-pass/const-needs_drop.rs @@ -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);