@@ -102,6 +102,7 @@ public final class TaskLocal<Value: Sendable>: Sendable, CustomStringConvertible
102102 self . defaultValue = defaultValue
103103 }
104104
105+ @usableFromInline
105106 var key : Builtin . RawPointer {
106107 unsafeBitCast ( self , to: Builtin . RawPointer. self)
107108 }
@@ -135,7 +136,10 @@ public final class TaskLocal<Value: Sendable>: Sendable, CustomStringConvertible
135136 /// If the value is a reference type, it will be retained for the duration of
136137 /// the operation closure.
137138 @discardableResult
139+ @inline ( __always)
138140 @_unsafeInheritExecutor
141+ @available ( SwiftStdlib 5 . 1 , * ) // back deploy requires we declare the availability explicitly on this method
142+ @_backDeploy ( before: macOS 9999 , iOS 9999 , watchOS 9999 , tvOS 9999 ) // SwiftStdlib 5.8 but it doesn't work with _backDeploy
139143 public func withValue< R> ( _ valueDuringOperation: Value , operation: ( ) async throws -> R ,
140144 file: String = #file, line: UInt = #line) async rethrows -> R {
141145 // check if we're not trying to bind a value from an illegal context; this may crash
@@ -161,6 +165,7 @@ public final class TaskLocal<Value: Sendable>: Sendable, CustomStringConvertible
161165 /// If the value is a reference type, it will be retained for the duration of
162166 /// the operation closure.
163167 @discardableResult
168+ @inline ( __always)
164169 public func withValue< R> ( _ valueDuringOperation: Value , operation: ( ) throws -> R ,
165170 file: String = #file, line: UInt = #line) rethrows -> R {
166171 // check if we're not trying to bind a value from an illegal context; this may crash
@@ -172,6 +177,7 @@ public final class TaskLocal<Value: Sendable>: Sendable, CustomStringConvertible
172177 return try operation ( )
173178 }
174179
180+ @inline ( __always)
175181 public var projectedValue : TaskLocal < Value > {
176182 get {
177183 self
@@ -213,23 +219,27 @@ public final class TaskLocal<Value: Sendable>: Sendable, CustomStringConvertible
213219// ==== ------------------------------------------------------------------------
214220
215221@available ( SwiftStdlib 5 . 1 , * )
222+ @usableFromInline
216223@_silgen_name ( " swift_task_localValuePush " )
217224func _taskLocalValuePush< Value> (
218225 key: Builtin . RawPointer /*: Key*/,
219226 value: __owned Value
220227) // where Key: TaskLocal
221228
222229@available( SwiftStdlib 5 . 1 , * )
230+ @usableFromInline
223231@_silgen_name ( " swift_task_localValuePop " )
224232func _taskLocalValuePop( )
225233
226234@available( SwiftStdlib 5 . 1 , * )
235+ @usableFromInline
227236@_silgen_name ( " swift_task_localValueGet " )
228237func _taskLocalValueGet(
229238 key: Builtin . RawPointer /*Key*/
230239) -> UnsafeMutableRawPointer ? // where Key: TaskLocal
231240
232241@available ( SwiftStdlib 5 . 1 , * )
242+ @usableFromInline
233243@_silgen_name ( " swift_task_localsCopyTo " )
234244func _taskLocalsCopy(
235245 to target: Builtin . NativeObject
0 commit comments