Skip to content

Commit 74bed5e

Browse files
committed
batch 1
1 parent f0ce3ea commit 74bed5e

6 files changed

+89
-89
lines changed

include/swift/AST/DiagnosticsSIL.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ ERROR(sil_moveonlychecker_guaranteed_value_consumed, none,
757757
ERROR(sil_moveonlychecker_guaranteed_value_captured_by_closure, none,
758758
"'%0' is borrowed and cannot be consumed by closure capture", (StringRef))
759759
ERROR(sil_moveonlychecker_let_value_consumed_in_closure, none,
760-
"'%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))
761761
ERROR(sil_moveonlychecker_inout_not_reinitialized_before_end_of_function, none,
762762
"'%0' consumed but not reinitialized before end of function", (StringRef))
763763
ERROR(sil_moveonlychecker_inout_not_reinitialized_before_end_of_closure, none,

test/SILGen/moveonly_escaping_closure.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,9 @@ func testGlobalClosureCaptureLet() {
419419
// CHECK: } // end sil function '$s16moveonly_closure026testLocalLetClosureCaptureE0yyFyycfU_'
420420
func testLocalLetClosureCaptureLet() {
421421
let x = 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}}
425425
let f = {
426426
borrowVal(x)
427427
consumeVal(x) // expected-note {{consuming use here}}
@@ -1169,9 +1169,9 @@ func testGlobalClosureCaptureOwned(_ x: __owned SingleElt) {
11691169
// CHECK: apply {{%.*}}([[LOADED_READ]], [[LOADED_TAKE]])
11701170
// CHECK: } // end sil function '$s16moveonly_closure31testLocalLetClosureCaptureOwnedyyAA9SingleEltVnFyycfU_'
11711171
func testLocalLetClosureCaptureOwned(_ x: __owned SingleElt) {
1172-
// 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}}
11751175
let f = {
11761176
borrowVal(x)
11771177
consumeVal(x) // expected-note {{consuming use here}}

test/SILOptimizer/moveonly_addresschecker_diagnostics.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3493,7 +3493,7 @@ public func closureVarAndDeferCaptureClassUseAfterConsume3(_ x: borrowing Klass)
34933493
}
34943494

34953495
public func closureVarAndDeferCaptureClassArgUseAfterConsume(_ x2: borrowing Klass) {
3496-
// 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}}
34973497
// expected-error @-2 {{'x2' is borrowed and cannot be consumed by closure capture}}
34983498
var f = {}
34993499
f = {// expected-note {{closure capture here}}
@@ -3508,7 +3508,7 @@ public func closureVarAndDeferCaptureClassArgUseAfterConsume(_ x2: borrowing Kla
35083508
}
35093509

35103510
public func closureVarAndDeferCaptureClassOwnedArgUseAfterConsume(_ x2: __owned Klass) {
3511-
// 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}}
35123512
var f = {}
35133513
f = {
35143514
defer {
@@ -3539,7 +3539,7 @@ public func closureVarAndDeferCaptureClassOwnedArgUseAfterConsume2(_ x2: consumi
35393539

35403540
// TODO: MG
35413541
public func closureVarAndDeferCaptureClassOwnedArgUseAfterConsume3(_ x2: __owned Klass) {
3542-
// 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}}
35433543
var f = {}
35443544
f = {
35453545
defer {
@@ -3635,7 +3635,7 @@ public func closureVarAndClosureCaptureClassUseAfterConsume3(_ x: borrowing Klas
36353635
}
36363636

36373637
public func closureVarAndClosureCaptureClassArgUseAfterConsume(_ x2: borrowing Klass) {
3638-
// 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}}
36393639
// expected-error @-2 {{'x2' is borrowed and cannot be consumed by closure capture}}
36403640
// expected-error @-3 {{'x2' is borrowed and cannot be consumed by closure capture}}
36413641
var f = {}

test/SILOptimizer/moveonly_nonescaping_closures.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func c2(x: consuming M) {
7777
consume(x)
7878
}
7979

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}}
8181
clodger({ consume(x) })
8282
// expected-note @-1 {{consuming use here}}
8383
}

0 commit comments

Comments
 (0)