Skip to content

Commit 2c3c882

Browse files
committed
Gate const core::mem::needs_drop behind const_needs_drop
1 parent c076954 commit 2c3c882

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/libcore/mem.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ pub fn align_of_val<T: ?Sized>(val: &T) -> usize {
483483
/// ```
484484
#[inline]
485485
#[stable(feature = "needs_drop", since = "1.21.0")]
486+
#[rustc_const_unstable(feature = "const_needs_drop")]
486487
#[cfg(not(stage0))]
487488
pub const fn needs_drop<T>() -> bool {
488489
intrinsics::needs_drop::<T>()

src/test/run-pass/const-needs_drop.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![feature(const_needs_drop)]
12+
1113
use std::mem;
1214

1315
struct Trivial(u8, f32);

0 commit comments

Comments
 (0)