Skip to content

Commit d357be9

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 15fe6c8 commit d357be9

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
@@ -200,7 +200,6 @@ public struct DiscardingTaskGroup {
200200
/// to set the child task's priority to the priority of the group.
201201
/// - operation: The operation to execute as part of the task group.
202202
@_alwaysEmitIntoClient
203-
@_allowFeatureSuppression(IsolatedAny)
204203
#if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
205204
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model", renamed: "addTask(operation:)")
206205
#endif
@@ -257,7 +256,6 @@ public struct DiscardingTaskGroup {
257256
/// - Returns: `true` if the child task was added to the group;
258257
/// otherwise `false`.
259258
@_alwaysEmitIntoClient
260-
@_allowFeatureSuppression(IsolatedAny)
261259
#if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
262260
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model", renamed: "addTask(operation:)")
263261
#endif
@@ -313,7 +311,6 @@ public struct DiscardingTaskGroup {
313311
}
314312

315313
@_alwaysEmitIntoClient
316-
@_allowFeatureSuppression(IsolatedAny)
317314
public mutating func addTask(
318315
operation: sending @escaping @isolated(any) () async -> Void
319316
) {
@@ -357,7 +354,6 @@ public struct DiscardingTaskGroup {
357354
#if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
358355
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model", renamed: "addTaskUnlessCancelled(operation:)")
359356
#endif
360-
@_allowFeatureSuppression(IsolatedAny)
361357
@_alwaysEmitIntoClient
362358
public mutating func addTaskUnlessCancelled(
363359
operation: sending @escaping @isolated(any) () async -> Void
@@ -892,7 +888,6 @@ public struct ThrowingDiscardingTaskGroup<Failure: Error> {
892888
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model", renamed: "addTask(operation:)")
893889
#endif
894890
@_alwaysEmitIntoClient
895-
@_allowFeatureSuppression(IsolatedAny)
896891
public mutating func addTask(
897892
priority: TaskPriority? = nil,
898893
operation: sending @escaping @isolated(any) () async throws -> Void
@@ -936,7 +931,6 @@ public struct ThrowingDiscardingTaskGroup<Failure: Error> {
936931
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model", renamed: "addTask(operation:)")
937932
#endif
938933
@_alwaysEmitIntoClient
939-
@_allowFeatureSuppression(IsolatedAny)
940934
public mutating func addTaskUnlessCancelled(
941935
priority: TaskPriority? = nil,
942936
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,
@@ -665,7 +664,6 @@ extension Task where Failure == Never {
665664
/// - operation: The operation to perform.
666665
@discardableResult
667666
@_alwaysEmitIntoClient
668-
@_allowFeatureSuppression(IsolatedAny)
669667
public init(
670668
priority: TaskPriority? = nil,
671669
@_inheritActorContext @_implicitSelfCapture operation: sending @escaping @isolated(any) () async -> Success
@@ -704,7 +702,6 @@ extension Task where Failure == Error {
704702
#if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
705703
@discardableResult
706704
@_alwaysEmitIntoClient
707-
@_allowFeatureSuppression(IsolatedAny)
708705
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model")
709706
public init(
710707
priority: TaskPriority? = nil,
@@ -761,7 +758,6 @@ extension Task where Failure == Error {
761758
/// - operation: The operation to perform.
762759
@discardableResult
763760
@_alwaysEmitIntoClient
764-
@_allowFeatureSuppression(IsolatedAny)
765761
public init(
766762
priority: TaskPriority? = nil,
767763
@_inheritActorContext @_implicitSelfCapture operation: sending @escaping @isolated(any) () async throws -> Success
@@ -802,7 +798,6 @@ extension Task where Failure == Never {
802798
#if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
803799
@discardableResult
804800
@_alwaysEmitIntoClient
805-
@_allowFeatureSuppression(IsolatedAny)
806801
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model")
807802
public static func detached(
808803
priority: TaskPriority? = nil,
@@ -856,7 +851,6 @@ extension Task where Failure == Never {
856851
/// - Returns: A reference to the task.
857852
@discardableResult
858853
@_alwaysEmitIntoClient
859-
@_allowFeatureSuppression(IsolatedAny)
860854
public static func detached(
861855
priority: TaskPriority? = nil,
862856
operation: sending @escaping @isolated(any) () async -> Success
@@ -895,7 +889,6 @@ extension Task where Failure == Error {
895889
#if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
896890
@discardableResult
897891
@_alwaysEmitIntoClient
898-
@_allowFeatureSuppression(IsolatedAny)
899892
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model")
900893
public static func detached(
901894
priority: TaskPriority? = nil,
@@ -951,7 +944,6 @@ extension Task where Failure == Error {
951944
/// - Returns: A reference to the task.
952945
@discardableResult
953946
@_alwaysEmitIntoClient
954-
@_allowFeatureSuppression(IsolatedAny)
955947
public static func detached(
956948
priority: TaskPriority? = nil,
957949
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
@@ -373,7 +372,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
373372
/// - Returns: `true` if the child task was added to the group;
374373
/// otherwise `false`.
375374
@_alwaysEmitIntoClient
376-
@_allowFeatureSuppression(IsolatedAny)
377375
public mutating func addTaskUnlessCancelled(
378376
priority: TaskPriority? = nil,
379377
operation: sending @escaping @isolated(any) () async -> ChildTaskResult
@@ -485,7 +483,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
485483
#else // if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
486484
@available(SwiftStdlib 5.7, *)
487485
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model", renamed: "addTask(operation:)")
488-
@_allowFeatureSuppression(IsolatedAny)
489486
public mutating func addTask(
490487
priority: TaskPriority? = nil,
491488
operation: sending @escaping @isolated(any) () async -> ChildTaskResult
@@ -498,7 +495,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
498495
/// - Parameters:
499496
/// - operation: The operation to execute as part of the task group.
500497
@_alwaysEmitIntoClient
501-
@_allowFeatureSuppression(IsolatedAny)
502498
public mutating func addTask(
503499
operation: sending @escaping @isolated(any) () async -> ChildTaskResult
504500
) {
@@ -541,7 +537,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
541537
/// - Returns: `true` if the child task was added to the group;
542538
/// otherwise `false`.
543539
@_alwaysEmitIntoClient
544-
@_allowFeatureSuppression(IsolatedAny)
545540
public mutating func addTaskUnlessCancelled(
546541
operation: sending @escaping @isolated(any) () async -> ChildTaskResult
547542
) -> Bool {
@@ -871,7 +866,6 @@ public struct ThrowingTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
871866
/// to set the child task's priority to the priority of the group.
872867
/// - operation: The operation to execute as part of the task group.
873868
@_alwaysEmitIntoClient
874-
@_allowFeatureSuppression(IsolatedAny)
875869
public mutating func addTask(
876870
priority: TaskPriority? = nil,
877871
operation: sending @escaping @isolated(any) () async throws -> ChildTaskResult
@@ -913,7 +907,6 @@ public struct ThrowingTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
913907
/// - Returns: `true` if the child task was added to the group;
914908
/// otherwise `false`.
915909
@_alwaysEmitIntoClient
916-
@_allowFeatureSuppression(IsolatedAny)
917910
public mutating func addTaskUnlessCancelled(
918911
priority: TaskPriority? = nil,
919912
operation: sending @escaping @isolated(any) () async throws -> ChildTaskResult

0 commit comments

Comments
 (0)