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
2
2
3
3
// REQUIRES: swift_feature_BuiltinModule
4
4
// REQUIRES: swift_feature_AddressableTypes
@@ -69,12 +69,14 @@ struct Schmector {
69
69
// CHECK-SAME: (@in_guaranteed Schmector) ->
70
70
@lifetime ( borrow self)
71
71
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 )
73
75
}
74
76
}
75
77
}
76
78
77
79
struct Spam : ~ Escapable {
78
- @_unsafeNonescapableResult
80
+ @lifetime ( borrow base )
79
81
init ( base: UnsafePointer < Int > , count: Int ) { }
80
82
}
You can’t perform that action at this time.
0 commit comments