Skip to content

Commit e3f5ce0

Browse files
committed
Concurrency: Restore -enable-experimental-feature IsolatedAny.
Supported older compilers don't enable this feature by default, so it can't be omitted from the `_Concurrency` module's flags (regression from #74543). Additionally, remove `@_allowFeatureSuppression(IsolatedAny)` from all declarations. We no longer need to support compilers that don't have the `IsolatedAny` feature, so the suppression is superfluous and the alternative branches didn't actually build anyways. _Additionally_, the suppressible feature logic could not handle suppressing `IsolatedAny` simultaneously with `SendingArgsAndResults`, resulting in a broken interface because `sending` was used outside `#if $SendingArgsAndResults` guards.
1 parent b0560f0 commit e3f5ce0

File tree

5 files changed

+6
-29
lines changed

5 files changed

+6
-29
lines changed

stdlib/public/Concurrency/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ else()
6060
list(APPEND SWIFT_RUNTIME_CONCURRENCY_C_FLAGS "-fswift-async-fp=never")
6161
endif()
6262

63+
# Do not remove until IsolatedAny is on by default in all supported compilers.
64+
list(APPEND SWIFT_RUNTIME_CONCURRENCY_SWIFT_FLAGS
65+
"-enable-experimental-feature"
66+
"IsolatedAny"
67+
)
68+
6369
list(APPEND SWIFT_RUNTIME_CONCURRENCY_C_FLAGS
6470
"-D__STDC_WANT_LIB_EXT1__=1")
6571

stdlib/public/Concurrency/DiscardingTaskGroup.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ public struct DiscardingTaskGroup {
192192
/// to set the child task's priority to the priority of the group.
193193
/// - operation: The operation to execute as part of the task group.
194194
@_alwaysEmitIntoClient
195-
@_allowFeatureSuppression(IsolatedAny)
196195
#if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
197196
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model", renamed: "addTask(operation:)")
198197
#endif
@@ -234,7 +233,6 @@ public struct DiscardingTaskGroup {
234233
/// - Returns: `true` if the child task was added to the group;
235234
/// otherwise `false`.
236235
@_alwaysEmitIntoClient
237-
@_allowFeatureSuppression(IsolatedAny)
238236
#if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
239237
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model", renamed: "addTask(operation:)")
240238
#endif
@@ -275,7 +273,6 @@ public struct DiscardingTaskGroup {
275273
}
276274

277275
@_alwaysEmitIntoClient
278-
@_allowFeatureSuppression(IsolatedAny)
279276
public mutating func addTask(
280277
operation: sending @escaping @isolated(any) () async -> Void
281278
) {
@@ -304,7 +301,6 @@ public struct DiscardingTaskGroup {
304301
#if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
305302
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model", renamed: "addTaskUnlessCancelled(operation:)")
306303
#endif
307-
@_allowFeatureSuppression(IsolatedAny)
308304
@_alwaysEmitIntoClient
309305
public mutating func addTaskUnlessCancelled(
310306
operation: sending @escaping @isolated(any) () async -> Void
@@ -756,7 +752,6 @@ public struct ThrowingDiscardingTaskGroup<Failure: Error> {
756752
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model", renamed: "addTask(operation:)")
757753
#endif
758754
@_alwaysEmitIntoClient
759-
@_allowFeatureSuppression(IsolatedAny)
760755
public mutating func addTask(
761756
priority: TaskPriority? = nil,
762757
operation: sending @escaping @isolated(any) () async throws -> Void
@@ -781,7 +776,6 @@ public struct ThrowingDiscardingTaskGroup<Failure: Error> {
781776
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model", renamed: "addTask(operation:)")
782777
#endif
783778
@_alwaysEmitIntoClient
784-
@_allowFeatureSuppression(IsolatedAny)
785779
public mutating func addTaskUnlessCancelled(
786780
priority: TaskPriority? = nil,
787781
operation: sending @escaping @isolated(any) () async throws -> Void

stdlib/public/Concurrency/Task.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,6 @@ extension Task where Failure == Never {
608608
#if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
609609
@discardableResult
610610
@_alwaysEmitIntoClient
611-
@_allowFeatureSuppression(IsolatedAny)
612611
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model")
613612
public init(
614613
priority: TaskPriority? = nil,
@@ -661,7 +660,6 @@ extension Task where Failure == Never {
661660
/// - operation: The operation to perform.
662661
@discardableResult
663662
@_alwaysEmitIntoClient
664-
@_allowFeatureSuppression(IsolatedAny)
665663
public init(
666664
priority: TaskPriority? = nil,
667665
@_inheritActorContext @_implicitSelfCapture operation: sending @escaping @isolated(any) () async -> Success
@@ -692,7 +690,6 @@ extension Task where Failure == Error {
692690
#if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
693691
@discardableResult
694692
@_alwaysEmitIntoClient
695-
@_allowFeatureSuppression(IsolatedAny)
696693
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model")
697694
public init(
698695
priority: TaskPriority? = nil,
@@ -745,7 +742,6 @@ extension Task where Failure == Error {
745742
/// - operation: The operation to perform.
746743
@discardableResult
747744
@_alwaysEmitIntoClient
748-
@_allowFeatureSuppression(IsolatedAny)
749745
public init(
750746
priority: TaskPriority? = nil,
751747
@_inheritActorContext @_implicitSelfCapture operation: sending @escaping @isolated(any) () async throws -> Success
@@ -778,7 +774,6 @@ extension Task where Failure == Never {
778774
#if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
779775
@discardableResult
780776
@_alwaysEmitIntoClient
781-
@_allowFeatureSuppression(IsolatedAny)
782777
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model")
783778
public static func detached(
784779
priority: TaskPriority? = nil,
@@ -828,7 +823,6 @@ extension Task where Failure == Never {
828823
/// - Returns: A reference to the task.
829824
@discardableResult
830825
@_alwaysEmitIntoClient
831-
@_allowFeatureSuppression(IsolatedAny)
832826
public static func detached(
833827
priority: TaskPriority? = nil,
834828
operation: sending @escaping @isolated(any) () async -> Success
@@ -859,7 +853,6 @@ extension Task where Failure == Error {
859853
#if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
860854
@discardableResult
861855
@_alwaysEmitIntoClient
862-
@_allowFeatureSuppression(IsolatedAny)
863856
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model")
864857
public static func detached(
865858
priority: TaskPriority? = nil,
@@ -911,7 +904,6 @@ extension Task where Failure == Error {
911904
/// - Returns: A reference to the task.
912905
@discardableResult
913906
@_alwaysEmitIntoClient
914-
@_allowFeatureSuppression(IsolatedAny)
915907
public static func detached(
916908
priority: TaskPriority? = nil,
917909
operation: sending @escaping @isolated(any) () async throws -> Success

stdlib/public/Concurrency/TaskGroup+TaskExecutor.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ extension TaskGroup {
3131
/// to set the child task's priority to the priority of the group.
3232
/// - operation: The operation to execute as part of the task group.
3333
@_alwaysEmitIntoClient
34-
@_allowFeatureSuppression(IsolatedAny)
3534
public mutating func addTask(
3635
executorPreference taskExecutor: (any TaskExecutor)?,
3736
priority: TaskPriority? = nil,
@@ -82,7 +81,6 @@ extension TaskGroup {
8281
/// - Returns: `true` if the child task was added to the group;
8382
/// otherwise `false`.
8483
@_alwaysEmitIntoClient
85-
@_allowFeatureSuppression(IsolatedAny)
8684
public mutating func addTaskUnlessCancelled(
8785
executorPreference taskExecutor: (any TaskExecutor)?,
8886
priority: TaskPriority? = nil,
@@ -146,7 +144,6 @@ extension ThrowingTaskGroup {
146144
/// to set the child task's priority to the priority of the group.
147145
/// - operation: The operation to execute as part of the task group.
148146
@_alwaysEmitIntoClient
149-
@_allowFeatureSuppression(IsolatedAny)
150147
public mutating func addTask(
151148
executorPreference taskExecutor: (any TaskExecutor)?,
152149
priority: TaskPriority? = nil,
@@ -194,7 +191,6 @@ extension ThrowingTaskGroup {
194191
/// - Returns: `true` if the child task was added to the group;
195192
/// otherwise `false`.
196193
@_alwaysEmitIntoClient
197-
@_allowFeatureSuppression(IsolatedAny)
198194
public mutating func addTaskUnlessCancelled(
199195
executorPreference taskExecutor: (any TaskExecutor)?,
200196
priority: TaskPriority? = nil,
@@ -258,7 +254,6 @@ extension DiscardingTaskGroup {
258254
/// to set the child task's priority to the priority of the group.
259255
/// - operation: The operation to execute as part of the task group.
260256
@_alwaysEmitIntoClient
261-
@_allowFeatureSuppression(IsolatedAny)
262257
public mutating func addTask(
263258
executorPreference taskExecutor: (any TaskExecutor)?,
264259
priority: TaskPriority? = nil,
@@ -311,7 +306,6 @@ extension DiscardingTaskGroup {
311306
/// - Returns: `true` if the child task was added to the group;
312307
/// otherwise `false`.
313308
@_alwaysEmitIntoClient
314-
@_allowFeatureSuppression(IsolatedAny)
315309
public mutating func addTaskUnlessCancelled(
316310
executorPreference taskExecutor: (any TaskExecutor)?,
317311
priority: TaskPriority? = nil,
@@ -375,7 +369,6 @@ extension ThrowingDiscardingTaskGroup {
375369
/// to set the child task's priority to the priority of the group.
376370
/// - operation: The operation to execute as part of the task group.
377371
@_alwaysEmitIntoClient
378-
@_allowFeatureSuppression(IsolatedAny)
379372
public mutating func addTask(
380373
executorPreference taskExecutor: (any TaskExecutor)?,
381374
priority: TaskPriority? = nil,
@@ -428,7 +421,6 @@ extension ThrowingDiscardingTaskGroup {
428421
/// - Returns: `true` if the child task was added to the group;
429422
/// otherwise `false`.
430423
@_alwaysEmitIntoClient
431-
@_allowFeatureSuppression(IsolatedAny)
432424
public mutating func addTaskUnlessCancelled(
433425
executorPreference taskExecutor: (any TaskExecutor)?,
434426
priority: TaskPriority? = nil,

stdlib/public/Concurrency/TaskGroup.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
326326
/// to set the child task's priority to the priority of the group.
327327
/// - operation: The operation to execute as part of the task group.
328328
@_alwaysEmitIntoClient
329-
@_allowFeatureSuppression(IsolatedAny)
330329
public mutating func addTask(
331330
priority: TaskPriority? = nil,
332331
operation: sending @escaping @isolated(any) () async -> ChildTaskResult
@@ -365,7 +364,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
365364
/// - Returns: `true` if the child task was added to the group;
366365
/// otherwise `false`.
367366
@_alwaysEmitIntoClient
368-
@_allowFeatureSuppression(IsolatedAny)
369367
public mutating func addTaskUnlessCancelled(
370368
priority: TaskPriority? = nil,
371369
operation: sending @escaping @isolated(any) () async -> ChildTaskResult
@@ -461,7 +459,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
461459
#else // if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
462460
@available(SwiftStdlib 5.7, *)
463461
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model", renamed: "addTask(operation:)")
464-
@_allowFeatureSuppression(IsolatedAny)
465462
public mutating func addTask(
466463
priority: TaskPriority? = nil,
467464
operation: sending @escaping @isolated(any) () async -> ChildTaskResult
@@ -474,7 +471,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
474471
/// - Parameters:
475472
/// - operation: The operation to execute as part of the task group.
476473
@_alwaysEmitIntoClient
477-
@_allowFeatureSuppression(IsolatedAny)
478474
public mutating func addTask(
479475
operation: sending @escaping @isolated(any) () async -> ChildTaskResult
480476
) {
@@ -509,7 +505,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
509505
/// - Returns: `true` if the child task was added to the group;
510506
/// otherwise `false`.
511507
@_alwaysEmitIntoClient
512-
@_allowFeatureSuppression(IsolatedAny)
513508
public mutating func addTaskUnlessCancelled(
514509
operation: sending @escaping @isolated(any) () async -> ChildTaskResult
515510
) -> Bool {
@@ -831,7 +826,6 @@ public struct ThrowingTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
831826
/// to set the child task's priority to the priority of the group.
832827
/// - operation: The operation to execute as part of the task group.
833828
@_alwaysEmitIntoClient
834-
@_allowFeatureSuppression(IsolatedAny)
835829
public mutating func addTask(
836830
priority: TaskPriority? = nil,
837831
operation: sending @escaping @isolated(any) () async throws -> ChildTaskResult
@@ -865,7 +859,6 @@ public struct ThrowingTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
865859
/// - Returns: `true` if the child task was added to the group;
866860
/// otherwise `false`.
867861
@_alwaysEmitIntoClient
868-
@_allowFeatureSuppression(IsolatedAny)
869862
public mutating func addTaskUnlessCancelled(
870863
priority: TaskPriority? = nil,
871864
operation: sending @escaping @isolated(any) () async throws -> ChildTaskResult

0 commit comments

Comments
 (0)