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 {
22
22
copy bv
23
23
}
24
24
25
+ struct NCInt : ~ Copyable {
26
+ var value : Int
27
+ }
28
+
29
+ func takeClosure( _: ( ) -> ( ) ) { }
30
+
25
31
// No mark_dependence is needed for a inherited scope.
26
32
//
27
33
// 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 {
45
51
func bv_borrow_borrow( bv: borrowing BV ) -> dependsOn ( scoped bv) BV {
46
52
bv_borrow_copy ( bv)
47
53
}
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