Drop support for Swift 6.0 and 6.1

This allows the use of Span types without `#if compiler` guards.
This commit is contained in:
Karoy Lorentey committed 2026-09-21 13:34:39 -07:00
1 parent 78bb4bf6b9
commit 537bf9cbfb
145 files changed
+342 -1047

No files matched your search

@@ -16,8 +16,6 @@ import InternalCollectionsUtilities
import SpanPreview
#endif
#if compiler(>=6.2)
@available(SwiftStdlib 5.0, *)
extension UniqueArray where Element: ~Copyable {
/// Adds an element to the end of the array.
@@ -93,7 +91,7 @@ extension UniqueArray where Element: ~Copyable {
_ensureFreeCapacity(items.count)
return _storage._appendUnchecked(moving: items)
}
#if UnstableContainersPreview
/// Moves the elements of a input span to the end of this array, leaving the
/// span empty.
@@ -309,7 +307,7 @@ extension UniqueArray {
self.append(item)
}
}
#if compiler(>=6.4)
/// Copies the elements of a container to the end of this array.
///
@@ -334,5 +332,3 @@ extension UniqueArray {
}
#endif
}
#endif
@@ -16,8 +16,6 @@ import InternalCollectionsUtilities
import SpanPreview
#endif
#if compiler(>=6.2)
#if UnstableContainersPreview
@available(SwiftStdlib 5.0, *)
extension UniqueArray where Element: ~Copyable {
@@ -128,5 +126,3 @@ extension UniqueArray where Element: ~Copyable {
}
}
#endif
#endif
@@ -15,8 +15,6 @@
import InternalCollectionsUtilities
#endif
#if compiler(>=6.2)
@available(SwiftStdlib 5.0, *)
extension UniqueArray where Element: ~Copyable {
/// A Boolean value indicating whether this array contains no elements.
@@ -380,5 +378,3 @@ extension UniqueArray where Element: ~Copyable {
_storage.previousSpan(before: &index, maxCount: maxCount)
}
}
#endif
@@ -15,8 +15,6 @@
import SpanPreview
#endif
#if compiler(>=6.2)
@available(SwiftStdlib 5.0, *)
extension UniqueArray where Element: ~Copyable {
@available(*, deprecated, renamed: "nextSpan(after:maxCount:)")
@@ -99,7 +97,7 @@ extension UniqueArray where Element: ~Copyable {
}
return result.take()!
}
/// Inserts a given number of new items into this array at the specified
/// position, using a callback to directly initialize array storage by
/// populating an output span.
@@ -240,7 +238,7 @@ extension UniqueArray {
public func copy() -> Self {
self.clone()
}
/// Copy the contents of this array into a newly allocated unique array
/// instance with the specified capacity.
///
@@ -290,5 +288,3 @@ extension UniqueArray {
replaceSubrange(subrange, copying: newElements)
}
}
#endif
@@ -11,8 +11,6 @@
//
//===----------------------------------------------------------------------===//
#if compiler(>=6.2)
@available(SwiftStdlib 5.0, *)
extension UniqueArray /*: CustomStringConvertible */ where Element: ~Copyable {
public var description: String {
@@ -28,5 +26,3 @@ extension UniqueArray /*: CustomDebugStringConvertible */ where Element: ~Copyab
"<\(count) items>"
}
}
#endif
@@ -11,8 +11,6 @@
//
//===----------------------------------------------------------------------===//
#if compiler(>=6.2)
#if !COLLECTIONS_SINGLE_MODULE
import InternalCollectionsUtilities
#endif
@@ -51,5 +49,3 @@ extension UniqueArray where Element: Equatable {
}
}
#endif
#endif
@@ -15,7 +15,7 @@
import InternalCollectionsUtilities
#endif
#if compiler(>=6.2) && UnstableContainersPreview
#if UnstableContainersPreview
#if false // TODO
extension UniqueArray /*where Element: Copyable*/ {
@@ -11,8 +11,6 @@
//
//===----------------------------------------------------------------------===//
#if compiler(>=6.2)
#if !COLLECTIONS_SINGLE_MODULE
import InternalCollectionsUtilities
#endif
@@ -38,5 +36,3 @@ extension UniqueArray where Element: Hashable {
}
}
#endif
#endif
@@ -15,8 +15,6 @@
import InternalCollectionsUtilities
#endif
#if compiler(>=6.2)
@available(SwiftStdlib 5.0, *)
extension UniqueArray where Element: ~Copyable {
/// Initializes a new unique array with no elements.
@@ -24,7 +22,7 @@ extension UniqueArray where Element: ~Copyable {
public init() {
_storage = .init(capacity: 0)
}
/// Initializes a new unique array with the specified capacity and no elements.
@inlinable
public init(minimumCapacity: Int) {
@@ -122,7 +120,7 @@ extension UniqueArray /*where Element: Copyable*/ {
self.init(minimumCapacity: capacity ?? 0)
self.append(copying: contents)
}
#if compiler(>=6.4)
/// Creates a new array with the specified initial capacity, holding a copy
/// of the contents of a given container.
@@ -162,5 +160,3 @@ extension UniqueArray /*where Element: Copyable*/ {
self.append(copying: span)
}
}
#endif
@@ -16,8 +16,6 @@ import InternalCollectionsUtilities
import SpanPreview
#endif
#if compiler(>=6.2)
@available(SwiftStdlib 5.0, *)
extension UniqueArray where Element: ~Copyable {
/// Inserts a new element into the array at the specified position.
@@ -335,5 +333,3 @@ extension UniqueArray {
addingCount: newCount, copying: newElements, at: index)
}
}
#endif
@@ -15,8 +15,6 @@
import InternalCollectionsUtilities
#endif
#if compiler(>=6.2)
@available(SwiftStdlib 5.0, *)
extension UniqueArray where Element: ~Copyable {
/// Removes all elements from the array, preserving its
@@ -141,5 +139,3 @@ extension UniqueArray where Element: ~Copyable {
return removeLast()
}
}
#endif
@@ -16,8 +16,6 @@ import InternalCollectionsUtilities
import SpanPreview
#endif
#if compiler(>=6.2)
@available(SwiftStdlib 5.0, *)
extension UniqueArray where Element: ~Copyable {
/// Replaces the specified range of elements by a given count of new items,
@@ -468,7 +466,7 @@ extension UniqueArray {
_ensureFreeCapacity(newElements.count - subrange.count)
return _storage.replaceSubrange(subrange, copying: newElements)
}
/// Replaces the specified subrange of elements by copying the elements of
/// the given collection.
///
@@ -513,4 +511,3 @@ extension UniqueArray {
newCount: c)
}
}
#endif