Skip to content

Commit c0ee3ac

Browse files
committed
Concurrency: Make _Concurrency module interface parsable by older compilers.
Revert a few unnecessary changes have been made to the _Concurrency module recently that make its swiftinterface un-parseable by older compilers that we need to support. - The `consume` keyword is not understood by older compilers, so including it in inlinable code is a problem. It has no actual effect on lifetimes where it was used, so just omit it. - Don't build the _Concurrency module with -enable-experimental-feature MoveOnly. The MoveOnly feature is now enabled by default in recent compilers, so the flag is superfluous when building the dylib. When emitting the interface, having the feature enabled explicitly exposes code guarded by `$MoveOnly` to older compilers that do not accept all of the code. Resolves rdar://108793606
1 parent 2d94327 commit c0ee3ac

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

stdlib/public/BackDeployConcurrency/TaskLocal.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public final class TaskLocal<Value: Sendable>: Sendable, CustomStringConvertible
172172
// check if we're not trying to bind a value from an illegal context; this may crash
173173
_checkIllegalTaskLocalBindingWithinWithTaskGroup(file: file, line: line)
174174

175-
_taskLocalValuePush(key: key, value: consume valueDuringOperation)
175+
_taskLocalValuePush(key: key, value: valueDuringOperation)
176176
defer { _taskLocalValuePop() }
177177

178178
return try await operation()

stdlib/public/Concurrency/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ add_swift_target_library(swift_Concurrency ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} I
149149
${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
150150
-parse-stdlib
151151
-Xfrontend -enable-experimental-concurrency
152-
-enable-experimental-feature MoveOnly
153152
-diagnostic-style swift
154153
${SWIFT_RUNTIME_CONCURRENCY_SWIFT_FLAGS}
155154
${swift_concurrency_options}

stdlib/public/Concurrency/TaskLocal.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public final class TaskLocal<Value: Sendable>: Sendable, CustomStringConvertible
172172
// check if we're not trying to bind a value from an illegal context; this may crash
173173
_checkIllegalTaskLocalBindingWithinWithTaskGroup(file: file, line: line)
174174

175-
_taskLocalValuePush(key: key, value: consume valueDuringOperation)
175+
_taskLocalValuePush(key: key, value: valueDuringOperation)
176176
defer { _taskLocalValuePop() }
177177

178178
return try await operation()

0 commit comments

Comments
 (0)