Skip to content

Commit 4676b10

Browse files
author
James Munns
committed
Modify stability attributes so CI can build, only impl Clone if T is Copy
1 parent d8951ee commit 4676b10

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/libcore/cell.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -1512,16 +1512,14 @@ impl<T: ?Sized> UnsafeCell<T> {
15121512
}
15131513
}
15141514

1515-
// TODO: correct stable attribute
1516-
#[stable(feature = "rust1", since = "1.0.0")]
1517-
impl<T: Clone> Clone for UnsafeCell<T> {
1515+
#[stable(feature = "unsafe_cell_copy_clone_conservative", since = "1.31.0")]
1516+
impl<T: Clone + Copy> Clone for UnsafeCell<T> {
15181517
fn clone(&self) -> UnsafeCell<T> {
15191518
UnsafeCell::new(self.value.clone())
15201519
}
15211520
}
15221521

1523-
// TODO: correct stable attribute
1524-
#[stable(feature = "rust1", since = "1.0.0")]
1522+
#[stable(feature = "unsafe_cell_copy_clone_conservative", since = "1.31.0")]
15251523
impl<T: Copy> Copy for UnsafeCell<T> {}
15261524

15271525
#[stable(feature = "unsafe_cell_default", since = "1.10.0")]

0 commit comments

Comments
 (0)