Function core::intrinsics::forget [−][src]
pub extern "rust-intrinsic" fn forget<T: ?Sized>(_: T)🔬 This is a nightly-only experimental API. (core_intrinsics)
intrinsics are unlikely to ever be stabilized, instead they should be used through stabilized interfaces in the rest of the standard library
Expand description
将值移出作用域。而无需运行丢弃守卫。
这仅适用于 mem::forget_unsized。正常情况下,请改用 forget 为 ManuallyDrop。
请注意,与大多数内部函数不同,这对调用是安全的;
它不需要 unsafe 块。
因此,实现不得要求用户维护任何安全不变量。