Rollup merge of #73887 - DutchGhost:master, r=oli-obk

stabilize const mem::forget

Stabilizes const `mem::forget` as implemented in https://github.com/rust-lang/rust/pull/69617 and tracked in https://github.com/rust-lang/rust/issues/69616.

Closes https://github.com/rust-lang/rust/issues/69616
This commit is contained in:
Manish Goregaokar 2020-07-10 23:26:28 -07:00 committed by GitHub
commit efda2b58b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 4 deletions

View File

@ -142,7 +142,7 @@
/// [ub]: ../../reference/behavior-considered-undefined.html
/// [`ManuallyDrop`]: struct.ManuallyDrop.html
#[inline]
#[rustc_const_unstable(feature = "const_forget", issue = "69616")]
#[rustc_const_stable(feature = "const_forget", since = "1.46.0")]
#[stable(feature = "rust1", since = "1.0.0")]
pub const fn forget<T>(t: T) {
ManuallyDrop::new(t);

View File

@ -40,7 +40,6 @@
#![feature(const_raw_ptr_deref)]
#![feature(never_type)]
#![feature(unwrap_infallible)]
#![feature(const_forget)]
#![feature(option_unwrap_none)]
#![feature(peekable_next_if)]
#![feature(partition_point)]

View File

@ -1,7 +1,5 @@
// check-pass
#![feature(const_forget)]
use std::mem::forget;
const _: () = forget(0i32);