diff options
| author | bors <bors@rust-lang.org> | 2014-08-22 02:40:56 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-08-22 02:40:56 +0000 |
| commit | 07d86b46a949a94223da714e35b343243e4ecce4 (patch) | |
| tree | b98d875995770e0423c16e076b4db04710df0e3f | |
| parent | 711d710278e5f35a948637c2795fd9b1aa911368 (diff) | |
| parent | 715abbdc9c64548440d05c80330abb6204534da2 (diff) | |
| download | rust-07d86b46a949a94223da714e35b343243e4ecce4.tar.gz rust-07d86b46a949a94223da714e35b343243e4ecce4.zip | |
auto merge of #16509 : luqmana/rust/uw, r=alexcrichton
Fixes #15401.
| -rw-r--r-- | src/libcore/mem.rs | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs index 06e28816c1c..4de81db1013 100644 --- a/src/libcore/mem.rs +++ b/src/libcore/mem.rs @@ -19,6 +19,16 @@ use ptr; pub use intrinsics::transmute; +/// Moves a thing into the void. +/// +/// The forget function will take ownership of the provided value but neglect +/// to run any required cleanup or memory management operations on it. +/// +/// This function is the unsafe version of the `drop` function because it does +/// not run any destructors. +#[stable] +pub use intrinsics::forget; + /// Returns the size of a type in bytes. #[inline] #[stable] @@ -337,17 +347,6 @@ pub fn replace<T>(dest: &mut T, mut src: T) -> T { #[stable] pub fn drop<T>(_x: T) { } -/// Moves a thing into the void. -/// -/// The forget function will take ownership of the provided value but neglect -/// to run any required cleanup or memory management operations on it. -/// -/// This function is the unsafe version of the `drop` function because it does -/// not run any destructors. -#[inline] -#[stable] -pub unsafe fn forget<T>(thing: T) { intrinsics::forget(thing) } - /// Interprets `src` as `&U`, and then reads `src` without moving the contained /// value. /// |
