We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents cbb40cd + 3d20b2a commit c630b6bCopy full SHA for c630b6b
library/core/tests/manually_drop.rs
@@ -2,6 +2,7 @@ use core::mem::ManuallyDrop;
2
3
#[test]
4
fn smoke() {
5
+ #[derive(Clone)]
6
struct TypeWithDrop;
7
impl Drop for TypeWithDrop {
8
fn drop(&mut self) {
@@ -16,4 +17,11 @@ fn smoke() {
16
17
let x: Box<ManuallyDrop<[TypeWithDrop]>> =
18
Box::new(ManuallyDrop::new([TypeWithDrop, TypeWithDrop]));
19
drop(x);
20
+
21
+ // test clone and clone_from implementations
22
+ let mut x = ManuallyDrop::new(TypeWithDrop);
23
+ let y = x.clone();
24
+ x.clone_from(&y);
25
+ drop(x);
26
+ drop(y);
27
}
0 commit comments