46
46
@_addressableForDependencies
47
47
public struct InlineArray < let count: Int , Element: ~ Copyable> : ~ Copyable {
48
48
@usableFromInline
49
- internal let _storage : Builtin . FixedArray < count , Element >
49
+ internal var _storage : Builtin . FixedArray < count , Element >
50
50
}
51
51
52
52
@available ( SwiftStdlib 6 . 2 , * )
@@ -69,7 +69,7 @@ extension InlineArray where Element: ~Copyable {
69
69
@_alwaysEmitIntoClient
70
70
@_transparent
71
71
internal var _address : UnsafePointer < Element > {
72
- unsafe UnsafePointer< Element > ( Builtin . unprotectedAddressOfBorrow ( self ) )
72
+ unsafe UnsafePointer< Element > ( Builtin . unprotectedAddressOfBorrow ( _storage ) )
73
73
}
74
74
75
75
/// Returns a buffer pointer over the entire array.
@@ -86,7 +86,7 @@ extension InlineArray where Element: ~Copyable {
86
86
@_transparent
87
87
internal var _mutableAddress : UnsafeMutablePointer < Element > {
88
88
mutating get {
89
- unsafe UnsafeMutablePointer< Element > ( Builtin . unprotectedAddressOf ( & self ) )
89
+ unsafe UnsafeMutablePointer< Element > ( Builtin . unprotectedAddressOf ( & _storage ) )
90
90
}
91
91
}
92
92
@@ -147,7 +147,7 @@ extension InlineArray where Element: ~Copyable {
147
147
@_alwaysEmitIntoClient
148
148
public init < E: Error > ( _ body: ( Index ) throws ( E ) -> Element ) throws ( E) {
149
149
#if $BuiltinEmplaceTypedThrows
150
- self = try Builtin . emplace { ( rawPtr) throws ( E) -> ( ) in
150
+ _storage = try Builtin . emplace { ( rawPtr) throws ( E) -> ( ) in
151
151
let buffer = unsafe Self. _initializationBuffer ( start: rawPtr)
152
152
153
153
for i in 0 ..< count {
@@ -204,7 +204,7 @@ extension InlineArray where Element: ~Copyable {
204
204
// and take the underlying value within the closure.
205
205
var o : Element ? = first
206
206
207
- self = try Builtin . emplace { ( rawPtr) throws ( E) -> ( ) in
207
+ _storage = try Builtin . emplace { ( rawPtr) throws ( E) -> ( ) in
208
208
let buffer = unsafe Self. _initializationBuffer ( start: rawPtr)
209
209
210
210
guard Self . count > 0 else {
@@ -248,7 +248,7 @@ extension InlineArray where Element: Copyable {
248
248
@_alwaysEmitIntoClient
249
249
public init ( repeating value: Element ) {
250
250
#if $ValueGenericsNameLookup
251
- self = Builtin . emplace {
251
+ _storage = Builtin . emplace {
252
252
let buffer = unsafe Self. _initializationBuffer ( start: $0)
253
253
254
254
unsafe buffer. initialize ( repeating: value)
0 commit comments