Skip to content

Commit a85caaf

Browse files
committed
Concurrency: Address new -strict-memory-safety warnings.
1 parent 6eacd23 commit a85caaf

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

stdlib/public/Concurrency/ContinuousClock.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ extension ContinuousClock: Clock {
144144
extension ContinuousClock {
145145
@available(SwiftStdlib 5.7, *)
146146
@_alwaysEmitIntoClient
147-
public var systemEpoch: Instant { unsafeBitCast(Duration.seconds(0), to: Instant.self) }
147+
public var systemEpoch: Instant {
148+
unsafe unsafeBitCast(Duration.seconds(0), to: Instant.self)
149+
}
148150
}
149151

150152
@available(SwiftStdlib 5.7, *)

stdlib/public/Concurrency/Executor.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ extension SerialExecutor {
385385
#if SWIFT_CONCURRENCY_USES_DISPATCH
386386
@available(SwiftStdlib 6.2, *)
387387
private var _dispatchQueue: OpaquePointer? {
388-
return _getDispatchQueueForExecutor(self.asUnownedSerialExecutor())
388+
return unsafe _getDispatchQueueForExecutor(self.asUnownedSerialExecutor())
389389
}
390390
#endif
391391

@@ -395,8 +395,8 @@ extension SerialExecutor {
395395
return true
396396
}
397397
#if SWIFT_CONCURRENCY_USES_DISPATCH
398-
if let rhsQueue = rhs._dispatchQueue {
399-
if let ourQueue = _dispatchQueue, ourQueue == rhsQueue {
398+
if let rhsQueue = unsafe rhs._dispatchQueue {
399+
if let ourQueue = unsafe _dispatchQueue, ourQueue == rhsQueue {
400400
return true
401401
}
402402
return false

stdlib/public/Concurrency/SuspendingClock.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ extension SuspendingClock: Clock {
132132
extension SuspendingClock {
133133
@available(SwiftStdlib 5.7, *)
134134
@_alwaysEmitIntoClient
135-
public var systemEpoch: Instant { unsafeBitCast(Duration.seconds(0), to: Instant.self) }
135+
public var systemEpoch: Instant {
136+
unsafe unsafeBitCast(Duration.seconds(0), to: Instant.self)
137+
}
136138
}
137139

138140
@available(SwiftStdlib 5.7, *)

0 commit comments

Comments
 (0)