Skip to content

Commit 0da95eb

Browse files
committed
[Concurrency] Fix some warnings, use typed throws.
Fix a couple of `unsafe` warnings. Also update `withUnsafeExecutorPrivateData` to use typed throws instead of `rethrow`. rdar://141348916
1 parent fb0396c commit 0da95eb

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

stdlib/public/Concurrency/CooperativeExecutor.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ extension ExecutorJob {
7474
let ptr: UnsafeMutablePointer<CooperativeExecutor.Timestamp>
7575
// Try to use the task allocator if it has one
7676
if let allocator {
77-
ptr = unsafe allocator.allocate(as: CooperativeExecutor.Timestamp.self)
77+
unsafe ptr = allocator.allocate(as: CooperativeExecutor.Timestamp.self)
7878
} else {
79-
ptr = .allocate(capacity: 1)
79+
unsafe ptr = .allocate(capacity: 1)
8080
}
8181
unsafe self.cooperativeExecutorTimestampPointer = ptr
8282
}

stdlib/public/Concurrency/PartialAsyncTask.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ public struct ExecutorJob: Sendable, ~Copyable {
323323
///
324324
/// Returns the result of executing the closure.
325325
@available(SwiftStdlib 6.2, *)
326-
public func withUnsafeExecutorPrivateData<R>(body: (UnsafeMutableRawBufferPointer) throws -> R) rethrows -> R {
326+
public func withUnsafeExecutorPrivateData<R, E>(body: (UnsafeMutableRawBufferPointer) throws(E) -> R) throws(E) -> R {
327327
let base = unsafe _jobGetExecutorPrivateData(self.context)
328328
let size = unsafe 2 * MemoryLayout<OpaquePointer>.stride
329329
return unsafe try body(UnsafeMutableRawBufferPointer(start: base,

test/abi/Inputs/macOS/arm64/concurrency/baseline-asserts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ _$ss11ClockTraitsVSYsMc
410410
_$ss11ClockTraitsVs10SetAlgebrasMc
411411
_$ss11ClockTraitsVs25ExpressibleByArrayLiteralsMc
412412
_$ss11ClockTraitsVs9OptionSetsMc
413-
_$ss11ExecutorJobV010withUnsafeA11PrivateData4bodyxxSwKXE_tKlF
413+
_$ss11ExecutorJobV010withUnsafeA11PrivateData4bodyxxSwq_YKXE_tq_YKs5ErrorR_r0_lF
414414
_$ss11ExecutorJobV11descriptionSSvg
415415
_$ss11ExecutorJobV14LocalAllocatorV10deallocateyySpyxGlF
416416
_$ss11ExecutorJobV14LocalAllocatorV10deallocateyySryxGlF

test/abi/Inputs/macOS/x86_64/concurrency/baseline-asserts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ _$ss11ClockTraitsVSYsMc
410410
_$ss11ClockTraitsVs10SetAlgebrasMc
411411
_$ss11ClockTraitsVs25ExpressibleByArrayLiteralsMc
412412
_$ss11ClockTraitsVs9OptionSetsMc
413-
_$ss11ExecutorJobV010withUnsafeA11PrivateData4bodyxxSwKXE_tKlF
413+
_$ss11ExecutorJobV010withUnsafeA11PrivateData4bodyxxSwq_YKXE_tq_YKs5ErrorR_r0_lF
414414
_$ss11ExecutorJobV11descriptionSSvg
415415
_$ss11ExecutorJobV14LocalAllocatorV10deallocateyySpyxGlF
416416
_$ss11ExecutorJobV14LocalAllocatorV10deallocateyySryxGlF

0 commit comments

Comments
 (0)