@@ -102,7 +102,7 @@ public final class TaskLocal<Value: Sendable>: Sendable, CustomStringConvertible
102
102
self . defaultValue = defaultValue
103
103
}
104
104
105
- @usableFromInline
105
+ @_alwaysEmitIntoClient
106
106
var key : Builtin . RawPointer {
107
107
unsafeBitCast ( self , to: Builtin . RawPointer. self)
108
108
}
@@ -135,10 +135,11 @@ public final class TaskLocal<Value: Sendable>: Sendable, CustomStringConvertible
135
135
///
136
136
/// If the value is a reference type, it will be retained for the duration of
137
137
/// the operation closure.
138
+ @inlinable
138
139
@discardableResult
139
140
@_unsafeInheritExecutor
140
141
@available ( SwiftStdlib 5 . 1 , * ) // back deploy requires we declare the availability explicitly on this method
141
- @_backDeploy ( before: macOS 9999 , iOS 9999 , watchOS 9999 , tvOS 9999 ) // SwiftStdlib 5.8 but it doesn't work with _backDeploy
142
+ @_backDeploy ( before: SwiftStdlib 5.8 )
142
143
public func withValue< R> ( _ valueDuringOperation: Value , operation: ( ) async throws -> R ,
143
144
file: String = #fileID, line: UInt = #line) async rethrows -> R {
144
145
// check if we're not trying to bind a value from an illegal context; this may crash
@@ -163,8 +164,8 @@ public final class TaskLocal<Value: Sendable>: Sendable, CustomStringConvertible
163
164
///
164
165
/// If the value is a reference type, it will be retained for the duration of
165
166
/// the operation closure.
167
+ @inlinable
166
168
@discardableResult
167
- @inline ( __always)
168
169
public func withValue< R> ( _ valueDuringOperation: Value , operation: ( ) throws -> R ,
169
170
file: String = #fileID, line: UInt = #line) rethrows -> R {
170
171
// check if we're not trying to bind a value from an illegal context; this may crash
@@ -176,7 +177,6 @@ public final class TaskLocal<Value: Sendable>: Sendable, CustomStringConvertible
176
177
return try operation ( )
177
178
}
178
179
179
- @inline ( __always)
180
180
public var projectedValue : TaskLocal < Value > {
181
181
get {
182
182
self
@@ -218,27 +218,25 @@ public final class TaskLocal<Value: Sendable>: Sendable, CustomStringConvertible
218
218
// ==== ------------------------------------------------------------------------
219
219
220
220
@available ( SwiftStdlib 5 . 1 , * )
221
- @usableFromInline
221
+ @_alwaysEmitIntoClient
222
222
@_silgen_name ( " swift_task_localValuePush " )
223
223
func _taskLocalValuePush< Value> (
224
224
key: Builtin . RawPointer /*: Key*/,
225
225
value: __owned Value
226
226
) // where Key: TaskLocal
227
227
228
228
@available( SwiftStdlib 5 . 1 , * )
229
- @usableFromInline
229
+ @_alwaysEmitIntoClient
230
230
@_silgen_name ( " swift_task_localValuePop " )
231
231
func _taskLocalValuePop( )
232
232
233
233
@available( SwiftStdlib 5 . 1 , * )
234
- @usableFromInline
235
234
@_silgen_name ( " swift_task_localValueGet " )
236
235
func _taskLocalValueGet(
237
236
key: Builtin . RawPointer /*Key*/
238
237
) -> UnsafeMutableRawPointer ? // where Key: TaskLocal
239
238
240
239
@available ( SwiftStdlib 5 . 1 , * )
241
- @usableFromInline
242
240
@_silgen_name ( " swift_task_localsCopyTo " )
243
241
func _taskLocalsCopy(
244
242
to target: Builtin . NativeObject
0 commit comments