Rollup merge of #50148 - japaric:const-manuallydrop, r=oli-obk
turn `ManuallyDrop::new` into a constant function
This commit is contained in:
commit
dea03f1239
@ -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 }
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user