diff options
| author | kennytm <kennytm@gmail.com> | 2018-05-09 17:25:25 +0800 |
|---|---|---|
| committer | kennytm <kennytm@gmail.com> | 2018-05-09 17:25:25 +0800 |
| commit | dea03f1239a5c9ce44daff36473c7d258c4aef1d (patch) | |
| tree | 75eeb0079dd67082e087481432f007c6513c281c /src | |
| parent | bb690c600ca0b59afd1dde131057917211130700 (diff) | |
| parent | b61a4c20c6acd963070adb083b12d5e21a5843d3 (diff) | |
Rollup merge of #50148 - japaric:const-manuallydrop, r=oli-obk
turn `ManuallyDrop::new` into a constant function
Diffstat (limited to 'src')
| -rw-r--r-- | src/libcore/mem.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs index 6cbe26afae9..20445def634 100644 --- a/src/libcore/mem.rs +++ b/src/libcore/mem.rs @@ -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 } } |
