about summary refs log tree commit diff
path: root/src/libstd/path.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/path.rs')
-rw-r--r--src/libstd/path.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libstd/path.rs b/src/libstd/path.rs
index 3dc1e9c3dad..2d868629278 100644
--- a/src/libstd/path.rs
+++ b/src/libstd/path.rs
@@ -1410,6 +1410,14 @@ impl From<PathBuf> for Box<Path> {
     }
 }
 
+#[stable(feature = "more_box_slice_clone", since = "1.29.0")]
+impl Clone for Box<Path> {
+    #[inline]
+    fn clone(&self) -> Self {
+        self.to_path_buf().into_boxed_path()
+    }
+}
+
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a, T: ?Sized + AsRef<OsStr>> From<&'a T> for PathBuf {
     fn from(s: &'a T) -> PathBuf {