File tree Expand file tree Collapse file tree 1 file changed +34
-2
lines changed Expand file tree Collapse file tree 1 file changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ fn refs_are_sized() {
30
30
}
31
31
32
32
#[ test]
33
- fn refs_are_copy ( ) {
33
+ fn immut_refs_are_copy ( ) {
34
34
test ! {
35
35
program {
36
36
#[ lang( copy) ]
@@ -46,7 +46,7 @@ fn refs_are_copy() {
46
46
}
47
47
48
48
#[ test]
49
- fn refs_are_clone ( ) {
49
+ fn immut_refs_are_clone ( ) {
50
50
test ! {
51
51
program {
52
52
#[ lang( clone) ]
@@ -60,3 +60,35 @@ fn refs_are_clone() {
60
60
}
61
61
}
62
62
}
63
+
64
+ #[ test]
65
+ fn mut_refs_are_not_copy ( ) {
66
+ test ! {
67
+ program {
68
+ #[ lang( copy) ]
69
+ trait Copy { }
70
+ }
71
+
72
+ goal {
73
+ forall<' a, T > { not { & ' a mut T : Copy } }
74
+ } yields {
75
+ "Unique; substitution [], lifetime constraints []"
76
+ }
77
+ }
78
+ }
79
+
80
+ #[ test]
81
+ fn mut_refs_are_not_clone ( ) {
82
+ test ! {
83
+ program {
84
+ #[ lang( clone) ]
85
+ trait Clone { }
86
+ }
87
+
88
+ goal {
89
+ forall<' a, T > { not { & ' a mut T : Clone } }
90
+ } yields {
91
+ "Unique; substitution [], lifetime constraints []"
92
+ }
93
+ }
94
+ }
You can’t perform that action at this time.
0 commit comments