@@ -377,47 +377,38 @@ public func classAssignToVar5Arg2(_ x: __shared Klass, _ x2: inout Klass) { // e
377377
378378public func classAccessAccessField( _ x: __shared Klass) { // expected-error {{'x' has guaranteed ownership but was consumed}}
379379 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}}
382380 x2 = Klass ( )
383- borrowVal ( x2. k) // expected-note {{consuming use here}}
381+ borrowVal ( x2. k)
384382 for _ in 0 ..< 1024 {
385- borrowVal ( x2. k) // expected-note {{consuming use here}}
383+ borrowVal ( x2. k)
386384 }
387385}
388386
389387public 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}}
393388 for _ in 0 ..< 1024 {
394- borrowVal ( x2. k) // expected-note {{consuming use here}}
389+ borrowVal ( x2. k)
395390 }
396391}
397392
398393public func classAccessConsumeField( _ x: __shared Klass) { // expected-error {{'x' has guaranteed ownership but was consumed}}
399394 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}}
402395 x2 = Klass ( )
403396 // 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)
405398 // 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}}
406399 for _ in 0 ..< 1024 {
407- consumeVal ( x2. k) // expected-note {{consuming use here}}
400+ consumeVal ( x2. k)
408401 // 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}}
409402 }
410403}
411404
412405public 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}}
415406 // 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)
417408 // 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}}
418409
419410 for _ in 0 ..< 1024 {
420- consumeVal ( x2. k) // expected-note {{consuming use here}}
411+ consumeVal ( x2. k)
421412 // 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}}
422413 }
423414}
@@ -682,45 +673,37 @@ public func finalClassAssignToVar5Arg2(_ x2: inout FinalKlass) {
682673
683674public func finalClassAccessField( ) {
684675 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}}
687676 x2 = FinalKlass ( )
688- borrowVal ( x2. k) // expected-note {{consuming use here}}
677+ borrowVal ( x2. k)
689678 for _ in 0 ..< 1024 {
690- borrowVal ( x2. k) // expected-note {{consuming use here}}
679+ borrowVal ( x2. k)
691680 }
692681}
693682
694683public 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)
698685 for _ in 0 ..< 1024 {
699- borrowVal ( x2. k) // expected-note {{consuming use here}}
686+ borrowVal ( x2. k)
700687 }
701688}
702689
703690public func finalClassConsumeField( ) {
704691 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}}
707692 x2 = FinalKlass ( )
708693
709- consumeVal ( x2. k) // expected-note {{consuming use here}}
694+ consumeVal ( x2. k)
710695 // 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}}
711696 for _ in 0 ..< 1024 {
712- consumeVal ( x2. k) // expected-note {{consuming use here}}
697+ consumeVal ( x2. k)
713698 // 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}}
714699 }
715700}
716701
717702public 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)
721704 // 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}}
722705 for _ in 0 ..< 1024 {
723- consumeVal ( x2. k) // expected-note {{consuming use here}}
706+ consumeVal ( x2. k)
724707 // 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}}
725708 }
726709}
0 commit comments