Rollup merge of #69617 - DutchGhost:master, r=LukasKalbertodt

constify mem::forget

implements https://github.com/rust-lang/rust/issues/69616
This commit is contained in:
Dylan DPC 2020-03-02 13:42:38 +01:00 committed by GitHub
commit e725c04e62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,8 +109,9 @@ pub use crate::intrinsics::transmute;
/// [ub]: ../../reference/behavior-considered-undefined.html
/// [`ManuallyDrop`]: struct.ManuallyDrop.html
#[inline]
#[rustc_const_unstable(feature = "const_forget", issue = "69616")]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn forget<T>(t: T) {
pub const fn forget<T>(t: T) {
ManuallyDrop::new(t);
}