Skip to content

Commit 0b9ba3d

Browse files
authored
Unrolled build for #148757
Rollup merge of #148757 - nxsaken:const_mem_take, r=scottmcm Constify `mem::take` Feature: `const_default` (#143894)
2 parents 89fe961 + 264c6d4 commit 0b9ba3d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/core/src/mem/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,8 @@ pub const fn swap<T>(x: &mut T, y: &mut T) {
808808
/// ```
809809
#[inline]
810810
#[stable(feature = "mem_take", since = "1.40.0")]
811-
pub fn take<T: Default>(dest: &mut T) -> T {
811+
#[rustc_const_unstable(feature = "const_default", issue = "143894")]
812+
pub const fn take<T: [const] Default>(dest: &mut T) -> T {
812813
replace(dest, T::default())
813814
}
814815

0 commit comments

Comments
 (0)