@@ -42,10 +42,9 @@ struct NE {
42
42
}
43
43
}
44
44
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}}
49
48
}
50
49
51
50
func bvmut_assign_inout( bv: inout BV , other: inout BV ) {
@@ -60,10 +59,9 @@ func bvcons_assign_inout(bv: consuming BV, other: inout BV) {
60
59
// expected-note @-2 {{this use causes the lifetime-dependent value to escape}}
61
60
}
62
61
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}}
67
65
}
68
66
69
67
func bvmut_assign_field( bv: inout BV , other: inout NE ) {
@@ -78,10 +76,9 @@ func bvcons_assign_field(bv: consuming BV, other: inout NE) {
78
76
// expected-note @-2 {{this use causes the lifetime-dependent value to escape}}
79
77
}
80
78
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}}
85
82
}
86
83
87
84
// FIXME: Our debug locations on closure captures are incorrect.
@@ -92,10 +89,9 @@ func bvcons_capture_escape(bv: consuming BV) -> ()->Int { // expected-error *{{l
92
89
return { bv. c }
93
90
}
94
91
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}}
99
95
return closure
100
96
}
101
97
0 commit comments