Skip to content

Commit 07d86b4

Browse files
committed
auto merge of #16509 : luqmana/rust/uw, r=alexcrichton
Fixes #15401.
2 parents 711d710 + 715abbd commit 07d86b4

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/libcore/mem.rs

+10-11
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ use ptr;
1919

2020
pub use intrinsics::transmute;
2121

22+
/// Moves a thing into the void.
23+
///
24+
/// The forget function will take ownership of the provided value but neglect
25+
/// to run any required cleanup or memory management operations on it.
26+
///
27+
/// This function is the unsafe version of the `drop` function because it does
28+
/// not run any destructors.
29+
#[stable]
30+
pub use intrinsics::forget;
31+
2232
/// Returns the size of a type in bytes.
2333
#[inline]
2434
#[stable]
@@ -337,17 +347,6 @@ pub fn replace<T>(dest: &mut T, mut src: T) -> T {
337347
#[stable]
338348
pub fn drop<T>(_x: T) { }
339349

340-
/// Moves a thing into the void.
341-
///
342-
/// The forget function will take ownership of the provided value but neglect
343-
/// to run any required cleanup or memory management operations on it.
344-
///
345-
/// This function is the unsafe version of the `drop` function because it does
346-
/// not run any destructors.
347-
#[inline]
348-
#[stable]
349-
pub unsafe fn forget<T>(thing: T) { intrinsics::forget(thing) }
350-
351350
/// Interprets `src` as `&U`, and then reads `src` without moving the contained
352351
/// value.
353352
///

0 commit comments

Comments
 (0)