mirror of
https://github.com/apple/swift-collections
synced 2026-11-27 04:54:21 +00:00
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:
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 RigidArray where Element: ~Copyable {
|
||||
@_alwaysEmitIntoClient
|
||||
@@ -348,7 +346,7 @@ extension RigidArray {
|
||||
var it = self._append(prefixOf: newElements)
|
||||
precondition(it.next() == nil, "RigidArray capacity overflow")
|
||||
}
|
||||
|
||||
|
||||
#if compiler(>=6.4)
|
||||
/// Copies the elements of a borrowing sequence to the end of this array.
|
||||
///
|
||||
@@ -372,4 +370,3 @@ extension RigidArray {
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
@@ -16,8 +16,6 @@ import InternalCollectionsUtilities
|
||||
import SpanPreview
|
||||
#endif
|
||||
|
||||
#if compiler(>=6.2)
|
||||
|
||||
#if UnstableContainersPreview
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension RigidArray where Element: ~Copyable {
|
||||
@@ -30,7 +28,7 @@ extension RigidArray where Element: ~Copyable {
|
||||
initializedCount: buffer.count)
|
||||
return _overrideLifetime(result, mutating: &self)
|
||||
}
|
||||
|
||||
|
||||
/// Remove the specified subrange of items from this array,
|
||||
/// passing an input span to the given function to consume them in place.
|
||||
///
|
||||
@@ -57,7 +55,7 @@ extension RigidArray where Element: ~Copyable {
|
||||
}
|
||||
let buffer = unsafe _storage.extracting(subrange)
|
||||
var span = InputSpan(buffer: buffer, initializedCount: buffer.count)
|
||||
|
||||
|
||||
consumer(&span)
|
||||
_ = consume span
|
||||
|
||||
@@ -167,15 +165,15 @@ extension RigidArray where Element: ~Copyable {
|
||||
|
||||
@usableFromInline
|
||||
internal var _offsetRange: Range<Int>
|
||||
|
||||
|
||||
@usableFromInline
|
||||
internal var _remainder: UnsafeMutableBufferPointer<Element>
|
||||
|
||||
|
||||
@_alwaysEmitIntoClient
|
||||
@inline(__always)
|
||||
@_lifetime(&_base)
|
||||
internal init(_base: inout RigidArray, offsetRange: Range<Int>) {
|
||||
|
||||
|
||||
self._remainder = _base._storage._extracting(unchecked: offsetRange)
|
||||
self._base = _MutableRef(&_base)
|
||||
self._offsetRange = offsetRange
|
||||
@@ -184,7 +182,7 @@ extension RigidArray where Element: ~Copyable {
|
||||
@inlinable
|
||||
deinit {
|
||||
self._remainder.deinitialize()
|
||||
|
||||
|
||||
// FIXME: This needs to be written as
|
||||
// self._base.value.closeGap(offsets: self._offsetRange)
|
||||
// but unfortunately we cannot mutate self in deinit yet.
|
||||
@@ -225,5 +223,3 @@ extension RigidArray.SubrangeConsumer where Element: ~Copyable {
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -15,8 +15,6 @@
|
||||
import InternalCollectionsUtilities
|
||||
#endif
|
||||
|
||||
#if compiler(>=6.2)
|
||||
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension RigidArray where Element: ~Copyable {
|
||||
/// A Boolean value indicating whether this array contains no elements.
|
||||
@@ -442,5 +440,3 @@ extension RigidArray where Element: ~Copyable {
|
||||
return _span(in: Range(uncheckedBounds: (start, index)))
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -11,8 +11,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6.2)
|
||||
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension RigidArray where Element: ~Copyable {
|
||||
@available(*, deprecated, renamed: "nextSpan(after:maxCount:)")
|
||||
@@ -76,7 +74,7 @@ extension RigidArray 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.
|
||||
@@ -140,8 +138,8 @@ extension RigidArray {
|
||||
public func copy() -> Self {
|
||||
clone()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// Copy the contents of this array into a newly allocated rigid array
|
||||
/// instance with the specified capacity.
|
||||
///
|
||||
@@ -240,5 +238,3 @@ extension RigidArray {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -11,8 +11,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6.2)
|
||||
|
||||
// FIXME: Add this when/if SE-0499 gets implemented.
|
||||
//#if compiler(>=6.x)
|
||||
//@available(SwiftStdlib 5.0, *)
|
||||
@@ -42,6 +40,3 @@ extension RigidArray where Element: ~Copyable {
|
||||
"<\(count) items>"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
@@ -11,8 +11,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6.2)
|
||||
|
||||
#if !COLLECTIONS_SINGLE_MODULE
|
||||
import InternalCollectionsUtilities
|
||||
#endif
|
||||
@@ -52,5 +50,3 @@ extension RigidArray /*: Equatable */ where Element: Equatable /* & ~Copyable */
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -15,7 +15,7 @@
|
||||
import InternalCollectionsUtilities
|
||||
#endif
|
||||
|
||||
#if compiler(>=6.2) && UnstableContainersPreview
|
||||
#if UnstableContainersPreview
|
||||
|
||||
#if false // FIXME
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6.2)
|
||||
|
||||
#if !COLLECTIONS_SINGLE_MODULE
|
||||
import InternalCollectionsUtilities
|
||||
#endif
|
||||
@@ -40,5 +38,3 @@ extension RigidArray where Element: Hashable {
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -15,8 +15,6 @@
|
||||
import InternalCollectionsUtilities
|
||||
#endif
|
||||
|
||||
#if compiler(>=6.2)
|
||||
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension RigidArray where Element: ~Copyable {
|
||||
/// Initializes a new rigid array with zero capacity and no elements.
|
||||
@@ -28,7 +26,7 @@ extension RigidArray where Element: ~Copyable {
|
||||
_capacity = 0
|
||||
_count = 0
|
||||
}
|
||||
|
||||
|
||||
/// Initializes a new rigid array with the specified capacity and no elements.
|
||||
@inlinable
|
||||
public init(capacity: Int) {
|
||||
@@ -114,7 +112,7 @@ extension RigidArray /*where Element: Copyable*/ {
|
||||
self.init(capacity: capacity)
|
||||
self.append(copying: contents)
|
||||
}
|
||||
|
||||
|
||||
#if compiler(>=6.4)
|
||||
/// Creates a new array with the specified capacity, holding a copy
|
||||
/// of the contents of a given container.
|
||||
@@ -135,9 +133,9 @@ extension RigidArray /*where Element: Copyable*/ {
|
||||
self.init(capacity: capacity)
|
||||
try self.append(copying: contents)
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if compiler(>=6.4)
|
||||
/// Creates a new array with the specified capacity, holding a copy
|
||||
/// of the contents of a given container.
|
||||
@@ -159,7 +157,7 @@ extension RigidArray /*where Element: Copyable*/ {
|
||||
try self.append(copying: contents)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/// Creates a new array with the specified capacity, holding a copy
|
||||
/// of the contents of a given collection.
|
||||
///
|
||||
@@ -196,5 +194,3 @@ extension RigidArray /*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 RigidArray where Element: ~Copyable {
|
||||
/// Inserts a new element into the array at the specified position.
|
||||
@@ -403,5 +401,3 @@ extension RigidArray {
|
||||
_insertCollection(addingCount: items.count, copying: items, at: index)
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -16,8 +16,6 @@ import InternalCollectionsUtilities
|
||||
import SpanPreview
|
||||
#endif
|
||||
|
||||
#if compiler(>=6.2)
|
||||
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension RigidArray where Element: ~Copyable {
|
||||
@inlinable
|
||||
@@ -36,5 +34,3 @@ extension RigidArray: Iterable where Element: ~Copyable {
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -15,8 +15,6 @@
|
||||
import InternalCollectionsUtilities
|
||||
#endif
|
||||
|
||||
#if compiler(>=6.2)
|
||||
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension RigidArray where Element: ~Copyable {
|
||||
/// Removes all elements from the array, preserving its allocated capacity.
|
||||
@@ -157,5 +155,3 @@ extension RigidArray where Element: ~Copyable {
|
||||
return removeLast()
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -16,8 +16,6 @@ import InternalCollectionsUtilities
|
||||
import SpanPreview
|
||||
#endif
|
||||
|
||||
#if compiler(>=6.2)
|
||||
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension RigidArray where Element: ~Copyable {
|
||||
/// Replaces the specified range of elements by a given count of new items,
|
||||
@@ -251,7 +249,7 @@ extension RigidArray where Element: ~Copyable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if UnstableContainersPreview
|
||||
/// Replaces the specified range of elements by moving the contents of an
|
||||
/// input span into their place. On return, the span is left empty.
|
||||
@@ -595,5 +593,3 @@ extension RigidArray {
|
||||
newCount: newElements.count)
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user