Skip to content

Commit 6d5c82e

Browse files
committed
temporarily disable Span and MutableSpan for Windows
The current Windows nightly is too old to be able to compile the expected syntax.
1 parent 759820e commit 6d5c82e

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Sources/FoundationEssentials/Data/Data.swift

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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)
@@ -2239,6 +2240,7 @@ public struct Data : Equatable, Hashable, RandomAccessCollection, MutableCollect
22392240
}
22402241
}
22412242

2243+
#if compiler(>=6.2)
22422244
@available(FoundationSpan 6.2, *)
22432245
public var mutableBytes: MutableRawSpan {
22442246
@lifetime(&self)
@@ -2298,6 +2300,8 @@ public struct Data : Equatable, Hashable, RandomAccessCollection, MutableCollect
22982300
#endif
22992301
}
23002302
}
2303+
#endif // compiler(>=6.2)
2304+
#endif // !os(Windows)
23012305

23022306
@_alwaysEmitIntoClient
23032307
public func withContiguousStorageIfAvailable<ResultType>(_ body: (_ buffer: UnsafeBufferPointer<UInt8>) throws -> ResultType) rethrows -> ResultType? {
@@ -2950,7 +2954,7 @@ extension Data : Codable {
29502954
}
29512955

29522956
// TODO: remove once _overrideLifetime is public in the standard library
2953-
2957+
#if !os(Windows)
29542958
/// Unsafely discard any lifetime dependency on the `dependent` argument. Return
29552959
/// a value identical to `dependent` with a lifetime dependency on the caller's
29562960
/// borrow scope of the `source` argument.
@@ -2964,8 +2968,6 @@ internal func _overrideLifetime<
29642968
>(
29652969
_ dependent: consuming T, borrowing source: borrowing U
29662970
) -> T {
2967-
// TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence
2968-
// should be expressed by a builtin that is hidden within the function body.
29692971
dependent
29702972
}
29712973

@@ -2982,8 +2984,6 @@ internal func _overrideLifetime<
29822984
>(
29832985
_ dependent: consuming T, copying source: borrowing U
29842986
) -> T {
2985-
// TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence
2986-
// should be expressed by a builtin that is hidden within the function body.
29872987
dependent
29882988
}
29892989

@@ -3001,7 +3001,6 @@ internal func _overrideLifetime<
30013001
_ dependent: consuming T,
30023002
mutating source: inout U
30033003
) -> T {
3004-
// TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence
3005-
// should be expressed by a builtin that is hidden within the function body.
30063004
dependent
30073005
}
3006+
#endif

Tests/FoundationEssentialsTests/DataTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,6 +1634,7 @@ class DataTests : XCTestCase {
16341634
// source.advanced(by: 5)
16351635
}
16361636

1637+
#if !os(Windows)
16371638
func test_InlineDataSpan() throws {
16381639
guard #available(FoundationSpan 6.2, *) else { throw XCTSkip("Span not available") }
16391640

@@ -1777,6 +1778,7 @@ class DataTests : XCTestCase {
17771778
XCTAssertEqual(source[i], 0)
17781779
XCTAssertEqual(source[i+1], .max)
17791780
}
1781+
#endif // !os(Windows)
17801782

17811783
#if false // FIXME: XCTest doesn't support crash tests yet rdar://20195010&22387653
17821784
func test_bounding_failure_subdata() {

0 commit comments

Comments
 (0)