Created
October 19, 2018 15:34
-
-
Save jamesmunns/446816f12ad5ef5b9ce3c3da2c32626e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs | |
index ec7d366c3f..421b741a3a 100644 | |
--- a/src/libcore/cell.rs | |
+++ b/src/libcore/cell.rs | |
@@ -1512,6 +1512,18 @@ impl<T: ?Sized> UnsafeCell<T> { | |
} | |
} | |
+// TODO: correct stable attribute | |
+#[stable(feature = "rust1", since = "1.0.0")] | |
+impl<T: Clone> Clone for UnsafeCell<T> { | |
+ fn clone(&self) -> UnsafeCell<T> { | |
+ UnsafeCell::new(self.value.clone()) | |
+ } | |
+} | |
+ | |
+// TODO: correct stable attribute | |
+#[stable(feature = "rust1", since = "1.0.0")] | |
+impl<T: Copy> Copy for UnsafeCell<T> {} | |
+ | |
#[stable(feature = "unsafe_cell_default", since = "1.10.0")] | |
impl<T: Default> Default for UnsafeCell<T> { | |
/// Creates an `UnsafeCell`, with the `Default` value for T. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment