Skip to content

Commit b12def9

Browse files
committed
[BitwiseCopyable] Deprecate unbound overloads.
The unconstrained overloads of loadUnaligned and storeBytes were deprecated in SE-0426.
1 parent f9ad81e commit b12def9

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

stdlib/public/core/UnsafeBufferPointerSlice.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,9 @@ extension Slice where Base == UnsafeMutableRawBufferPointer {
389389
}
390390
@inlinable
391391
@_alwaysEmitIntoClient
392+
@available(swift, deprecated: 6, message:
393+
"Use the BitwiseCopyable-constrained overload"
394+
)
392395
public func loadUnaligned<T>(
393396
fromByteOffset offset: Int = 0,
394397
as type: T.Type
@@ -626,6 +629,9 @@ extension Slice where Base == UnsafeRawBufferPointer {
626629
}
627630
@inlinable
628631
@_alwaysEmitIntoClient
632+
@available(swift, deprecated: 6, message:
633+
"Use the BitwiseCopyable-constrained overload"
634+
)
629635
public func loadUnaligned<T>(
630636
fromByteOffset offset: Int = 0,
631637
as type: T.Type

stdlib/public/core/UnsafeRawBufferPointer.swift.gyb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,9 @@ extension Unsafe${Mutable}RawBufferPointer {
450450
}
451451

452452
@_alwaysEmitIntoClient
453+
@available(swift, deprecated: 6, message:
454+
"Use the BitwiseCopyable-constrained overload"
455+
)
453456
public func loadUnaligned<T>(
454457
fromByteOffset offset: Int = 0,
455458
as type: T.Type

stdlib/public/core/UnsafeRawPointer.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,9 @@ extension UnsafeRawPointer {
510510
/// with the value in the range of memory referenced by this pointer.
511511
@inlinable
512512
@_alwaysEmitIntoClient
513+
@available(swift, deprecated: 6, message:
514+
"Use the BitwiseCopyable-constrained overload"
515+
)
513516
public func loadUnaligned<T>(
514517
fromByteOffset offset: Int = 0,
515518
as type: T.Type
@@ -1341,6 +1344,9 @@ extension UnsafeMutableRawPointer {
13411344
/// with the value in the range of memory referenced by this pointer.
13421345
@inlinable
13431346
@_alwaysEmitIntoClient
1347+
@available(swift, deprecated: 6, message:
1348+
"Use the BitwiseCopyable-constrained overload"
1349+
)
13441350
public func loadUnaligned<T>(
13451351
fromByteOffset offset: Int = 0,
13461352
as type: T.Type
@@ -1444,6 +1450,9 @@ extension UnsafeMutableRawPointer {
14441450
@_alwaysEmitIntoClient
14451451
// This custom silgen name is chosen to not interfere with the old ABI
14461452
@_silgen_name("_swift_se0349_UnsafeMutableRawPointer_storeBytes")
1453+
@available(swift, deprecated: 6, message:
1454+
"Use the BitwiseCopyable-constrained overload"
1455+
)
14471456
public func storeBytes<T>(
14481457
of value: T, toByteOffset offset: Int = 0, as type: T.Type
14491458
) {

0 commit comments

Comments
 (0)