Skip to content

Commit 36ce1c0

Browse files
author
James McGlashan
committed
Implements Default for mutable slices. Fixes: #29244
1 parent 3f37f5a commit 36ce1c0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/libcore/slice.rs

+5
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,11 @@ impl<'a, T> Default for &'a [T] {
655655
fn default() -> &'a [T] { &[] }
656656
}
657657

658+
#[stable(feature = "mut_slice_default", since = "1.5.0")]
659+
impl<'a, T> Default for &'a mut [T] {
660+
fn default() -> &'a mut [T] { &mut [] }
661+
}
662+
658663
//
659664
// Iterators
660665
//

0 commit comments

Comments
 (0)