Skip to content

Commit

Permalink
Rollup merge of rust-lang#50148 - japaric:const-manuallydrop, r=oli-obk
Browse files Browse the repository at this point in the history
turn `ManuallyDrop::new` into a constant function
  • Loading branch information
kennytm committed May 9, 2018
2 parents bb690c6 + b61a4c2 commit dea03f1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libcore/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -959,8 +959,9 @@ impl<T> ManuallyDrop<T> {
/// ManuallyDrop::new(Box::new(()));
/// ```
#[stable(feature = "manually_drop", since = "1.20.0")]
#[rustc_const_unstable(feature = "const_manually_drop_new")]
#[inline]
pub fn new(value: T) -> ManuallyDrop<T> {
pub const fn new(value: T) -> ManuallyDrop<T> {
ManuallyDrop { value: value }
}

Expand Down

0 comments on commit dea03f1

Please sign in to comment.