Rollup merge of #50148 - japaric:const-manuallydrop, r=oli-obk

turn `ManuallyDrop::new` into a constant function
This commit is contained in:
kennytm 2018-05-09 17:25:25 +08:00
commit dea03f1239
No known key found for this signature in database
GPG Key ID: FEF6C8051D0E013C

View File

@ -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 }
}