mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
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:
commit
e725c04e62
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user