We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 543ab99 commit 3d20b2aCopy full SHA for 3d20b2a
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