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:
commit
efda2b58b0
@ -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);
|
||||
|
@ -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)]
|
||||
|
@ -1,7 +1,5 @@
|
||||
// check-pass
|
||||
|
||||
#![feature(const_forget)]
|
||||
|
||||
use std::mem::forget;
|
||||
|
||||
const _: () = forget(0i32);
|
||||
|
Loading…
Reference in New Issue
Block a user