Skip to content

Commit efda2b5

Browse files
authored
Rollup merge of #73887 - DutchGhost:master, r=oli-obk
stabilize const mem::forget Stabilizes const `mem::forget` as implemented in #69617 and tracked in #69616. Closes #69616
2 parents f4f9690 + a065096 commit efda2b5

File tree

3 files changed

+1
-4
lines changed

3 files changed

+1
-4
lines changed

src/libcore/mem/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ pub use crate::intrinsics::transmute;
142142
/// [ub]: ../../reference/behavior-considered-undefined.html
143143
/// [`ManuallyDrop`]: struct.ManuallyDrop.html
144144
#[inline]
145-
#[rustc_const_unstable(feature = "const_forget", issue = "69616")]
145+
#[rustc_const_stable(feature = "const_forget", since = "1.46.0")]
146146
#[stable(feature = "rust1", since = "1.0.0")]
147147
pub const fn forget<T>(t: T) {
148148
ManuallyDrop::new(t);

src/libcore/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
#![feature(const_raw_ptr_deref)]
4141
#![feature(never_type)]
4242
#![feature(unwrap_infallible)]
43-
#![feature(const_forget)]
4443
#![feature(option_unwrap_none)]
4544
#![feature(peekable_next_if)]
4645
#![feature(partition_point)]

src/test/ui/consts/const_forget.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// check-pass
22

3-
#![feature(const_forget)]
4-
53
use std::mem::forget;
64

75
const _: () = forget(0i32);

0 commit comments

Comments
 (0)