@@ -180,14 +180,12 @@ struct Outer {
180
180
get { _innerObject }
181
181
}
182
182
183
- /* TODO: rdar://137608270 Add Builtin.addressof() support for @addressable arguments
184
- @addressableSelf
185
- var innerAddress: Inner {
183
+ var innerAddress : InnerTrivial {
184
+ @_addressableSelf
186
185
unsafeAddress {
187
- Builtin.addressof(inner )
186
+ UnsafePointer < InnerTrivial > ( Builtin . addressOfBorrow ( _innerTrivial ) )
188
187
}
189
188
}
190
- */
191
189
}
192
190
193
191
func parse( _ span: Span < Int > ) { }
@@ -577,26 +575,22 @@ func dependsOnAddressHelper(arg: @_addressable Holder) -> Span<Int> {
577
575
arg. span ( )
578
576
}
579
577
580
- /* TODO: requires -enable-address-dependencies
581
-
582
578
// Non-addressable error returning a Span.
583
579
@lifetime ( borrow arg)
584
580
func testTrivialNonAddressable( arg: TrivialHolder ) -> Span < Int > {
585
581
dependsOnTrivialAddressHelper ( arg: arg)
586
- // todo -error @-1{{lifetime-dependent value escapes its scope}
587
- // todo -note @-3{{it depends on the lifetime of variable 'arg'}}
588
- } // todo -note {{this use causes the lifetime-dependent value to escape}}
582
+ // expected -error @-1{{lifetime-dependent value escapes its scope} }
583
+ // expected -note @-3{{it depends on the lifetime of argument 'arg'}}
584
+ } // expected -note {{this use causes the lifetime-dependent value to escape}}
589
585
590
586
// Non-addressable error returning a Span.
591
587
@lifetime ( borrow arg)
592
588
func testNonAddressable( arg: Holder ) -> Span < Int > {
593
589
dependsOnAddressHelper ( arg: arg)
594
- // todo-error @-1{{lifetime-dependent value escapes its scope}
595
- // todo-note @-3{{it depends on the lifetime of variable 'arg'}}
596
- } // todo-note {{this use causes the lifetime-dependent value to escape}}
597
- */
590
+ // expected-error @-1{{lifetime-dependent value escapes its scope}}
591
+ // expected-note @-3{{it depends on the lifetime of argument 'arg'}}
592
+ } // expected-note {{this use causes the lifetime-dependent value to escape}}
598
593
599
- /* TODO: rdar://145872854 (SILGen: @addressable inout arguments are copied)
600
594
@lifetime ( borrow arg)
601
595
func test( arg: inout AddressableInt ) -> Span < Int > {
602
596
arg. span ( )
@@ -614,8 +608,6 @@ func testBorrowedAddressableInt(arg: Holder) -> Int {
614
608
@lifetime ( borrow arg)
615
609
func testBorrowedAddressableIntReturn( arg: Holder ) -> Span < Int > {
616
610
arg. addressableInt. span ( )
617
- // todo-error @-1{{lifetime-dependent value escapes its scope}
618
- // todo-note @-2{{it depends on the lifetime of this parent value}}
619
- } // todo-note {{this use causes the lifetime-dependent value to escape}}
620
-
621
- */
611
+ // expected-error @-1{{lifetime-dependent value escapes its scope}}
612
+ // expected-note @-3{{it depends on the lifetime of argument 'arg'}}
613
+ } // expected-note {{this use causes the lifetime-dependent value to escape}}
0 commit comments