about summary refs log tree commit diff
path: root/src/libcore/str/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcore/str/mod.rs')
-rw-r--r--src/libcore/str/mod.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs
index 3169893fcde..5e1a9c25a21 100644
--- a/src/libcore/str/mod.rs
+++ b/src/libcore/str/mod.rs
@@ -3875,6 +3875,12 @@ impl<'a> Default for &'a str {
     fn default() -> &'a str { "" }
 }
 
+#[stable(feature = "default_mut_str", since = "1.28.0")]
+impl<'a> Default for &'a mut str {
+    /// Creates an empty mutable str
+    fn default() -> &'a mut str { unsafe { from_utf8_unchecked_mut(&mut []) } }
+}
+
 /// An iterator over the non-whitespace substrings of a string,
 /// separated by any amount of whitespace.
 ///