@@ -2203,6 +2203,7 @@ public struct Data : Equatable, Hashable, RandomAccessCollection, MutableCollect
22032203 return try _representation. withUnsafeBytes ( body)
22042204 }
22052205
2206+ #if !os(Windows)
22062207 @available ( FoundationSpan 6 . 2 , * )
22072208 public var bytes : RawSpan {
22082209 @lifetime ( borrow self)
@@ -2241,7 +2242,9 @@ public struct Data : Equatable, Hashable, RandomAccessCollection, MutableCollect
22412242
22422243 @available ( FoundationSpan 6 . 2 , * )
22432244 public var mutableBytes : MutableRawSpan {
2245+ #if compiler(>=6.2)
22442246 @lifetime ( & self )
2247+ #endif
22452248 mutating get {
22462249 let buffer : UnsafeMutableRawBufferPointer
22472250 switch _representation {
@@ -2268,7 +2271,9 @@ public struct Data : Equatable, Hashable, RandomAccessCollection, MutableCollect
22682271
22692272 @available ( FoundationSpan 6 . 2 , * )
22702273 public var mutableSpan : MutableSpan < UInt8 > {
2274+ #if compiler(>=6.2)
22712275 @lifetime ( & self )
2276+ #endif
22722277 mutating get {
22732278#if false // see https://github.com/swiftlang/swift/issues/81218
22742279 var bytes = mutableBytes
@@ -2298,6 +2303,7 @@ public struct Data : Equatable, Hashable, RandomAccessCollection, MutableCollect
22982303#endif
22992304 }
23002305 }
2306+ #endif // !os(Windows)
23012307
23022308 @_alwaysEmitIntoClient
23032309 public func withContiguousStorageIfAvailable< ResultType> ( _ body: ( _ buffer: UnsafeBufferPointer < UInt8 > ) throws -> ResultType ) rethrows -> ResultType ? {
@@ -2950,7 +2956,7 @@ extension Data : Codable {
29502956}
29512957
29522958// TODO: remove once _overrideLifetime is public in the standard library
2953-
2959+ #if !os(Windows)
29542960/// Unsafely discard any lifetime dependency on the `dependent` argument. Return
29552961/// a value identical to `dependent` with a lifetime dependency on the caller's
29562962/// borrow scope of the `source` argument.
@@ -2964,8 +2970,6 @@ internal func _overrideLifetime<
29642970> (
29652971 _ dependent: consuming T , borrowing source: borrowing U
29662972) -> T {
2967- // TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence
2968- // should be expressed by a builtin that is hidden within the function body.
29692973 dependent
29702974}
29712975
@@ -2982,8 +2986,6 @@ internal func _overrideLifetime<
29822986> (
29832987 _ dependent: consuming T , copying source: borrowing U
29842988) -> T {
2985- // TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence
2986- // should be expressed by a builtin that is hidden within the function body.
29872989 dependent
29882990}
29892991
@@ -3001,7 +3003,6 @@ internal func _overrideLifetime<
30013003 _ dependent: consuming T ,
30023004 mutating source: inout U
30033005) -> T {
3004- // TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence
3005- // should be expressed by a builtin that is hidden within the function body.
30063006 dependent
30073007}
3008+ #endif
0 commit comments