]> git.lizzy.rs Git - rust.git/commitdiff
Gate const core::mem::needs_drop behind const_needs_drop
authorMichael Bradshaw <mjbshaw@google.com>
Wed, 26 Sep 2018 21:46:14 +0000 (14:46 -0700)
committerMichael Bradshaw <mjbshaw@google.com>
Wed, 26 Sep 2018 21:46:14 +0000 (14:46 -0700)
src/libcore/mem.rs
src/test/run-pass/const-needs_drop.rs

index 13c0b89f5df96fccbe866344a345525fe73a968e..dd3775bff5edd643c9953c39d6fbc9c14bd72f5f 100644 (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>()
index 2e381593b77e62e42107771c873cde81c130f44a..edf3a6b3dcd9489bb18abb5dd00f5bd8ef557a33 100644 (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);