mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user