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() {
3030}
3131
3232#[ test]
33- fn refs_are_copy ( ) {
33+ fn immut_refs_are_copy ( ) {
3434 test ! {
3535 program {
3636 #[ lang( copy) ]
@@ -46,7 +46,7 @@ fn refs_are_copy() {
4646}
4747
4848#[ test]
49- fn refs_are_clone ( ) {
49+ fn immut_refs_are_clone ( ) {
5050 test ! {
5151 program {
5252 #[ lang( clone) ]
@@ -60,3 +60,35 @@ fn refs_are_clone() {
6060 }
6161 }
6262}
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