about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libcollections/string.rs8
-rw-r--r--src/libcollections/vec.rs9
2 files changed, 17 insertions, 0 deletions
diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs
index 0e3d2f02ae9..f3a9e7b1867 100644
--- a/src/libcollections/string.rs
+++ b/src/libcollections/string.rs
@@ -874,6 +874,14 @@ impl<'a> Add<&'a str, String> for String {
     }
 }
 
+#[cfg(not(stage0))]  // NOTE(stage0): Remove cfg after a snapshot
+impl<'a> Add<String, String> for &'a str {
+    fn add(self, mut other: String) -> String {
+        other.push_str(self);
+        other
+    }
+}
+
 impl ops::Slice<uint, str> for String {
     #[inline]
     fn as_slice_<'a>(&'a self) -> &'a str {
diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs
index 56cfa19e887..275825da3b5 100644
--- a/src/libcollections/vec.rs
+++ b/src/libcollections/vec.rs
@@ -1295,6 +1295,15 @@ impl<'a, T: Clone> Add<&'a [T], Vec<T>> for Vec<T> {
     }
 }
 
+#[cfg(not(stage0))]  // NOTE(stage0): Remove impl after a snapshot
+impl<'a, T: Clone> Add<Vec<T>, Vec<T>> for &'a [T] {
+    #[inline]
+    fn add(self, mut rhs: Vec<T>) -> Vec<T> {
+        rhs.push_all(self);
+        rhs
+    }
+}
+
 #[unsafe_destructor]
 impl<T> Drop for Vec<T> {
     fn drop(&mut self) {