File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1- // RUN: %target-swift-frontend -emit-sil -enable-experimental-feature BuiltinModule -enable-experimental-feature LifetimeDependence -enable-experimental-feature AddressableTypes -enable-experimental-feature ValueGenerics %s | %FileCheck %s
1+ // RUN: %target-swift-frontend -emit-sil -disable-access-control - enable-experimental-feature BuiltinModule -enable-experimental-feature LifetimeDependence -enable-experimental-feature AddressableTypes -enable-experimental-feature ValueGenerics %s | %FileCheck %s
22
33// REQUIRES: swift_feature_BuiltinModule
44// REQUIRES: swift_feature_AddressableTypes
@@ -69,12 +69,14 @@ struct Schmector {
6969 // CHECK-SAME: (@in_guaranteed Schmector) ->
7070 @lifetime ( borrow self)
7171 borrowing get {
72- return Spam ( base: UnsafePointer ( Builtin . addressOfBorrow ( self ) ) , count: 10 )
72+ let pointer = UnsafePointer < Int > ( Builtin . addressOfBorrow ( self ) )
73+ let spam = Spam ( base: pointer, count: 10 )
74+ return _overrideLifetime ( spam, borrowing: self )
7375 }
7476 }
7577}
7678
7779struct Spam : ~ Escapable {
78- @_unsafeNonescapableResult
80+ @lifetime ( borrow base )
7981 init ( base: UnsafePointer < Int > , count: Int ) { }
8082}
You can’t perform that action at this time.
0 commit comments