File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,12 @@ func bv_copy(_ bv: borrowing BV) -> dependsOn(bv) BV {
2222 copy bv
2323}
2424
25+ struct NCInt : ~ Copyable {
26+ var value : Int
27+ }
28+
29+ func takeClosure( _: ( ) -> ( ) ) { }
30+
2531// No mark_dependence is needed for a inherited scope.
2632//
2733// CHECK-LABEL: sil hidden @$s4test14bv_borrow_copyyAA2BVVADYlsF : $@convention(thin) (@guaranteed BV) -> _scope(1) @owned BV {
@@ -45,3 +51,10 @@ func bv_borrow_copy(_ bv: borrowing BV) -> dependsOn(scoped bv) BV {
4551func bv_borrow_borrow( bv: borrowing BV ) -> dependsOn ( scoped bv) BV {
4652 bv_borrow_copy ( bv)
4753}
54+
55+ // This already has a mark_dependence [nonescaping] before diagnostics. If it triggers diagnostics again, it will fail
56+ // because lifetime dependence does not expect a dependence directly on an 'inout' address without any 'begin_access'
57+ // marker.
58+ func ncint_capture( ncInt: inout NCInt ) {
59+ takeClosure { _ = ncInt. value }
60+ }
You can’t perform that action at this time.
0 commit comments