Skip to content

Commit 4221d9f

Browse files
authored
Merge pull request #73734 from Azoy/bitwisecopyable-atomic-reps
[stdlib] Enforce that atomic representations are BitwiseCopyable
2 parents 3a3380f + 3053c81 commit 4221d9f

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

stdlib/public/Synchronization/AtomicOptional.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public protocol AtomicOptionalRepresentable: AtomicRepresentable {
1818
/// The storage representation type that encodes to and decodes from
1919
/// `Optional<Self>` which is a suitable type when used in atomic operations
2020
/// on `Optional`.
21-
associatedtype AtomicOptionalRepresentation
21+
associatedtype AtomicOptionalRepresentation: BitwiseCopyable
2222

2323
/// Destroys a value of `Self` and prepares an `AtomicOptionalRepresentation`
2424
/// storage type to be used for atomic operations on `Optional`.

stdlib/public/Synchronization/AtomicRepresentable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
public protocol AtomicRepresentable {
164164
/// The storage representation type that `Self` encodes to and decodes from
165165
/// which is a suitable type when used in atomic operations.
166-
associatedtype AtomicRepresentation
166+
associatedtype AtomicRepresentation: BitwiseCopyable
167167

168168
/// Destroys a value of `Self` and prepares an `AtomicRepresentation` storage
169169
/// type to be used for atomic operations.

stdlib/public/core/Policy.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@
6161
@frozen
6262
public enum Never {}
6363

64-
extension Never: Sendable { }
64+
extension Never: BitwiseCopyable {}
65+
66+
extension Never: Sendable {}
6567

6668
extension Never: Error {}
6769

0 commit comments

Comments
 (0)