File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
test/SILOptimizer/lifetime_dependence Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -54,11 +54,9 @@ func testUBPStorageCopy(ubp: UnsafeRawBufferPointer) -> RawSpan {
5454
5555@available ( SwiftStdlib 6 . 2 , * )
5656func testUBPStorageEscape( array: [ Int64 ] ) {
57- var span = RawSpan ( )
58- array. withUnsafeBytes {
59- span = $0. storage // expected-error {{lifetime-dependent value escapes its scope}}
60- // expected-note @-2{{it depends on the lifetime of argument '$0'}}
61- // expected-note @-2{{this use causes the lifetime-dependent value to escape}}
62- }
57+ var span = RawSpan ( ) // expected-error{{lifetime-dependent variable 'span' escapes its scope}}
58+ array. withUnsafeBytes { // expected-note{{it depends on the lifetime of argument '$0'}}
59+ span = $0. storage
60+ } // expected-note{{this use causes the lifetime-dependent value to escape}}
6361 read ( span)
6462}
You can’t perform that action at this time.
0 commit comments