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
"'%0' consumed in closure. This is illegal since if the closure is invoked more than once the binding will be uninitialized on later invocations", (StringRef))
760
+
"captured '%0' cannot be consumed within a closure", (StringRef))
// CHECK: } // end sil function '$s16moveonly_closure026testLocalLetClosureCaptureE0yyFyycfU_'
420
420
func testLocalLetClosureCaptureLet(){
421
421
letx=SingleElt()
422
-
// expected-error @-1 {{'x' consumed in closure. This is illegal since if the closure is invoked more than once the binding will be uninitialized on later invocations}}
423
-
// expected-error @-2 {{'x' consumed in closure. This is illegal since if the closure is invoked more than once the binding will be uninitialized on later invocations}}
424
-
// expected-error @-3 {{'x' consumed in closure. This is illegal since if the closure is invoked more than once the binding will be uninitialized on later invocations}}
422
+
// expected-error @-1 {{captured 'x' cannot be consumed within a closure}}
423
+
// expected-error @-2 {{captured 'x' cannot be consumed within a closure}}
424
+
// expected-error @-3 {{captured 'x' cannot be consumed within a closure}}
425
425
letf={
426
426
borrowVal(x)
427
427
consumeVal(x) // expected-note {{consuming use here}}
// expected-error @-1 {{'x' consumed in closure. This is illegal since if the closure is invoked more than once the binding will be uninitialized on later invocations}}
1173
-
// expected-error @-2 {{'x' consumed in closure. This is illegal since if the closure is invoked more than once the binding will be uninitialized on later invocations}}
1174
-
// expected-error @-3 {{'x' consumed in closure. This is illegal since if the closure is invoked more than once the binding will be uninitialized on later invocations}}
1172
+
// expected-error @-1 {{captured 'x' cannot be consumed within a closure}}
1173
+
// expected-error @-2 {{captured 'x' cannot be consumed within a closure}}
1174
+
// expected-error @-3 {{captured 'x' cannot be consumed within a closure}}
1175
1175
letf={
1176
1176
borrowVal(x)
1177
1177
consumeVal(x) // expected-note {{consuming use here}}
// expected-error @-1 {{'x2' consumed in closure. This is illegal since if the closure is invoked more than once the binding will be uninitialized on later invocations}}
3496
+
// expected-error @-1 {{captured 'x2' cannot be consumed within a closure}}
3497
3497
// expected-error @-2 {{'x2' is borrowed and cannot be consumed by closure capture}}
3498
3498
varf={}
3499
3499
f ={// expected-note {{closure capture here}}
@@ -3508,7 +3508,7 @@ public func closureVarAndDeferCaptureClassArgUseAfterConsume(_ x2: borrowing Kla
// expected-error @-1 {{'x2' consumed in closure. This is illegal since if the closure is invoked more than once the binding will be uninitialized on later invocations}}
3511
+
// expected-error @-1 {{captured 'x2' cannot be consumed within a closure}}
3512
3512
varf={}
3513
3513
f ={
3514
3514
defer{
@@ -3539,7 +3539,7 @@ public func closureVarAndDeferCaptureClassOwnedArgUseAfterConsume2(_ x2: consumi
// expected-error @-1 {{'x2' consumed in closure. This is illegal since if the closure is invoked more than once the binding will be uninitialized on later invocations}}
3542
+
// expected-error @-1 {{captured 'x2' cannot be consumed within a closure}}
3543
3543
varf={}
3544
3544
f ={
3545
3545
defer{
@@ -3635,7 +3635,7 @@ public func closureVarAndClosureCaptureClassUseAfterConsume3(_ x: borrowing Klas
// expected-error @-1 {{'x2' consumed in closure. This is illegal since if the closure is invoked more than once the binding will be uninitialized on later invocations}}
3638
+
// expected-error @-1 {{captured 'x2' cannot be consumed within a closure}}
3639
3639
// expected-error @-2 {{'x2' is borrowed and cannot be consumed by closure capture}}
3640
3640
// expected-error @-3 {{'x2' is borrowed and cannot be consumed by closure capture}}
Copy file name to clipboardExpand all lines: test/SILOptimizer/moveonly_nonescaping_closures.swift
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -77,7 +77,7 @@ func c2(x: consuming M) {
77
77
consume(x)
78
78
}
79
79
80
-
func d(x:__owned M){ // expected-error {{'x' consumed in closure. This is illegal since if the closure is invoked more than once the binding will be uninitialized on later invocations}}
80
+
func d(x:__owned M){ // expected-error {{captured 'x' cannot be consumed within a closure}}
0 commit comments