From 963843b1b346278fcf6f7f065cabdaaae775a0a1 Mon Sep 17 00:00:00 2001 From: Clar Charr Date: Tue, 31 Jan 2017 22:46:16 -0500 Subject: Conversions between CStr/OsStr/Path and boxes. --- src/liballoc/boxed.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/liballoc') diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index ac9439974a4..d0fce706128 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -315,6 +315,14 @@ impl Default for Box<[T]> { } } +#[stable(feature = "default_box_extra", since = "1.17.0")] +impl Default for Box { + fn default() -> Box { + let default: Box<[u8]> = Default::default(); + unsafe { mem::transmute(default) } + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl Clone for Box { /// Returns a new box with a `clone()` of this box's contents. -- cgit 1.4.1-3-g733a5