@@ -42,10 +42,9 @@ struct NE {
4242 }
4343}
4444
45- func bv_assign_inout( bv: BV , other: inout BV ) {
46- other = bv // expected-error{{lifetime-dependent value escapes its scope}}
47- // expected-note @-2 {{it depends on the lifetime of argument 'bv'}}
48- // expected-note @-2 {{this use causes the lifetime-dependent value to escape}}
45+ func bv_assign_inout( bv: BV , other: inout BV ) { // expected-error{{lifetime-dependent variable 'bv' escapes its scope}}
46+ // expected-note @-1 {{it depends on the lifetime of argument 'bv'}}
47+ other = bv // expected-note {{this use causes the lifetime-dependent value to escape}}
4948}
5049
5150func bvmut_assign_inout( bv: inout BV , other: inout BV ) {
@@ -60,10 +59,9 @@ func bvcons_assign_inout(bv: consuming BV, other: inout BV) {
6059 // expected-note @-2 {{this use causes the lifetime-dependent value to escape}}
6160}
6261
63- func bv_assign_field( bv: BV , other: inout NE ) {
64- other. bv = bv // expected-error{{lifetime-dependent value escapes its scope}}
65- // expected-note @-2 {{it depends on the lifetime of argument 'bv'}}
66- // expected-note @-2 {{this use causes the lifetime-dependent value to escape}}
62+ func bv_assign_field( bv: BV , other: inout NE ) { // expected-error{{lifetime-dependent variable 'bv' escapes its scope}}
63+ // expected-note @-1 {{it depends on the lifetime of argument 'bv'}}
64+ other. bv = bv // expected-note {{this use causes the lifetime-dependent value to escape}}
6765}
6866
6967func bvmut_assign_field( bv: inout BV , other: inout NE ) {
@@ -78,10 +76,9 @@ func bvcons_assign_field(bv: consuming BV, other: inout NE) {
7876 // expected-note @-2 {{this use causes the lifetime-dependent value to escape}}
7977}
8078
81- func bv_capture_escape( bv: BV ) -> ( ) -> Int {
82- return { bv. c } // expected-error{{lifetime-dependent value escapes its scope}}
83- // expected-note @-2 {{it depends on the lifetime of argument 'bv'}}
84- // expected-note @-2 {{this use causes the lifetime-dependent value to escape}}
79+ func bv_capture_escape( bv: BV ) -> ( ) -> Int { // expected-error{{lifetime-dependent variable 'bv' escapes its scope}}
80+ // expected-note @-1 {{it depends on the lifetime of argument 'bv'}}
81+ return { bv. c } // expected-note {{this use causes the lifetime-dependent value to escape}}
8582}
8683
8784// FIXME: Our debug locations on closure captures are incorrect.
@@ -92,10 +89,9 @@ func bvcons_capture_escape(bv: consuming BV) -> ()->Int { // expected-error *{{l
9289 return { bv. c }
9390}
9491
95- func bv_capture_escapelet( bv: BV ) -> ( ) -> Int {
96- let closure = { bv. c } // expected-error{{lifetime-dependent value escapes its scope}}
97- // expected-note @-2 {{it depends on the lifetime of argument 'bv'}}
98- // expected-note @-2 {{this use causes the lifetime-dependent value to escape}}
92+ func bv_capture_escapelet( bv: BV ) -> ( ) -> Int { // expected-error{{lifetime-dependent variable 'bv' escapes its scope}}
93+ // expected-note @-1 {{it depends on the lifetime of argument 'bv'}}
94+ let closure = { bv. c } // expected-note {{this use causes the lifetime-dependent value to escape}}
9995 return closure
10096}
10197
0 commit comments