@@ -2203,6 +2203,7 @@ public struct Data : Equatable, Hashable, RandomAccessCollection, MutableCollect
2203
2203
return try _representation. withUnsafeBytes ( body)
2204
2204
}
2205
2205
2206
+ #if !os(Windows)
2206
2207
@available ( FoundationSpan 6 . 2 , * )
2207
2208
public var bytes : RawSpan {
2208
2209
@lifetime ( borrow self)
@@ -2241,7 +2242,9 @@ public struct Data : Equatable, Hashable, RandomAccessCollection, MutableCollect
2241
2242
2242
2243
@available ( FoundationSpan 6 . 2 , * )
2243
2244
public var mutableBytes : MutableRawSpan {
2245
+ #if compiler(>=6.2)
2244
2246
@lifetime ( & self )
2247
+ #endif
2245
2248
mutating get {
2246
2249
let buffer : UnsafeMutableRawBufferPointer
2247
2250
switch _representation {
@@ -2268,7 +2271,9 @@ public struct Data : Equatable, Hashable, RandomAccessCollection, MutableCollect
2268
2271
2269
2272
@available ( FoundationSpan 6 . 2 , * )
2270
2273
public var mutableSpan : MutableSpan < UInt8 > {
2274
+ #if compiler(>=6.2)
2271
2275
@lifetime ( & self )
2276
+ #endif
2272
2277
mutating get {
2273
2278
#if false // see https://github.com/swiftlang/swift/issues/81218
2274
2279
var bytes = mutableBytes
@@ -2298,6 +2303,7 @@ public struct Data : Equatable, Hashable, RandomAccessCollection, MutableCollect
2298
2303
#endif
2299
2304
}
2300
2305
}
2306
+ #endif // !os(Windows)
2301
2307
2302
2308
@_alwaysEmitIntoClient
2303
2309
public func withContiguousStorageIfAvailable< ResultType> ( _ body: ( _ buffer: UnsafeBufferPointer < UInt8 > ) throws -> ResultType ) rethrows -> ResultType ? {
@@ -2950,7 +2956,7 @@ extension Data : Codable {
2950
2956
}
2951
2957
2952
2958
// TODO: remove once _overrideLifetime is public in the standard library
2953
-
2959
+ #if !os(Windows)
2954
2960
/// Unsafely discard any lifetime dependency on the `dependent` argument. Return
2955
2961
/// a value identical to `dependent` with a lifetime dependency on the caller's
2956
2962
/// borrow scope of the `source` argument.
@@ -2964,8 +2970,6 @@ internal func _overrideLifetime<
2964
2970
> (
2965
2971
_ dependent: consuming T , borrowing source: borrowing U
2966
2972
) -> T {
2967
- // TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence
2968
- // should be expressed by a builtin that is hidden within the function body.
2969
2973
dependent
2970
2974
}
2971
2975
@@ -2982,8 +2986,6 @@ internal func _overrideLifetime<
2982
2986
> (
2983
2987
_ dependent: consuming T , copying source: borrowing U
2984
2988
) -> T {
2985
- // TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence
2986
- // should be expressed by a builtin that is hidden within the function body.
2987
2989
dependent
2988
2990
}
2989
2991
@@ -3001,7 +3003,6 @@ internal func _overrideLifetime<
3001
3003
_ dependent: consuming T ,
3002
3004
mutating source: inout U
3003
3005
) -> T {
3004
- // TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence
3005
- // should be expressed by a builtin that is hidden within the function body.
3006
3006
dependent
3007
3007
}
3008
+ #endif
0 commit comments