We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 89fe961 + 1d9be66 commit 05f7da0Copy full SHA for 05f7da0
library/core/src/mem/manually_drop.rs
@@ -217,8 +217,9 @@ impl<T> ManuallyDrop<T> {
217
///
218
#[must_use = "if you don't need the value, you can use `ManuallyDrop::drop` instead"]
219
#[stable(feature = "manually_drop_take", since = "1.42.0")]
220
+ #[rustc_const_unstable(feature = "const_manually_drop_take", issue = "148773")]
221
#[inline]
- pub unsafe fn take(slot: &mut ManuallyDrop<T>) -> T {
222
+ pub const unsafe fn take(slot: &mut ManuallyDrop<T>) -> T {
223
// SAFETY: we are reading from a reference, which is guaranteed
224
// to be valid for reads.
225
unsafe { ptr::read(&slot.value) }
0 commit comments