@@ -377,47 +377,38 @@ public func classAssignToVar5Arg2(_ x: __shared Klass, _ x2: inout Klass) { // e
377
377
378
378
public func classAccessAccessField( _ x: __shared Klass) { // expected-error {{'x' has guaranteed ownership but was consumed}}
379
379
var x2 = x // expected-note {{consuming use here}}
380
- // expected-error @-1 {{'x2' has consuming use that cannot be eliminated due to a tight exclusivity scope}}
381
- // expected-error @-2 {{'x2' has consuming use that cannot be eliminated due to a tight exclusivity scope}}
382
380
x2 = Klass ( )
383
- borrowVal ( x2. k) // expected-note {{consuming use here}}
381
+ borrowVal ( x2. k)
384
382
for _ in 0 ..< 1024 {
385
- borrowVal ( x2. k) // expected-note {{consuming use here}}
383
+ borrowVal ( x2. k)
386
384
}
387
385
}
388
386
389
387
public func classAccessAccessFieldArg( _ x2: inout Klass ) {
390
- // expected-error @-1 {{'x2' has consuming use that cannot be eliminated due to a tight exclusivity scope}}
391
- // expected-error @-2 {{'x2' has consuming use that cannot be eliminated due to a tight exclusivity scope}}
392
- borrowVal ( x2. k) // expected-note {{consuming use here}}
393
388
for _ in 0 ..< 1024 {
394
- borrowVal ( x2. k) // expected-note {{consuming use here}}
389
+ borrowVal ( x2. k)
395
390
}
396
391
}
397
392
398
393
public func classAccessConsumeField( _ x: __shared Klass) { // expected-error {{'x' has guaranteed ownership but was consumed}}
399
394
var x2 = x // expected-note {{consuming use here}}
400
- // expected-error @-1 {{'x2' has consuming use that cannot be eliminated due to a tight exclusivity scope}}
401
- // expected-error @-2 {{'x2' has consuming use that cannot be eliminated due to a tight exclusivity scope}}
402
395
x2 = Klass ( )
403
396
// Since a class is a reference type, we do not emit an error here.
404
- consumeVal ( x2. k) // expected-note {{consuming use here}}
397
+ consumeVal ( x2. k)
405
398
// expected-error @-1 {{'x2.k' was consumed but it is illegal to consume a noncopyable class var field. One can only read from it or assign to it}}
406
399
for _ in 0 ..< 1024 {
407
- consumeVal ( x2. k) // expected-note {{consuming use here}}
400
+ consumeVal ( x2. k)
408
401
// expected-error @-1 {{'x2.k' was consumed but it is illegal to consume a noncopyable class var field. One can only read from it or assign to it}}
409
402
}
410
403
}
411
404
412
405
public func classAccessConsumeFieldArg( _ x2: inout Klass ) {
413
- // expected-error @-1 {{'x2' has consuming use that cannot be eliminated due to a tight exclusivity scope}}
414
- // expected-error @-2 {{'x2' has consuming use that cannot be eliminated due to a tight exclusivity scope}}
415
406
// Since a class is a reference type, we do not emit an error here.
416
- consumeVal ( x2. k) // expected-note {{consuming use here}}
407
+ consumeVal ( x2. k)
417
408
// expected-error @-1 {{'x2.k' was consumed but it is illegal to consume a noncopyable class var field. One can only read from it or assign to it}}
418
409
419
410
for _ in 0 ..< 1024 {
420
- consumeVal ( x2. k) // expected-note {{consuming use here}}
411
+ consumeVal ( x2. k)
421
412
// expected-error @-1 {{'x2.k' was consumed but it is illegal to consume a noncopyable class var field. One can only read from it or assign to it}}
422
413
}
423
414
}
@@ -682,45 +673,37 @@ public func finalClassAssignToVar5Arg2(_ x2: inout FinalKlass) {
682
673
683
674
public func finalClassAccessField( ) {
684
675
var x2 = FinalKlass ( )
685
- // expected-error @-1 {{'x2' has consuming use that cannot be eliminated due to a tight exclusivity scope}}
686
- // expected-error @-2 {{'x2' has consuming use that cannot be eliminated due to a tight exclusivity scope}}
687
676
x2 = FinalKlass ( )
688
- borrowVal ( x2. k) // expected-note {{consuming use here}}
677
+ borrowVal ( x2. k)
689
678
for _ in 0 ..< 1024 {
690
- borrowVal ( x2. k) // expected-note {{consuming use here}}
679
+ borrowVal ( x2. k)
691
680
}
692
681
}
693
682
694
683
public func finalClassAccessFieldArg( _ x2: inout FinalKlass ) {
695
- // expected-error @-1 {{'x2' has consuming use that cannot be eliminated due to a tight exclusivity scope}}
696
- // expected-error @-2 {{'x2' has consuming use that cannot be eliminated due to a tight exclusivity scope}}
697
- borrowVal ( x2. k) // expected-note {{consuming use here}}
684
+ borrowVal ( x2. k)
698
685
for _ in 0 ..< 1024 {
699
- borrowVal ( x2. k) // expected-note {{consuming use here}}
686
+ borrowVal ( x2. k)
700
687
}
701
688
}
702
689
703
690
public func finalClassConsumeField( ) {
704
691
var x2 = FinalKlass ( )
705
- // expected-error @-1 {{'x2' has consuming use that cannot be eliminated due to a tight exclusivity scope}}
706
- // expected-error @-2 {{'x2' has consuming use that cannot be eliminated due to a tight exclusivity scope}}
707
692
x2 = FinalKlass ( )
708
693
709
- consumeVal ( x2. k) // expected-note {{consuming use here}}
694
+ consumeVal ( x2. k)
710
695
// expected-error @-1 {{'x2.k' was consumed but it is illegal to consume a noncopyable class var field. One can only read from it or assign to it}}
711
696
for _ in 0 ..< 1024 {
712
- consumeVal ( x2. k) // expected-note {{consuming use here}}
697
+ consumeVal ( x2. k)
713
698
// expected-error @-1 {{'x2.k' was consumed but it is illegal to consume a noncopyable class var field. One can only read from it or assign to it}}
714
699
}
715
700
}
716
701
717
702
public func finalClassConsumeFieldArg( _ x2: inout FinalKlass ) {
718
- // expected-error @-1 {{'x2' has consuming use that cannot be eliminated due to a tight exclusivity scope}}
719
- // expected-error @-2 {{'x2' has consuming use that cannot be eliminated due to a tight exclusivity scope}}
720
- consumeVal ( x2. k) // expected-note {{consuming use here}}
703
+ consumeVal ( x2. k)
721
704
// expected-error @-1 {{'x2.k' was consumed but it is illegal to consume a noncopyable class var field. One can only read from it or assign to it}}
722
705
for _ in 0 ..< 1024 {
723
- consumeVal ( x2. k) // expected-note {{consuming use here}}
706
+ consumeVal ( x2. k)
724
707
// expected-error @-1 {{'x2.k' was consumed but it is illegal to consume a noncopyable class var field. One can only read from it or assign to it}}
725
708
}
726
709
}
0 commit comments