diff options
| author | Stjepan Glavina <stjepang@gmail.com> | 2018-11-12 18:36:49 +0100 |
|---|---|---|
| committer | Stjepan Glavina <stjepang@gmail.com> | 2018-11-12 18:36:49 +0100 |
| commit | 56d3a824e46ce9976a017ef41c318a66444da99c (patch) | |
| tree | aeac1c9e0cc6abf6fa093ce5fa181ae67a57101d /src | |
| parent | 4d2934e803d1c948c5e4681a84f33b91c0a0fc64 (diff) | |
| download | rust-56d3a824e46ce9976a017ef41c318a66444da99c.tar.gz rust-56d3a824e46ce9976a017ef41c318a66444da99c.zip | |
Update docs
Diffstat (limited to 'src')
| -rw-r--r-- | src/libcore/mem.rs | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs index f612f89e082..7fe195d63be 100644 --- a/src/libcore/mem.rs +++ b/src/libcore/mem.rs @@ -143,25 +143,12 @@ pub fn forget<T>(t: T) { ManuallyDrop::new(t); } -/// Takes ownership and "forgets" about the value **without running its destructor**. +/// Like [`forget`], but also accepts unsized values. /// -/// This function works exactly the same as [`forget`], except it also accepts unsized values. It -/// will never be stabilized and is only available because we haven't decided to relax the bounds -/// on [`forget`] just yet. +/// This function is just a shim intended to be removed when the `unsized_locals` feature gets +/// stabilized. /// /// [`forget`]: fn.forget.html -/// -/// # Examples -/// -/// ``` -/// #![feature(forget_unsized)] -/// -/// use std::mem; -/// -/// let f: Box<FnOnce()> = Box::new(|| ()); -/// let f = *f; -/// mem::forget_unsized(f); -/// ``` #[inline] #[cfg(not(stage0))] #[unstable(feature = "forget_unsized", issue = "0")] |
