You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// CHECK: } // end sil function '$s16moveonly_closure29testLocalLetClosureCaptureVaryyFyycfU_'
127
127
func testLocalLetClosureCaptureVar(){
128
-
varx=SingleElt() // expected-error {{'x' was consumed but it is illegal to consume a noncopyable mutable capture of an escaping closure. One can only read from it or assign over it}}
129
-
// expected-error @-1 {{'x' was consumed but it is illegal to consume a noncopyable mutable capture of an escaping closure. One can only read from it or assign over it}}
130
-
// expected-error @-2 {{'x' was consumed but it is illegal to consume a noncopyable mutable capture of an escaping closure. One can only read from it or assign over it}}
128
+
varx=SingleElt()
131
129
x =SingleElt()
132
130
letf={
133
131
borrowVal(x)
134
-
consumeVal(x) // expected-note {{consuming use here}}
135
-
consumeVal(x) // expected-note {{consuming use here}}
136
-
borrowConsumeVal(x, x) // expected-note {{consuming use here}}
132
+
consumeVal(x) // expected-error {{'x' was consumed but it is illegal to consume a noncopyable mutable capture of an escaping closure. One can only read from it or assign over it}}
133
+
consumeVal(x) // expected-error {{'x' was consumed but it is illegal to consume a noncopyable mutable capture of an escaping closure. One can only read from it or assign over it}}
134
+
borrowConsumeVal(x, x) // expected-error {{'x' was consumed but it is illegal to consume a noncopyable mutable capture of an escaping closure. One can only read from it or assign over it}}
137
135
// expected-error @-1 {{overlapping accesses, but deinitialization requires exclusive access}}
138
136
// expected-note @-2 {{conflicting access is here}}
// CHECK: } // end sil function '$s16moveonly_closure026testLocalLetClosureCaptureE0yyFyycfU_'
412
410
func testLocalLetClosureCaptureLet(){
413
411
letx=SingleElt()
414
-
// expected-error @-1 {{'x' was consumed but it is illegal to consume a noncopyable immutable capture of an escaping closure. One can only read from it}}
415
-
// expected-error @-2 {{'x' was consumed but it is illegal to consume a noncopyable immutable capture of an escaping closure. One can only read from it}}
416
-
// expected-error @-3 {{'x' was consumed but it is illegal to consume a noncopyable immutable capture of an escaping closure. One can only read from it}}
417
412
letf={
418
413
borrowVal(x)
419
-
consumeVal(x) // expected-note {{consuming use here}}
420
-
consumeVal(x) // expected-note {{consuming use here}}
421
-
borrowConsumeVal(x, x) // expected-note {{consuming use here}}
414
+
consumeVal(x) // expected-error {{'x' was consumed but it is illegal to consume a noncopyable immutable capture of an escaping closure. One can only read from it}}
415
+
consumeVal(x) // expected-error {{'x' was consumed but it is illegal to consume a noncopyable immutable capture of an escaping closure. One can only read from it}}
416
+
borrowConsumeVal(x, x) // expected-error {{'x' was consumed but it is illegal to consume a noncopyable immutable capture of an escaping closure. One can only read from it}}
// expected-error @-1 {{'x' was consumed but it is illegal to consume a noncopyable mutable capture of an escaping closure. One can only read from it or assign over it}}
939
-
// expected-error @-2 {{'x' was consumed but it is illegal to consume a noncopyable mutable capture of an escaping closure. One can only read from it or assign over it}}
940
-
// expected-error @-3 {{'x' was consumed but it is illegal to consume a noncopyable mutable capture of an escaping closure. One can only read from it or assign over it}}
941
933
letf={
942
934
borrowVal(x)
943
-
consumeVal(x) // expected-note {{consuming use here}}
944
-
consumeVal(x) // expected-note {{consuming use here}}
945
-
borrowConsumeVal(x, x) // expected-note {{consuming use here}}
935
+
consumeVal(x) // expected-error {{'x' was consumed but it is illegal to consume a noncopyable mutable capture of an escaping closure. One can only read from it or assign over it}}
936
+
consumeVal(x) // expected-error {{'x' was consumed but it is illegal to consume a noncopyable mutable capture of an escaping closure. One can only read from it or assign over it}}
937
+
borrowConsumeVal(x, x) // expected-error {{'x' was consumed but it is illegal to consume a noncopyable mutable capture of an escaping closure. One can only read from it or assign over it}}
946
938
// expected-error @-1 {{overlapping accesses, but deinitialization requires exclusive access}}
947
939
// expected-note @-2 {{conflicting access is here}}
// expected-error @-1 {{'x' was consumed but it is illegal to consume a noncopyable immutable capture of an escaping closure. One can only read from it}}
1158
-
// expected-error @-2 {{'x' was consumed but it is illegal to consume a noncopyable immutable capture of an escaping closure. One can only read from it}}
1159
-
// expected-error @-3 {{'x' was consumed but it is illegal to consume a noncopyable immutable capture of an escaping closure. One can only read from it}}
1160
1149
letf={
1161
1150
borrowVal(x)
1162
-
consumeVal(x) // expected-note {{consuming use here}}
1163
-
consumeVal(x) // expected-note {{consuming use here}}
1164
-
borrowConsumeVal(x, x) // expected-note {{consuming use here}}
1151
+
consumeVal(x) // expected-error {{'x' was consumed but it is illegal to consume a noncopyable immutable capture of an escaping closure. One can only read from it}}
1152
+
consumeVal(x) // expected-error {{'x' was consumed but it is illegal to consume a noncopyable immutable capture of an escaping closure. One can only read from it}}
1153
+
borrowConsumeVal(x, x) // expected-error {{'x' was consumed but it is illegal to consume a noncopyable immutable capture of an escaping closure. One can only read from it}}
0 commit comments