Skip to content

Commit fcbd7db

Browse files
committed
[Concurrency] Support ~Copyable return type in withSerialExeutor
1 parent 84764de commit fcbd7db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/public/Concurrency/Executor.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ extension Actor {
102102
/// of the executor while performing the operation.
103103
@_alwaysEmitIntoClient
104104
@available(SwiftStdlib 5.1, *)
105-
public nonisolated func withSerialExecutor<T, E: Error>(_ operation: (any SerialExecutor) throws(E) -> T) throws(E) -> T {
105+
public nonisolated func withSerialExecutor<T: ~Copyable, E: Error>(_ operation: (any SerialExecutor) throws(E) -> T) throws(E) -> T {
106106
try operation(unsafe unsafeBitCast(self.unownedExecutor, to: (any SerialExecutor).self))
107107
}
108108

@@ -113,7 +113,7 @@ extension Actor {
113113
/// of the executor while performing the operation.
114114
@_alwaysEmitIntoClient
115115
@available(SwiftStdlib 5.1, *)
116-
public nonisolated func withSerialExecutor<T, E: Error>(_ operation: (any SerialExecutor) async throws(E) -> T) async throws(E) -> T {
116+
public nonisolated func withSerialExecutor<T: ~Copyable, E: Error>(_ operation: (any SerialExecutor) async throws(E) -> T) async throws(E) -> T {
117117
try await operation(unsafe unsafeBitCast(self.unownedExecutor, to: (any SerialExecutor).self))
118118
}
119119
}

0 commit comments

Comments
 (0)