@@ -1161,19 +1161,24 @@ extension ContiguousArray {
1161
1161
) throws ( E) -> R {
1162
1162
return try unsafe _buffer. withUnsafeBufferPointer ( body)
1163
1163
}
1164
+ }
1164
1165
1165
- @available ( SwiftStdlib 6 . 2 , * )
1166
+ @available ( SwiftCompatibilitySpan 5 . 0 , * )
1167
+ @_originallyDefinedIn ( module: " Swift;CompatibilitySpan " , SwiftCompatibilitySpan 6 . 2 )
1168
+ extension ContiguousArray {
1169
+ @_alwaysEmitIntoClient
1166
1170
public var span : Span < Element > {
1167
1171
@lifetime ( borrow self)
1168
- @_alwaysEmitIntoClient
1169
1172
borrowing get {
1170
1173
let pointer = unsafe _buffer . firstElementAddress
1171
1174
let count = _buffer. immutableCount
1172
1175
let span = unsafe Span( _unsafeStart: pointer, count: count)
1173
1176
return unsafe _overrideLifetime ( span, borrowing: self )
1174
1177
}
1175
1178
}
1179
+ }
1176
1180
1181
+ extension ContiguousArray {
1177
1182
// Superseded by the typed-throws version of this function, but retained
1178
1183
// for ABI reasons.
1179
1184
@_semantics ( " array.withUnsafeMutableBufferPointer " )
@@ -1251,8 +1256,11 @@ extension ContiguousArray {
1251
1256
// Invoke the body.
1252
1257
return try unsafe body( & inoutBufferPointer)
1253
1258
}
1259
+ }
1254
1260
1255
- @available ( SwiftStdlib 6 . 2 , * )
1261
+ @available ( SwiftCompatibilitySpan 5 . 0 , * )
1262
+ @_originallyDefinedIn ( module: " Swift;CompatibilitySpan " , SwiftCompatibilitySpan 6 . 2 )
1263
+ extension ContiguousArray {
1256
1264
@_alwaysEmitIntoClient
1257
1265
public var mutableSpan : MutableSpan < Element > {
1258
1266
@lifetime ( & self )
@@ -1272,7 +1280,9 @@ extension ContiguousArray {
1272
1280
return unsafe _override Lifetime ( span, mutating: & self )
1273
1281
}
1274
1282
}
1283
+ }
1275
1284
1285
+ extension ContiguousArray {
1276
1286
@inlinable
1277
1287
public __consuming func _copyContents(
1278
1288
initializing buffer: UnsafeMutableBufferPointer < Element >
0 commit comments