@@ -3143,11 +3143,11 @@ func closureLetStoreClosureInVariableIsEscape() {
3143
3143
3144
3144
let f = {
3145
3145
borrowVal ( s)
3146
- consumeVal ( s) // expected-error {{noncopyable 's' cannot be consumed when captured by a closure}}
3146
+ consumeVal ( s) // expected-error {{noncopyable 's' cannot be consumed when captured by an escaping closure}}
3147
3147
}
3148
3148
let c = StoreClosure ( f: f)
3149
3149
_ = c
3150
- consumeVal ( s) // expected-error {{noncopyable 's' cannot be consumed when captured by a closure}}
3150
+ consumeVal ( s) // expected-error {{noncopyable 's' cannot be consumed when captured by an escaping closure}}
3151
3151
}
3152
3152
3153
3153
/////////////////////////////
@@ -3202,8 +3202,8 @@ public func closureVarCaptureClassUseAfterConsume() {
3202
3202
var f = { }
3203
3203
f = {
3204
3204
borrowVal ( x2)
3205
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3206
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3205
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3206
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3207
3207
}
3208
3208
f ( )
3209
3209
}
@@ -3214,7 +3214,7 @@ public func closureVarCaptureClassUseAfterConsume2() {
3214
3214
var f = { }
3215
3215
f = {
3216
3216
borrowVal ( x2)
3217
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3217
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3218
3218
}
3219
3219
f ( )
3220
3220
}
@@ -3225,12 +3225,12 @@ public func closureVarCaptureClassUseAfterConsumeError() {
3225
3225
var f = { }
3226
3226
f = {
3227
3227
borrowVal ( x2)
3228
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3229
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3228
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3229
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3230
3230
}
3231
3231
f ( )
3232
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3233
- let x3 = x2 // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3232
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3233
+ let x3 = x2 // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3234
3234
x2 = Klass ( )
3235
3235
let _ = x3
3236
3236
}
@@ -3458,7 +3458,7 @@ public func closureVarAndDeferCaptureClassUseAfterConsume2(_ x: borrowing Klass)
3458
3458
x2 = x // expected-note {{consumed here}}
3459
3459
var f = { }
3460
3460
f = {
3461
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3461
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3462
3462
defer {
3463
3463
borrowVal ( x2)
3464
3464
consumeVal ( x2) // expected-note {{consumed here}}
@@ -3479,7 +3479,7 @@ public func closureVarAndDeferCaptureClassUseAfterConsume3(_ x: borrowing Klass)
3479
3479
// expected-note @-1 {{consumed here}}
3480
3480
var f = { }
3481
3481
f = {
3482
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3482
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3483
3483
defer {
3484
3484
borrowVal ( x2)
3485
3485
consumeVal ( x2) // expected-note {{consumed here}}
@@ -3489,11 +3489,11 @@ public func closureVarAndDeferCaptureClassUseAfterConsume3(_ x: borrowing Klass)
3489
3489
print ( " foo " )
3490
3490
}
3491
3491
f ( )
3492
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3492
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3493
3493
}
3494
3494
3495
3495
public func closureVarAndDeferCaptureClassArgUseAfterConsume( _ x2: borrowing Klass ) {
3496
- // expected-error @-1 {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3496
+ // expected-error @-1 {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3497
3497
// expected-error @-2 {{'x2' cannot be captured by an escaping closure since it is a borrowed parameter}}
3498
3498
var f = { }
3499
3499
f = { // expected-note {{closure capturing 'x2' here}}
@@ -3508,7 +3508,7 @@ public func closureVarAndDeferCaptureClassArgUseAfterConsume(_ x2: borrowing Kla
3508
3508
}
3509
3509
3510
3510
public func closureVarAndDeferCaptureClassOwnedArgUseAfterConsume( _ x2: __owned Klass) {
3511
- // expected-error @-1 {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3511
+ // expected-error @-1 {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3512
3512
var f = { }
3513
3513
f = {
3514
3514
defer {
@@ -3539,7 +3539,7 @@ public func closureVarAndDeferCaptureClassOwnedArgUseAfterConsume2(_ x2: consumi
3539
3539
3540
3540
// TODO: MG
3541
3541
public func closureVarAndDeferCaptureClassOwnedArgUseAfterConsume3( _ x2: __owned Klass) {
3542
- // expected-error @-1 {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3542
+ // expected-error @-1 {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3543
3543
var f = { }
3544
3544
f = {
3545
3545
defer {
@@ -3550,7 +3550,7 @@ public func closureVarAndDeferCaptureClassOwnedArgUseAfterConsume3(_ x2: __owned
3550
3550
print ( " foo " )
3551
3551
}
3552
3552
f ( )
3553
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3553
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3554
3554
}
3555
3555
3556
3556
public func closureVarAndDeferCaptureClassOwnedArgUseAfterConsume4( _ x2: consuming Klass ) {
@@ -3567,7 +3567,7 @@ public func closureVarAndDeferCaptureClassOwnedArgUseAfterConsume4(_ x2: consumi
3567
3567
print ( " foo " )
3568
3568
}
3569
3569
f ( )
3570
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3570
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3571
3571
}
3572
3572
3573
3573
///////////////////////////////////////////
@@ -3582,11 +3582,11 @@ public func closureVarAndClosureCaptureClassUseAfterConsume(_ x: borrowing Klass
3582
3582
var g = { }
3583
3583
g = {
3584
3584
borrowVal ( x2)
3585
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3586
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3585
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3586
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3587
3587
}
3588
3588
g ( )
3589
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3589
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3590
3590
}
3591
3591
f ( )
3592
3592
}
@@ -3601,14 +3601,14 @@ public func closureVarAndClosureCaptureClassUseAfterConsume2(_ x: borrowing Klas
3601
3601
var g = { }
3602
3602
g = {
3603
3603
borrowVal ( x2)
3604
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3605
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3604
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3605
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3606
3606
}
3607
3607
g ( )
3608
3608
}
3609
3609
f ( )
3610
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3611
- let x3 = x2 // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3610
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3611
+ let x3 = x2 // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3612
3612
_ = x3
3613
3613
}
3614
3614
@@ -3623,19 +3623,19 @@ public func closureVarAndClosureCaptureClassUseAfterConsume3(_ x: borrowing Klas
3623
3623
var g = { }
3624
3624
g = {
3625
3625
borrowVal ( x2)
3626
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3627
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3626
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3627
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3628
3628
}
3629
3629
g ( )
3630
3630
}
3631
3631
f ( )
3632
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3633
- let x3 = x2 // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3632
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3633
+ let x3 = x2 // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3634
3634
_ = x3
3635
3635
}
3636
3636
3637
3637
public func closureVarAndClosureCaptureClassArgUseAfterConsume( _ x2: borrowing Klass ) {
3638
- // expected-error @-1 {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3638
+ // expected-error @-1 {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3639
3639
// expected-error @-2 {{'x2' cannot be captured by an escaping closure since it is a borrowed parameter}}
3640
3640
// expected-error @-3 {{'x2' cannot be captured by an escaping closure since it is a borrowed parameter}}
3641
3641
var f = { }
@@ -3657,8 +3657,8 @@ public func closureVarAndClosureCaptureClassOwnedArgUseAfterConsume(_ x2: __owne
3657
3657
var g = { }
3658
3658
g = {
3659
3659
borrowVal ( x2)
3660
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3661
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3660
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3661
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3662
3662
}
3663
3663
g ( )
3664
3664
}
@@ -3671,8 +3671,8 @@ public func closureVarAndClosureCaptureClassOwnedArgUseAfterConsume2(_ x2: consu
3671
3671
var g = { }
3672
3672
g = {
3673
3673
borrowVal ( x2)
3674
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3675
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3674
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3675
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3676
3676
}
3677
3677
g ( )
3678
3678
}
@@ -3685,13 +3685,13 @@ public func closureVarAndClosureCaptureClassOwnedArgUseAfterConsume3(_ x2: __own
3685
3685
var g = { }
3686
3686
g = {
3687
3687
borrowVal ( x2)
3688
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3689
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3688
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3689
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3690
3690
}
3691
3691
g ( )
3692
3692
}
3693
3693
f ( )
3694
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3694
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3695
3695
}
3696
3696
3697
3697
public func closureVarAndClosureCaptureClassOwnedArgUseAfterConsume4( _ x2: consuming Klass ) {
@@ -3700,13 +3700,13 @@ public func closureVarAndClosureCaptureClassOwnedArgUseAfterConsume4(_ x2: consu
3700
3700
var g = { }
3701
3701
g = {
3702
3702
borrowVal ( x2)
3703
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3704
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3703
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3704
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3705
3705
}
3706
3706
g ( )
3707
3707
}
3708
3708
f ( )
3709
- consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by a closure}}
3709
+ consumeVal ( x2) // expected-error {{noncopyable 'x2' cannot be consumed when captured by an escaping closure}}
3710
3710
}
3711
3711
3712
3712
/////////////////////////////
@@ -4106,14 +4106,14 @@ func inoutCaptureTest() -> (() -> ()) {
4106
4106
4107
4107
borrowVal ( x)
4108
4108
consumeVal ( x)
4109
- // expected-error @-1 {{noncopyable 'x' cannot be consumed when captured by a closure}}
4109
+ // expected-error @-1 {{noncopyable 'x' cannot be consumed when captured by an escaping closure}}
4110
4110
x = NonTrivialStruct ( )
4111
4111
4112
4112
let g = {
4113
4113
x = NonTrivialStruct ( )
4114
4114
useInOut ( & x)
4115
4115
consumeVal ( x)
4116
- // expected-error @-1 {{noncopyable 'x' cannot be consumed when captured by a closure}}
4116
+ // expected-error @-1 {{noncopyable 'x' cannot be consumed when captured by an escaping closure}}
4117
4117
}
4118
4118
g ( )
4119
4119
@@ -4130,13 +4130,13 @@ func inoutCaptureTestAddressOnlyGeneric<T : P>(_ t: T.Type) -> (() -> ()) {
4130
4130
}
4131
4131
4132
4132
borrowVal ( x)
4133
- consumeVal ( x) // expected-error {{noncopyable 'x' cannot be consumed when captured by a closure}}
4133
+ consumeVal ( x) // expected-error {{noncopyable 'x' cannot be consumed when captured by an escaping closure}}
4134
4134
x = AddressOnlyGeneric < T > ( )
4135
4135
4136
4136
let g = {
4137
4137
x = AddressOnlyGeneric < T > ( )
4138
4138
useInOut ( & x)
4139
- consumeVal ( x) // expected-error {{noncopyable 'x' cannot be consumed when captured by a closure}}
4139
+ consumeVal ( x) // expected-error {{noncopyable 'x' cannot be consumed when captured by an escaping closure}}
4140
4140
}
4141
4141
g ( )
4142
4142
0 commit comments