Skip to content

Commit 6b9d85c

Browse files
committed
Add tests ensuring slices are not Copy/Clone
1 parent 7928472 commit 6b9d85c

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

tests/test/slices.rs

+32
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,35 @@ fn slices_are_well_formed() {
2929
}
3030
}
3131
}
32+
33+
#[test]
34+
fn slices_are_not_copy() {
35+
test! {
36+
program {
37+
#[lang(copy)]
38+
trait Copy { }
39+
}
40+
41+
goal {
42+
forall<T> { not { [T]: Copy } }
43+
} yields {
44+
"Unique; substitution [], lifetime constraints []"
45+
}
46+
}
47+
}
48+
49+
#[test]
50+
fn slices_are_not_clone() {
51+
test! {
52+
program {
53+
#[lang(clone)]
54+
trait Clone { }
55+
}
56+
57+
goal {
58+
forall<T> { not { [T]: Clone } }
59+
} yields {
60+
"Unique; substitution [], lifetime constraints []"
61+
}
62+
}
63+
}

0 commit comments

Comments
 (0)