From 36ce1c06a45471f0d028dd7d9899102aa5cbbf10 Mon Sep 17 00:00:00 2001 From: James McGlashan Date: Fri, 23 Oct 2015 14:39:50 +1100 Subject: [PATCH] Implements Default for mutable slices. Fixes: #29244 --- src/libcore/slice.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs index a4ccc975d56bc..8e3eba15b4ee4 100644 --- a/src/libcore/slice.rs +++ b/src/libcore/slice.rs @@ -655,6 +655,11 @@ impl<'a, T> Default for &'a [T] { fn default() -> &'a [T] { &[] } } +#[stable(feature = "mut_slice_default", since = "1.5.0")] +impl<'a, T> Default for &'a mut [T] { + fn default() -> &'a mut [T] { &mut [] } +} + // // Iterators //