@@ -2731,7 +2731,7 @@ public func enumPatternMatchSwitch2WhereClause2OwnedArg2(_ x2: consuming EnumTy)
2731
2731
/////////////////////////////
2732
2732
2733
2733
public func closureLetClassUseAfterConsume1( _ x: borrowing Klass ) {
2734
- // expected-error @-1 {{'x' is borrowed and cannot be consumed }}
2734
+ // expected-error @-1 {{'x' cannot be captured by an escaping closure since it is a borrowed parameter }}
2735
2735
// expected-error @-2 {{noncopyable 'x' cannot be consumed when captured by a closure}}
2736
2736
let f = { // expected-note {{closure capturing 'x' here}}
2737
2737
let x2 = x // expected-error {{'x2' consumed more than once}}
@@ -2830,7 +2830,7 @@ public func closureLetCaptureClassUseAfterConsumeError(_ x: borrowing Klass) { /
2830
2830
2831
2831
public func closureLetCaptureClassArgUseAfterConsume( _ x2: borrowing Klass ) {
2832
2832
// expected-error @-1 {{noncopyable 'x2' cannot be consumed when captured by a closure}}
2833
- // expected-error @-2 {{'x2' is borrowed and cannot be consumed by closure capture }}
2833
+ // expected-error @-2 {{'x2' cannot be captured by an escaping closure since it is a borrowed parameter }}
2834
2834
let f = { // expected-note {{closure capturing 'x2' here}}
2835
2835
borrowVal ( x2)
2836
2836
consumeVal ( x2) // expected-note {{consumed here}}
@@ -2897,7 +2897,7 @@ public func closureLetCaptureClassOwnedArgUseAfterConsume4(_ x2: consuming Klass
2897
2897
/////////////////////////////
2898
2898
2899
2899
public func closureVarClassUseAfterConsume1( _ x: borrowing Klass ) {
2900
- // expected-error @-1 {{'x' is borrowed and cannot be consumed }}
2900
+ // expected-error @-1 {{'x' cannot be captured by an escaping closure since it is a borrowed parameter }}
2901
2901
// expected-error @-2 {{noncopyable 'x' cannot be consumed when captured by a closure}}
2902
2902
var f = { }
2903
2903
f = { // expected-note {{closure capturing 'x' here}}
@@ -3007,7 +3007,7 @@ public func closureVarCaptureClassUseAfterConsumeError(_ x: borrowing Klass) { /
3007
3007
3008
3008
public func closureVarCaptureClassArgUseAfterConsume( _ x2: borrowing Klass ) {
3009
3009
// expected-error @-1 {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3010
- // expected-error @-2 {{'x2' is borrowed and cannot be consumed by closure capture }}
3010
+ // expected-error @-2 {{'x2' cannot be captured by an escaping closure since it is a borrowed parameter }}
3011
3011
var f = { }
3012
3012
f = { // expected-note {{closure capturing 'x2' here}}
3013
3013
borrowVal ( x2)
@@ -3206,7 +3206,7 @@ public func closureLetAndDeferCaptureClassUseAfterConsume3(_ x: borrowing Klass)
3206
3206
3207
3207
public func closureLetAndDeferCaptureClassArgUseAfterConsume( _ x2: borrowing Klass ) {
3208
3208
// expected-error @-1 {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3209
- // expected-error @-2 {{'x2' is borrowed and cannot be consumed by closure capture }}
3209
+ // expected-error @-2 {{'x2' cannot be captured by an escaping closure since it is a borrowed parameter }}
3210
3210
let f = { // expected-note {{closure capturing 'x2' here}}
3211
3211
defer {
3212
3212
borrowVal ( x2)
@@ -3343,8 +3343,8 @@ public func closureLetAndClosureCaptureClassUseAfterConsume3(_ x: borrowing Klas
3343
3343
3344
3344
public func closureLetAndClosureCaptureClassArgUseAfterConsume( _ x2: borrowing Klass ) {
3345
3345
// expected-error @-1 {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3346
- // expected-error @-2 {{'x2' is borrowed and cannot be consumed by closure capture }}
3347
- // expected-error @-3 {{'x2' is borrowed and cannot be consumed by closure capture }}
3346
+ // expected-error @-2 {{'x2' cannot be captured by an escaping closure since it is a borrowed parameter }}
3347
+ // expected-error @-3 {{'x2' cannot be captured by an escaping closure since it is a borrowed parameter }}
3348
3348
let f = { // expected-note {{closure capturing 'x2' here}}
3349
3349
let g = { // expected-note {{closure capturing 'x2' here}}
3350
3350
borrowVal ( x2)
@@ -3490,7 +3490,7 @@ public func closureVarAndDeferCaptureClassUseAfterConsume3(_ x: borrowing Klass)
3490
3490
3491
3491
public func closureVarAndDeferCaptureClassArgUseAfterConsume( _ x2: borrowing Klass ) {
3492
3492
// expected-error @-1 {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3493
- // expected-error @-2 {{'x2' is borrowed and cannot be consumed by closure capture }}
3493
+ // expected-error @-2 {{'x2' cannot be captured by an escaping closure since it is a borrowed parameter }}
3494
3494
var f = { }
3495
3495
f = { // expected-note {{closure capturing 'x2' here}}
3496
3496
defer {
@@ -3630,8 +3630,8 @@ public func closureVarAndClosureCaptureClassUseAfterConsume3(_ x: borrowing Klas
3630
3630
3631
3631
public func closureVarAndClosureCaptureClassArgUseAfterConsume( _ x2: borrowing Klass ) {
3632
3632
// expected-error @-1 {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3633
- // expected-error @-2 {{'x2' is borrowed and cannot be consumed by closure capture }}
3634
- // expected-error @-3 {{'x2' is borrowed and cannot be consumed by closure capture }}
3633
+ // expected-error @-2 {{'x2' cannot be captured by an escaping closure since it is a borrowed parameter }}
3634
+ // expected-error @-3 {{'x2' cannot be captured by an escaping closure since it is a borrowed parameter }}
3635
3635
var f = { }
3636
3636
f = { // expected-note {{closure capturing 'x2' here}}
3637
3637
var g = { }
@@ -3764,8 +3764,8 @@ public func closureVarAndClosureLetCaptureClassUseAfterConsume3(_ x: borrowing K
3764
3764
3765
3765
public func closureVarAndClosureLetCaptureClassArgUseAfterConsume( _ x2: borrowing Klass ) {
3766
3766
// expected-error @-1 {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3767
- // expected-error @-2 {{'x2' is borrowed and cannot be consumed by closure capture }}
3768
- // expected-error @-3 {{'x2' is borrowed and cannot be consumed by closure capture }}
3767
+ // expected-error @-2 {{'x2' cannot be captured by an escaping closure since it is a borrowed parameter }}
3768
+ // expected-error @-3 {{'x2' cannot be captured by an escaping closure since it is a borrowed parameter }}
3769
3769
var f = { }
3770
3770
f = { // expected-note {{closure capturing 'x2' here}}
3771
3771
let g = { // expected-note {{closure capturing 'x2' here}}
@@ -3893,8 +3893,8 @@ public func closureLetAndClosureVarCaptureClassUseAfterConsume3(_ x: borrowing K
3893
3893
3894
3894
public func closureLetAndClosureVarCaptureClassArgUseAfterConsume( _ x2: borrowing Klass ) {
3895
3895
// expected-error @-1 {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3896
- // expected-error @-2 {{'x2' is borrowed and cannot be consumed by closure capture }}
3897
- // expected-error @-3 {{'x2' is borrowed and cannot be consumed by closure capture }}
3896
+ // expected-error @-2 {{'x2' cannot be captured by an escaping closure since it is a borrowed parameter }}
3897
+ // expected-error @-3 {{'x2' cannot be captured by an escaping closure since it is a borrowed parameter }}
3898
3898
let f = { // expected-note {{closure capturing 'x2' here}}
3899
3899
var g = { }
3900
3900
g = { // expected-note {{closure capturing 'x2' here}}
0 commit comments