Skip to content

Commit dea03f1

Browse files
committed
Rollup merge of rust-lang#50148 - japaric:const-manuallydrop, r=oli-obk
turn `ManuallyDrop::new` into a constant function
2 parents bb690c6 + b61a4c2 commit dea03f1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libcore/mem.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -959,8 +959,9 @@ impl<T> ManuallyDrop<T> {
959959
/// ManuallyDrop::new(Box::new(()));
960960
/// ```
961961
#[stable(feature = "manually_drop", since = "1.20.0")]
962+
#[rustc_const_unstable(feature = "const_manually_drop_new")]
962963
#[inline]
963-
pub fn new(value: T) -> ManuallyDrop<T> {
964+
pub const fn new(value: T) -> ManuallyDrop<T> {
964965
ManuallyDrop { value: value }
965966
}
966967

0 commit comments

Comments
 (0)