Skip to content

Commit 05f7da0

Browse files
authored
Unrolled build for #148752
Rollup merge of #148752 - nxsaken:const_manually_drop_take, r=scottmcm Constify `ManuallyDrop::take` Feature: `const_manually_drop_take` Tracking issue: #148773 This PR constifies `ManuallyDrop::take`.
2 parents 89fe961 + 1d9be66 commit 05f7da0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/core/src/mem/manually_drop.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,9 @@ impl<T> ManuallyDrop<T> {
217217
///
218218
#[must_use = "if you don't need the value, you can use `ManuallyDrop::drop` instead"]
219219
#[stable(feature = "manually_drop_take", since = "1.42.0")]
220+
#[rustc_const_unstable(feature = "const_manually_drop_take", issue = "148773")]
220221
#[inline]
221-
pub unsafe fn take(slot: &mut ManuallyDrop<T>) -> T {
222+
pub const unsafe fn take(slot: &mut ManuallyDrop<T>) -> T {
222223
// SAFETY: we are reading from a reference, which is guaranteed
223224
// to be valid for reads.
224225
unsafe { ptr::read(&slot.value) }

0 commit comments

Comments
 (0)