about summary refs log tree commit diff
path: root/src/libcollections/string.rs
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2017-03-16 21:56:52 -0400
committerGitHub <noreply@github.com>2017-03-16 21:56:52 -0400
commitbc6eecd0c2ed7854d52fc823be0b093f3bc76ba8 (patch)
treeba624a9e66a33fec8bcc8bc93734d03acbdd6688 /src/libcollections/string.rs
parent6adbbfc6ba8786ea91e1051ea14d64a91839f5b5 (diff)
parent0aeb9c12979e6da753701a798d04105b6b1a8c28 (diff)
Merge branch 'master' into frewsxcv-osstr
Diffstat (limited to 'src/libcollections/string.rs')
-rw-r--r--src/libcollections/string.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs
index 43323676ab4..13c99a2d59b 100644
--- a/src/libcollections/string.rs
+++ b/src/libcollections/string.rs
@@ -1974,6 +1974,22 @@ impl<'a> From<&'a str> for String {
     }
 }
 
+// note: test pulls in libstd, which causes errors here
+#[cfg(not(test))]
+#[stable(feature = "string_from_box", since = "1.17.0")]
+impl From<Box<str>> for String {
+    fn from(s: Box<str>) -> String {
+        s.into_string()
+    }
+}
+
+#[stable(feature = "box_from_str", since = "1.17.0")]
+impl Into<Box<str>> for String {
+    fn into(self) -> Box<str> {
+        self.into_boxed_str()
+    }
+}
+
 #[stable(feature = "string_from_cow_str", since = "1.14.0")]
 impl<'a> From<Cow<'a, str>> for String {
     fn from(s: Cow<'a, str>) -> String {