Skip to content

Commit

Permalink
[BitwiseCopyable] Deprecate unbound overloads.
Browse files Browse the repository at this point in the history
The unconstrained overloads of loadUnaligned and storeBytes were
deprecated in SE-0426.
  • Loading branch information
nate-chandler committed Apr 24, 2024
1 parent 175a463 commit b146ade
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions stdlib/public/core/UnsafeBufferPointerSlice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,9 @@ extension Slice where Base == UnsafeMutableRawBufferPointer {
}
@inlinable
@_alwaysEmitIntoClient
@available(swift, deprecated: 6, message:
"Use the BitwiseCopyable-constrained overload"
)
public func loadUnaligned<T>(
fromByteOffset offset: Int = 0,
as type: T.Type
Expand Down Expand Up @@ -626,6 +629,9 @@ extension Slice where Base == UnsafeRawBufferPointer {
}
@inlinable
@_alwaysEmitIntoClient
@available(swift, deprecated: 6, message:
"Use the BitwiseCopyable-constrained overload"
)
public func loadUnaligned<T>(
fromByteOffset offset: Int = 0,
as type: T.Type
Expand Down
3 changes: 3 additions & 0 deletions stdlib/public/core/UnsafeRawBufferPointer.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,9 @@ extension Unsafe${Mutable}RawBufferPointer {
}

@_alwaysEmitIntoClient
@available(swift, deprecated: 6, message:
"Use the BitwiseCopyable-constrained overload"
)
public func loadUnaligned<T>(
fromByteOffset offset: Int = 0,
as type: T.Type
Expand Down
9 changes: 9 additions & 0 deletions stdlib/public/core/UnsafeRawPointer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,9 @@ extension UnsafeRawPointer {
/// with the value in the range of memory referenced by this pointer.
@inlinable
@_alwaysEmitIntoClient
@available(swift, deprecated: 6, message:
"Use the BitwiseCopyable-constrained overload"
)
public func loadUnaligned<T>(
fromByteOffset offset: Int = 0,
as type: T.Type
Expand Down Expand Up @@ -1341,6 +1344,9 @@ extension UnsafeMutableRawPointer {
/// with the value in the range of memory referenced by this pointer.
@inlinable
@_alwaysEmitIntoClient
@available(swift, deprecated: 6, message:
"Use the BitwiseCopyable-constrained overload"
)
public func loadUnaligned<T>(
fromByteOffset offset: Int = 0,
as type: T.Type
Expand Down Expand Up @@ -1444,6 +1450,9 @@ extension UnsafeMutableRawPointer {
@_alwaysEmitIntoClient
// This custom silgen name is chosen to not interfere with the old ABI
@_silgen_name("_swift_se0349_UnsafeMutableRawPointer_storeBytes")
@available(swift, deprecated: 6, message:
"Use the BitwiseCopyable-constrained overload"
)
public func storeBytes<T>(
of value: T, toByteOffset offset: Int = 0, as type: T.Type
) {
Expand Down

0 comments on commit b146ade

Please sign in to comment.