Concurrency: Restore consume in TaskLocal.withValueImpl<R>(_:operation:).

It is no longer necessary to avoid using the `consume` keyword in inlinable
function bodies in the standard library in order to support older compilers.

Partially reverts https://github.com/apple/swift/pull/65599.

Resolves rdar://109165937.
This commit is contained in:
Allan Shortlidge
2023-08-14 22:19:54 -07:00
parent 7b3916e4f1
commit 5cc7fff4ca
2 changed files with 2 additions and 2 deletions

View File

@@ -171,7 +171,7 @@ public final class TaskLocal<Value: Sendable>: Sendable, CustomStringConvertible
// check if we're not trying to bind a value from an illegal context; this may crash
_checkIllegalTaskLocalBindingWithinWithTaskGroup(file: file, line: line)
_taskLocalValuePush(key: key, value: valueDuringOperation)
_taskLocalValuePush(key: key, value: consume valueDuringOperation)
defer { _taskLocalValuePop() }
return try await operation()