mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-05 14:37:37 +00:00
Update docs
This commit is contained in:
parent
4d2934e803
commit
56d3a824e4
@ -143,25 +143,12 @@ pub fn forget<T>(t: T) {
|
|||||||
ManuallyDrop::new(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
|
/// This function is just a shim intended to be removed when the `unsized_locals` feature gets
|
||||||
/// will never be stabilized and is only available because we haven't decided to relax the bounds
|
/// stabilized.
|
||||||
/// on [`forget`] just yet.
|
|
||||||
///
|
///
|
||||||
/// [`forget`]: fn.forget.html
|
/// [`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]
|
#[inline]
|
||||||
#[cfg(not(stage0))]
|
#[cfg(not(stage0))]
|
||||||
#[unstable(feature = "forget_unsized", issue = "0")]
|
#[unstable(feature = "forget_unsized", issue = "0")]
|
||||||
|
Loading…
Reference in New Issue
Block a user