diff --git a/src/libstd/clone.rs b/src/libstd/clone.rs index 5ec594cef7e..046693632c6 100644 --- a/src/libstd/clone.rs +++ b/src/libstd/clone.rs @@ -56,6 +56,18 @@ impl<'self, T> Clone for &'self T { fn clone(&self) -> &'self T { *self } } +impl<'self, T> Clone for &'self [T] { + /// Return a shallow copy of the slice. + #[inline] + fn clone(&self) -> &'self [T] { *self } +} + +impl<'self> Clone for &'self str { + /// Return a shallow copy of the slice. + #[inline] + fn clone(&self) -> &'self str { *self } +} + macro_rules! clone_impl( ($t:ty) => { impl Clone for $t {