Skip to content

Commit 97d2f4f

Browse files
authored
Fix pointer auth issues for discarding task group operation pointer (#65220)
1 parent 3f0a57a commit 97d2f4f

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

stdlib/public/Concurrency/DiscardingTaskGroup.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ public struct DiscardingTaskGroup {
171171
#if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
172172
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model", renamed: "addTask(operation:)")
173173
#endif
174-
public mutating func addTask(
174+
public mutating func addTask<DiscardedResult>(
175175
priority: TaskPriority? = nil,
176-
operation: __owned @Sendable @escaping () async -> Void
176+
operation: __owned @Sendable @escaping () async -> DiscardedResult
177177
) {
178178
#if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
179179
let flags = taskCreateFlags(
@@ -206,9 +206,9 @@ public struct DiscardingTaskGroup {
206206
#if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
207207
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model", renamed: "addTask(operation:)")
208208
#endif
209-
public mutating func addTaskUnlessCancelled(
209+
public mutating func addTaskUnlessCancelled<DiscardedResult>(
210210
priority: TaskPriority? = nil,
211-
operation: __owned @Sendable @escaping () async -> Void
211+
operation: __owned @Sendable @escaping () async -> DiscardedResult
212212
) -> Bool {
213213
let canAdd = _taskGroupAddPendingTask(group: _group, unconditionally: false)
214214

@@ -237,8 +237,8 @@ public struct DiscardingTaskGroup {
237237
}
238238

239239
@_alwaysEmitIntoClient
240-
public mutating func addTask(
241-
operation: __owned @Sendable @escaping () async -> Void
240+
public mutating func addTask<DiscardedResult>(
241+
operation: __owned @Sendable @escaping () async -> DiscardedResult
242242
) {
243243
let flags = taskCreateFlags(
244244
priority: nil, isChildTask: true, copyTaskLocals: false,
@@ -260,8 +260,8 @@ public struct DiscardingTaskGroup {
260260
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model", renamed: "addTaskUnlessCancelled(operation:)")
261261
#endif
262262
@_alwaysEmitIntoClient
263-
public mutating func addTaskUnlessCancelled(
264-
operation: __owned @Sendable @escaping () async -> Void
263+
public mutating func addTaskUnlessCancelled<DiscardedResult>(
264+
operation: __owned @Sendable @escaping () async -> DiscardedResult
265265
) -> Bool {
266266
#if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
267267
let canAdd = _taskGroupAddPendingTask(group: _group, unconditionally: false)
@@ -547,9 +547,9 @@ public struct ThrowingDiscardingTaskGroup<Failure: Error> {
547547
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model", renamed: "addTask(operation:)")
548548
#endif
549549
@_alwaysEmitIntoClient
550-
public mutating func addTask(
550+
public mutating func addTask<DiscardedResult>(
551551
priority: TaskPriority? = nil,
552-
operation: __owned @Sendable @escaping () async throws -> Void
552+
operation: __owned @Sendable @escaping () async throws -> DiscardedResult
553553
) {
554554
#if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
555555
let flags = taskCreateFlags(
@@ -569,9 +569,9 @@ public struct ThrowingDiscardingTaskGroup<Failure: Error> {
569569
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model", renamed: "addTask(operation:)")
570570
#endif
571571
@_alwaysEmitIntoClient
572-
public mutating func addTaskUnlessCancelled(
572+
public mutating func addTaskUnlessCancelled<DiscardedResult>(
573573
priority: TaskPriority? = nil,
574-
operation: __owned @Sendable @escaping () async throws -> Void
574+
operation: __owned @Sendable @escaping () async throws -> DiscardedResult
575575
) -> Bool {
576576
#if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
577577
let canAdd = _taskGroupAddPendingTask(group: _group, unconditionally: false)

0 commit comments

Comments
 (0)