@@ -607,10 +607,8 @@ func testConsumingEscapeClosureCaptureLet(_ f: consuming @escaping () -> ()) {
607
607
// CHECK: } // end sil function '$s16moveonly_closure29testGlobalClosureCaptureInOutyyAA9SingleEltVzFyycfU_'
608
608
var globalClosureCaptureInOut : ( ) -> ( ) = { }
609
609
func testGlobalClosureCaptureInOut( _ x: inout SingleElt ) {
610
- // expected-error @-1 {{'x' consumed but not reinitialized before end of function}}
611
- // expected-note @-2 {{'x' is declared 'inout'}}
610
+ // expected-note @-1 {{'x' is declared 'inout'}}
612
611
globalClosureCaptureInOut = { // expected-error {{escaping closure captures 'inout' parameter 'x'}}
613
- // expected-note @-1 {{consuming use here}}
614
612
borrowVal ( x) // expected-note {{captured here}}
615
613
consumeVal ( x) // expected-note {{captured here}}
616
614
consumeVal ( x) // expected-note {{captured here}}
@@ -652,9 +650,7 @@ func testGlobalClosureCaptureInOut(_ x: inout SingleElt) {
652
650
// CHECK: } // end sil function '$s16moveonly_closure31testLocalLetClosureCaptureInOutyyAA9SingleEltVzFyycfU_'
653
651
func testLocalLetClosureCaptureInOut( _ x: inout SingleElt ) {
654
652
// expected-note @-1 {{'x' is declared 'inout'}}
655
- // expected-error @-2 {{'x' consumed but not reinitialized before end of function}}
656
653
let f = { // expected-error {{escaping closure captures 'inout' parameter 'x'}}
657
- // expected-note @-1 {{consuming use here}}
658
654
borrowVal ( x) // expected-note {{captured here}}
659
655
consumeVal ( x) // expected-note {{captured here}}
660
656
consumeVal ( x) // expected-note {{captured here}}
@@ -700,10 +696,8 @@ func testLocalLetClosureCaptureInOut(_ x: inout SingleElt) {
700
696
// CHECK: apply {{%.*}}([[LOADED_READ]], [[LOADED_TAKE]])
701
697
// CHECK: } // end sil function '$s16moveonly_closure31testLocalVarClosureCaptureInOutyyAA9SingleEltVzFyycfU_'
702
698
func testLocalVarClosureCaptureInOut( _ x: inout SingleElt ) {
703
- // expected-error @-1 {{'x' consumed but not reinitialized before end of function}}
704
- // expected-note @-2 {{'x' is declared 'inout'}}
705
- var f = { // expected-note {{consuming use here}}
706
- // expected-error @-1 {{escaping closure captures 'inout' parameter 'x'}}
699
+ // expected-note @-1 {{'x' is declared 'inout'}}
700
+ var f = { // expected-error {{escaping closure captures 'inout' parameter 'x'}}
707
701
borrowVal ( x) // expected-note {{captured here}}
708
702
consumeVal ( x) // expected-note {{captured here}}
709
703
consumeVal ( x) // expected-note {{captured here}}
@@ -750,10 +744,8 @@ func testLocalVarClosureCaptureInOut(_ x: inout SingleElt) {
750
744
// CHECK: apply {{%.*}}([[LOADED_READ]], [[LOADED_TAKE]])
751
745
// CHECK: } // end sil function '$s16moveonly_closure026testInOutVarClosureCapturedE0yyyycz_AA9SingleEltVztFyycfU_'
752
746
func testInOutVarClosureCaptureInOut( _ f: inout ( ) -> ( ) , _ x: inout SingleElt ) {
753
- // expected-error @-1 {{'x' consumed but not reinitialized before end of function}}
754
- // expected-note @-2 {{'x' is declared 'inout'}}
747
+ // expected-note @-1 {{'x' is declared 'inout'}}
755
748
f = { // expected-error {{escaping closure captures 'inout' parameter 'x'}}
756
- // expected-note @-1 {{consuming use here}}
757
749
borrowVal ( x) // expected-note {{captured here}}
758
750
consumeVal ( x) // expected-note {{captured here}}
759
751
consumeVal ( x) // expected-note {{captured here}}
@@ -805,9 +797,7 @@ func testInOutVarClosureCaptureInOut(_ f: inout () -> (), _ x: inout SingleElt)
805
797
// CHECK: } // end sil function '$s16moveonly_closure38testConsumingEscapeClosureCaptureInOutyyyycn_AA9SingleEltVztFyycfU_'
806
798
func testConsumingEscapeClosureCaptureInOut( _ f: consuming @escaping ( ) -> ( ) , _ x: inout SingleElt ) {
807
799
// expected-note @-1 {{'x' is declared 'inout'}}
808
- // expected-error @-2 {{'x' consumed but not reinitialized before end of function}}
809
800
f = { // expected-error {{escaping closure captures 'inout' parameter 'x'}}
810
- // expected-note @-1 {{consuming use here}}
811
801
borrowVal ( x) // expected-note {{captured here}}
812
802
consumeVal ( x) // expected-note {{captured here}}
813
803
consumeVal ( x) // expected-note {{captured here}}
0 commit comments