Bump availability of Iterable_ and Container protocols to SwiftStdlib 6.4

This is preparing for switching over to the stdlib’s definition of `protocol Iterable`, assuming it will land with macOS 27/iOS 27 etc availability; `Container` is refining `Iterable`, so it needs matching availability.

If `Iterable` won’t ship in Swift 6.4, then we’ll need to bump this again.
This commit is contained in:
Karoy Lorentey committed 2026-07-07 14:22:45 -07:00
1 parent a80c9d1257
commit ff695132ed
66 files changed
+645 -418

No files matched your search

@@ -253,6 +253,7 @@ extension RigidArray {
}
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
@inlinable
internal mutating func _append<
Source: Iterable_ & ~Copyable & ~Escapable
@@ -275,6 +276,7 @@ extension RigidArray {
/// - newElements: A container whose contents to copy into the array.
///
/// - Complexity: O(`newElements.count`)
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
@inline(__always)
public mutating func append<
@@ -318,6 +320,7 @@ extension RigidArray {
/// - newElements: The new elements to copy into the array.
///
/// - Complexity: O(*m*), where *m* is the length of `newElements`.
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
@inline(__always)
public mutating func append<
@@ -19,9 +19,9 @@ import ContainersPreview
#if compiler(>=6.2)
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension RigidArray: Iterable_ where Element: ~Copyable {
public typealias BorrowingIterator_ = SpanIterator<Element>
public typealias BorrowingIterator_ = Span<Element>.BorrowingIterator_
@_alwaysEmitIntoClient
@inline(__always)
@@ -35,7 +35,7 @@ extension RigidArray: Iterable_ where Element: ~Copyable {
#endif
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension RigidArray: Container where Element: ~Copyable {
@_alwaysEmitIntoClient
@_lifetime(borrow self)
@@ -57,17 +57,17 @@ extension RigidArray: Container where Element: ~Copyable {
}
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension RigidArray: BidirectionalContainer where Element: ~Copyable {}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension RigidArray: RandomAccessContainer where Element: ~Copyable {}
#if compiler(>=6.4)
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension RigidArray: MutableContainer where Element: ~Copyable {}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension RigidArray: RangeReplaceableContainer where Element: ~Copyable {}
#endif
#endif
@@ -122,6 +122,7 @@ extension RigidArray /*where Element: Copyable*/ {
/// just enough capacity to store the contents.
/// - contents: The container whose contents to copy into the new array.
/// The container must not contain more than `capacity` elements.
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
@inline(__always)
public init<Source: Iterable_ & ~Copyable & ~Escapable>(
@@ -144,6 +145,7 @@ extension RigidArray /*where Element: Copyable*/ {
/// just enough capacity to store the contents.
/// - contents: The container whose contents to copy into the new array.
/// The container must not contain more than `capacity` elements.
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
@inline(__always)
public init<Source: Iterable_ & Sequence<Element>>(
@@ -330,13 +330,14 @@ extension RigidArray {
}
}
#if !UnstableContainersPreview
@_alwaysEmitIntoClient
package mutating func _insertCollection(
addingCount newCount: Int,
copying items: some Collection<Element>,
at index: Index
) {
// FIXME: Remove this -- RangeReplaceContainer already has this algorithm,
// albeit with stricter availability.
let done: Void? = items.withContiguousStorageIfAvailable { buffer in
precondition(buffer.count == newCount, "Broken Collection: mismatching count")
self.insert(addingCount: buffer.count, at: index) { target in
@@ -353,7 +354,6 @@ extension RigidArray {
}
precondition(it.next() == nil, "Broken Collection")
}
#endif
/// Copies the elements of a collection into this array at the specified
/// position.
@@ -379,9 +379,6 @@ extension RigidArray {
public mutating func insert(
copying items: some Collection<Element>, at index: Int
) {
// FIXME: Remove this -- RangeReplaceContainer already has this algorithm.
// (Note that this would be source breaking while RRC lives in the separate
// ContainersPreview module.)
_insertCollection(addingCount: items.count, copying: items, at: index)
}
}
@@ -121,7 +121,6 @@ extension RigidArray where Element: ~Copyable {
@available(SwiftStdlib 5.0, *)
extension RigidArray where Element: ~Copyable {
#if !UnstableContainersPreview
/// Removes and returns the last element of the array, if there is one.
///
/// - Returns: The last element of the array if the array is not empty;
@@ -134,7 +133,6 @@ extension RigidArray where Element: ~Copyable {
if isEmpty { return nil }
return removeLast()
}
#endif
}
#endif
@@ -583,6 +583,7 @@ extension RigidArray {
}
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
@inlinable
internal mutating func _replace<
C: Container<Element> & ~Copyable & ~Escapable
@@ -661,6 +662,7 @@ extension RigidArray {
/// - newElements: The new elements to copy into the collection.
///
/// - Complexity: O(`self.count` + `newElements.count`)
@available(SwiftStdlib 6.4, *)
@inlinable
@inline(__always)
public mutating func replace<
@@ -742,6 +744,7 @@ extension RigidArray {
///
/// - Complexity: O(*n* + *m*), where *n* is count of this array and
/// *m* is the count of `newElements`.
@available(SwiftStdlib 6.4, *)
@inlinable
@inline(__always)
public mutating func replace<
@@ -82,6 +82,7 @@ extension RigidSet where Element: ~Copyable {
@available(SwiftStdlib 5.0, *)
extension RigidSet /* where Element: Copyable */ {
#if UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
@inline(__always)
public init<
@@ -117,6 +118,7 @@ extension RigidSet /* where Element: Copyable */ {
}
#if UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
@inline(__always)
public init<
@@ -130,6 +132,7 @@ extension RigidSet /* where Element: Copyable */ {
try self._insert(copying: contents)
}
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
@inline(__always)
public init<
@@ -235,6 +235,7 @@ extension RigidSet /* where Element: Copyable */ {
}
#if UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
package mutating func _insert<
S: Iterable_ & ~Copyable & ~Escapable
@@ -252,6 +253,7 @@ extension RigidSet /* where Element: Copyable */ {
#endif
#if UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
@inline(__always)
public mutating func insert<
@@ -274,6 +276,7 @@ extension RigidSet /* where Element: Copyable */ {
}
#if UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
@inline(__always)
public mutating func insert<
@@ -258,6 +258,7 @@ extension UniqueArray {
}
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
@inlinable
internal mutating func _append<
Source: Iterable_ & ~Copyable & ~Escapable
@@ -291,6 +292,7 @@ extension UniqueArray {
///
/// - Complexity: O(`newElements.count`), when amortized over many invocations
/// over the same array.
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
@inline(__always)
public mutating func append<
@@ -346,6 +348,7 @@ extension UniqueArray {
///
/// - Complexity: O(`newElements.count`), when amortized over many invocations
/// over the same array.
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
@inline(__always)
public mutating func append<
@@ -19,9 +19,9 @@ import ContainersPreview
#if compiler(>=6.2)
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension UniqueArray: Iterable_ where Element: ~Copyable {
public typealias BorrowingIterator_ = RigidArray<Element>.BorrowingIterator_
public typealias BorrowingIterator_ = Span<Element>.BorrowingIterator_
@inlinable
public var underestimatedCount_: Int { count }
@@ -35,7 +35,7 @@ extension UniqueArray: Iterable_ where Element: ~Copyable {
#endif
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension UniqueArray: Container where Element: ~Copyable {
@_alwaysEmitIntoClient
@_lifetime(borrow self)
@@ -51,20 +51,20 @@ extension UniqueArray: Container where Element: ~Copyable {
}
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension UniqueArray: BidirectionalContainer where Element: ~Copyable {}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension UniqueArray: RandomAccessContainer where Element: ~Copyable {}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension UniqueArray: MutableContainer where Element: ~Copyable {}
#if compiler(>=6.4)
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension UniqueArray: RangeReplaceableContainer where Element: ~Copyable {}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension UniqueArray: DynamicContainer where Element: ~Copyable {}
#endif
#endif
@@ -94,6 +94,7 @@ extension UniqueArray /*where Element: Copyable*/ {
/// just enough capacity to store the contents.
/// - contents: A sequence whose contents to copy into the new array.
/// The sequence must not contain more than `capacity` elements.
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
@inline(__always)
public init<Source: Iterable_ & ~Copyable & ~Escapable>(
@@ -131,6 +132,7 @@ extension UniqueArray /*where Element: Copyable*/ {
/// - capacity: The storage capacity of the new array, or nil to allocate
/// just enough capacity to store the contents.
/// - contents: The container whose contents to copy into the new array.
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
@inline(__always)
public init<Source: Iterable_ & Sequence<Element>>(
@@ -110,7 +110,6 @@ extension UniqueArray where Element: ~Copyable {
@available(SwiftStdlib 5.0, *)
extension UniqueArray where Element: ~Copyable {
#if !UnstableContainersPreview
/// Removes and returns the last element of the array, if there is one.
///
/// - Returns: The last element of the array if the array is not empty;
@@ -123,7 +122,6 @@ extension UniqueArray where Element: ~Copyable {
if isEmpty { return nil }
return removeLast()
}
#endif
}
#endif
@@ -551,6 +551,7 @@ extension UniqueArray {
///
/// - Complexity: O(*n* + *m*), where *n* is count of this array and
/// *m* is the count of `newElements`.
@available(SwiftStdlib 6.4, *)
@inlinable
@inline(__always)
public mutating func replace<
@@ -641,6 +642,7 @@ extension UniqueArray {
///
/// - Complexity: O(*n* + *m*), where *n* is count of this array and
/// *m* is the count of `newElements`.
@available(SwiftStdlib 6.4, *)
@inlinable
@inline(__always)
public mutating func replace<
@@ -75,6 +75,7 @@ extension UniqueSet where Element: ~Copyable {
extension UniqueSet where Element: Copyable {
#if UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
public init<
S: Iterable_ & ~Copyable & ~Escapable
@@ -94,6 +95,7 @@ extension UniqueSet where Element: Copyable {
}
#if UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
public init<
S: Iterable_ & Sequence<Element>
@@ -131,6 +131,7 @@ extension UniqueSet /* where Element: Copyable */ {
}
#if UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
package mutating func _insert<
S: Iterable_ & ~Copyable & ~Escapable
@@ -149,6 +150,7 @@ extension UniqueSet /* where Element: Copyable */ {
#endif
#if UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
@inline(__always)
public mutating func insert<
@@ -171,6 +173,7 @@ extension UniqueSet /* where Element: Copyable */ {
}
#if UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
@inline(__always)
public mutating func insert<
+8 -2
View File
@@ -25,10 +25,18 @@ else()
endif()
target_sources(${module_name} PRIVATE
"Conformances/Array+Iterable.swift"
"Conformances/ClosedRange+Iterable.swift"
"Conformances/InlineArray+Iterable.swift"
"Conformances/InputSpan+Container.swift"
"Conformances/InputSpan+Iterable.swift"
"Conformances/MutableSpan+Container.swift"
"Conformances/MutableSpan+Iterable.swift"
"Conformances/OutputSpan+Container.swift"
"Conformances/OutputSpan+Iterable.swift"
"Conformances/Range+Iterable.swift"
"Conformances/Span+Container.swift"
"Conformances/Span+Iterable.swift"
"Protocols/Container/BidirectionalContainer.swift"
"Protocols/Container/Container.swift"
"Protocols/Container/Container+Filter.swift"
@@ -51,7 +59,6 @@ target_sources(${module_name} PRIVATE
"Protocols/BorrowingIteratorProtocol+SpanwiseZip.swift"
"Protocols/Iterable.swift"
"Protocols/Iterable+Algorithms.swift"
"Protocols/Iterable+Standard Conformances.swift"
"Protocols/Iterable+Utilities.swift"
"Protocols/CountedProducer.swift"
"Protocols/Drain.swift"
@@ -66,6 +73,5 @@ target_sources(${module_name} PRIVATE
"Types/MutableRef.swift"
"Types/OutputSpan+Helpers.swift"
"Types/Shared.swift"
"Types/SpanIterator.swift"
"Types/UniqueBox.swift"
)
@@ -0,0 +1,31 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Collections open source project
//
// Copyright (c) 2026 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
//
// SPDX-License-Identifier: Apache-2.0 WITH Swift-exception
//
//===----------------------------------------------------------------------===//
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
extension Array: Iterable_ {
public typealias Element_ = Element
public typealias BorrowingIterator_ = Span<Element>.BorrowingIterator_
@inlinable
public var underestimatedCount_: Int { count }
@_lifetime(borrow self)
@inlinable
public func makeBorrowingIterator_() -> BorrowingIterator_ {
BorrowingIterator_(self.span)
}
}
#endif
@@ -0,0 +1,69 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Collections open source project
//
// Copyright (c) 2026 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
//
// SPDX-License-Identifier: Apache-2.0 WITH Swift-exception
//
//===----------------------------------------------------------------------===//
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 6.2, *)
extension ClosedRange: Iterable_
where Bound: Strideable, Bound.Stride: SignedInteger
{
public typealias Element_ = Bound
@frozen
public struct BorrowingIterator_: BorrowingIteratorProtocol_, ~Copyable {
@usableFromInline
internal var _current: InlineArray<1, Bound>
@usableFromInline
internal var _last: Bound
@usableFromInline
internal var _progress: Bool
@inlinable
internal init(_ base: ClosedRange<Bound>) {
self._current = .init(repeating: base.lowerBound)
self._last = base.upperBound
self._progress = false
}
@inlinable
@_lifetime(&self)
public mutating func nextSpan_(maxCount: Int) -> Span<Bound> {
if _progress {
_current[0] = _current[0].advanced(by: 1)
}
guard _current[0] <= _last else {
_progress = false
return .init()
}
_progress = true
return _current.span
}
}
@inlinable
public var underestimatedCount_: Int {
guard let distance = Int(exactly: lowerBound.distance(to: upperBound))
else { return 0 }
let advanced = distance.addingReportingOverflow(1)
guard !advanced.overflow else { return 0 }
return advanced.partialValue
}
@inlinable
public func makeBorrowingIterator_() -> BorrowingIterator_ {
BorrowingIterator_(self)
}
}
#endif
@@ -0,0 +1,31 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Collections open source project
//
// Copyright (c) 2026 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
//
// SPDX-License-Identifier: Apache-2.0 WITH Swift-exception
//
//===----------------------------------------------------------------------===//
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
extension InlineArray: Iterable_ where Element: ~Copyable {
public typealias Element_ = Element
public typealias BorrowingIterator_ = Span<Element>.BorrowingIterator_
@inlinable
public var underestimatedCount_: Int { count }
@_lifetime(borrow self)
@inlinable
public func makeBorrowingIterator_() -> BorrowingIterator_ {
BorrowingIterator_(self.span)
}
}
#endif
@@ -17,7 +17,7 @@ import InternalCollectionsUtilities
#if compiler(>=6.2) && UnstableContainersPreview
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension InputSpan: RandomAccessContainer, MutableContainer
where Element: ~Copyable
{
@@ -0,0 +1,30 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Collections open source project
//
// Copyright (c) 2026 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
//
// SPDX-License-Identifier: Apache-2.0 WITH Swift-exception
//
//===----------------------------------------------------------------------===//
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
extension InputSpan: Iterable_ where Element: ~Copyable {
public typealias BorrowingIterator_ = Span<Element>.BorrowingIterator_
@inlinable
public var underestimatedCount_: Int { count }
@_lifetime(borrow self)
@inlinable
public func makeBorrowingIterator_() -> BorrowingIterator_ {
BorrowingIterator_(self.span)
}
}
#endif
@@ -17,11 +17,14 @@
import InternalCollectionsUtilities
#endif
@available(SwiftStdlib 6.4, *)
extension MutableSpan: RandomAccessContainer where Element: ~Copyable {
@_alwaysEmitIntoClient
@_lifetime(borrow self)
public func makeBorrowingIterator(from start: Int) -> SpanIterator<Element_> {
var it = SpanIterator(self.span)
public func makeBorrowingIterator(
from start: Int
) -> BorrowingIterator_ {
var it = Span<Element>.BorrowingIterator_(self.span)
var remainder = start
while remainder > 0 {
let d = it.skip_(by: remainder)
@@ -32,7 +35,9 @@ extension MutableSpan: RandomAccessContainer where Element: ~Copyable {
}
@_alwaysEmitIntoClient
public func currentIndex(of iterator: borrowing SpanIterator<Element>) -> Int {
public func currentIndex(
of iterator: borrowing BorrowingIterator_
) -> Int {
precondition(
self.span.isTriviallyIdentical(to: iterator._span),
"Invalid iterator")
@@ -72,6 +77,7 @@ extension MutableSpan: RandomAccessContainer where Element: ~Copyable {
}
}
@available(SwiftStdlib 6.4, *)
extension MutableSpan: MutableContainer where Element: ~Copyable {
@_alwaysEmitIntoClient
@_lifetime(&self)
@@ -0,0 +1,35 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Collections open source project
//
// Copyright (c) 2026 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
//
// SPDX-License-Identifier: Apache-2.0 WITH Swift-exception
//
//===----------------------------------------------------------------------===//
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
extension MutableSpan: Iterable_ where Element: ~Copyable {
public typealias BorrowingIterator_ = Span<Element>.BorrowingIterator_
public typealias Element_ = Element
@inlinable
public var underestimatedCount_: Int { count }
@_lifetime(borrow self)
@inlinable
public func makeBorrowingIterator_() -> BorrowingIterator_ {
// FIXME: This should be declared to return BorrowingIterator, but it
// clashes with the stdlib's alternate definition:
// error: 'BorrowingIterator' is ambiguous for type lookup in this context
// Two different typealiases with the same name wreaks havoc with inference?
BorrowingIterator_(self.span)
}
}
#endif
@@ -16,7 +16,7 @@ import InternalCollectionsUtilities
#endif
#if compiler(>=6.2) && UnstableContainersPreview
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension OutputSpan: RandomAccessContainer, MutableContainer
where Element: ~Copyable
{
@@ -0,0 +1,31 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Collections open source project
//
// Copyright (c) 2026 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
//
// SPDX-License-Identifier: Apache-2.0 WITH Swift-exception
//
//===----------------------------------------------------------------------===//
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
extension OutputSpan: Iterable_ where Element: ~Copyable {
public typealias Element_ = Element
public typealias BorrowingIterator_ = Span<Element>.BorrowingIterator_
@inlinable
public var underestimatedCount_: Int { count }
@_lifetime(borrow self)
@inlinable
public func makeBorrowingIterator_() -> BorrowingIterator_ {
BorrowingIterator_(self.span)
}
}
#endif
@@ -0,0 +1,68 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Collections open source project
//
// Copyright (c) 2026 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
//
// SPDX-License-Identifier: Apache-2.0 WITH Swift-exception
//
//===----------------------------------------------------------------------===//
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
extension Range: Iterable_
where Bound: Strideable, Bound.Stride: SignedInteger
{
public typealias Element_ = Bound
@frozen
public struct BorrowingIterator_: BorrowingIteratorProtocol_, ~Copyable {
@usableFromInline
internal var _current: InlineArray<1, Bound>
@usableFromInline
internal var _end: Bound
@usableFromInline
internal var _progress: Bool
@inlinable
internal init(_ base: Range<Bound>) {
self._current = .init(repeating: base.lowerBound)
self._end = base.upperBound
self._progress = false
}
@inlinable
@_lifetime(&self)
public mutating func nextSpan_(maxCount: Int) -> Span<Bound> {
if _progress {
_current[0] = _current[0].advanced(by: 1)
}
guard _current[0] < _end else {
_progress = false
return .init()
}
_progress = true
return _current.span
}
}
@inlinable
public var underestimatedCount_: Int {
guard let count = Int(exactly: lowerBound.distance(to: upperBound)) else {
return 0
}
return count
}
@inlinable
public func makeBorrowingIterator_() -> BorrowingIterator_ {
BorrowingIterator_(self)
}
}
#endif
@@ -13,13 +13,14 @@
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
extension Span: RandomAccessContainer where Element: ~Copyable {
@_alwaysEmitIntoClient
@_lifetime(borrow self)
public func makeBorrowingIterator(from start: Int) -> SpanIterator<Element> {
public func makeBorrowingIterator(from start: Int) -> BorrowingIterator_ {
precondition(start >= 0 && start <= self.count, "Index out of bounds")
// FIXME: SpanIterator needs to have a direct initializer that takes `start`
var it = SpanIterator(self)
var it = BorrowingIterator_(self)
var remainder = start
while remainder > 0 {
let d = it.skip_(by: remainder)
@@ -30,7 +31,7 @@ extension Span: RandomAccessContainer where Element: ~Copyable {
}
@_alwaysEmitIntoClient
public func currentIndex(of iterator: borrowing SpanIterator<Element>) -> Int {
public func currentIndex(of iterator: borrowing BorrowingIterator_) -> Int {
// FIXME: SpanIterator needs to have public `base` and `position` properties
precondition(
self.isTriviallyIdentical(to: iterator._span),
@@ -0,0 +1,79 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Collections open source project
//
// Copyright (c) 2026 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
//
// SPDX-License-Identifier: Apache-2.0 WITH Swift-exception
//
//===----------------------------------------------------------------------===//
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
extension Span: Iterable_ where Element: ~Copyable {
public typealias Element_ = Element
@inlinable
public var underestimatedCount_: Int { count }
@inlinable
@_lifetime(borrow self)
public func makeBorrowingIterator_() -> BorrowingIterator_ {
BorrowingIterator_(self)
}
}
@available(SwiftStdlib 5.0, *)
extension Span where Element: ~Copyable {
/// A borrowing iterator that provides access to the elements of a single
/// span through a `BorrowingIteratorProtocol` interface.
@available(SwiftStdlib 6.4, *)
public struct BorrowingIterator_:
BorrowingIteratorProtocol_, ~Copyable, ~Escapable
{
public typealias Element_ = Element
@usableFromInline
internal var _span: Span<Element_>
@usableFromInline
internal var _start: Int
@usableFromInline
internal var _count: Int
@_lifetime(copy elements)
public init(_ elements: Span<Element_>) {
_span = elements
_start = 0
_count = elements.count
}
@_alwaysEmitIntoClient
@_lifetime(&self)
@_lifetime(self: copy self)
@_transparent
public mutating func nextSpan_(maxCount: Int) -> Span<Element_> {
let c = Swift.min(maxCount, _count)
defer {
_start &+= c
_count &-= c
}
return _span.extracting(droppingFirst: _start).extracting(first: c)
}
@_alwaysEmitIntoClient
@_lifetime(self: copy self)
public mutating func skip_(by offset: Int) -> Int {
let c = Swift.min(offset, _count)
defer {
_start &+= c
_count &-= c
}
return c
}
}
}
#endif
@@ -17,7 +17,7 @@ import InternalCollectionsUtilities
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension Iterable_
where
Self: ~Copyable & ~Escapable, Element_: Equatable,
@@ -37,7 +37,7 @@ where
}
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension Iterable_
where
Self: ~Copyable & ~Escapable,
@@ -79,7 +79,7 @@ where
}
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension BorrowingIteratorProtocol_
where
Self: ~Copyable & ~Escapable,
@@ -173,7 +173,7 @@ where
}
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension BorrowingIteratorProtocol_
where
Self: ~Copyable & ~Escapable,
@@ -13,7 +13,7 @@
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
public protocol BidirectionalContainer<Element>: Container, ~Copyable, ~Escapable
where Element: ~Copyable, Index: Comparable
{
@@ -66,7 +66,7 @@ where Element: ~Copyable, Index: Comparable
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension BidirectionalContainer
where Self: ~Copyable & ~Escapable, Element: ~Copyable {
@inlinable
@@ -17,7 +17,7 @@ import InternalCollectionsUtilities
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension Container where Self: ~Copyable & ~Escapable, Element: ~Copyable {
@_alwaysEmitIntoClient
internal func _spanwiseZip<Other: Container & ~Copyable & ~Escapable, E: Error>(
@@ -13,7 +13,7 @@
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
public protocol Container<Element>:
Iterable_, ~Copyable, ~Escapable
where Element: ~Copyable, Element == Element_, Failure_ == Never
@@ -217,7 +217,7 @@ public protocol Container<Element>:
func _customLastIndexOfEquatableElement(_ element: borrowing Element) -> Index??
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension Container where Self: ~Copyable & ~Escapable, Element: ~Copyable {
/// Return a span over the container's storage that begins with the element at
/// the given index, and extends to the end of the contiguous storage chunk
@@ -260,7 +260,7 @@ extension Container where Self: ~Copyable & ~Escapable, Element: ~Copyable {
}
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension Container where Self: ~Copyable & ~Escapable, Element: ~Copyable {
@_alwaysEmitIntoClient
public var isEmpty: Bool {
@@ -422,7 +422,7 @@ extension Container where Self: ~Copyable & ~Escapable, Element: ~Copyable {
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension Container where Self: ~Copyable & ~Escapable, Element: ~Copyable {
@_alwaysEmitIntoClient
@_transparent
@@ -13,7 +13,7 @@
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
public protocol DynamicContainer<Element>: RangeReplaceableContainer, ~Copyable
where Element: ~Copyable
{
@@ -41,7 +41,7 @@ where Element: ~Copyable
var freeCapacity: Int { get }
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension DynamicContainer where Self: ~Copyable, Element: ~Copyable {
@_alwaysEmitIntoClient
public init() {
@@ -104,7 +104,7 @@ extension DynamicContainer where Self: ~Copyable, Element: ~Copyable {
}
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension DynamicContainer where Self: ~Copyable, Element: Copyable {
@_alwaysEmitIntoClient
public init(repeating repeatedValue: Element, count: Int) {
@@ -13,7 +13,7 @@
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
public protocol MutableContainer<Element>:
PermutableContainer, ~Copyable, ~Escapable
where
@@ -97,7 +97,7 @@ where
) -> MutableSpan<Element>
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension MutableContainer
where Self: ~Copyable & ~Escapable, Element: ~Copyable
{
@@ -13,7 +13,7 @@
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
public protocol PermutableContainer<Element>: Container, ~Copyable, ~Escapable
where Element: ~Copyable
{
@@ -13,7 +13,7 @@
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
public protocol RandomAccessContainer<Element>
: BidirectionalContainer, ~Copyable, ~Escapable
where Element: ~Copyable {
@@ -70,7 +70,7 @@ extension RandomAccessCollection {
}
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension RandomAccessContainer
where
Self: ~Copyable & ~Escapable,
@@ -129,7 +129,7 @@ where
}
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension RandomAccessContainer
where
Self: ~Copyable & ~Escapable,
@@ -198,7 +198,7 @@ where
// Disambiguate parallel extensions on RandomAccessContainer and RandomAccessCollection
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension RandomAccessCollection
where
Self: RandomAccessContainer,
@@ -15,7 +15,7 @@
// FIXME: Figure out if it would be possible to add the container-based
// `relative(to:)` to the existing `RangeExpression`.
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
public protocol RangeExpression2<Bound>: RangeExpression {
override associatedtype Bound: Comparable
@@ -26,7 +26,7 @@ public protocol RangeExpression2<Bound>: RangeExpression {
override func contains(_ element: Bound) -> Bool
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension Range: RangeExpression2 {
@inlinable
public func relative<C: Container & ~Copyable & ~Escapable>(
@@ -36,7 +36,7 @@ extension Range: RangeExpression2 {
}
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension ClosedRange: RangeExpression2 {
@inlinable
public func relative<C: Container & ~Copyable & ~Escapable>(
@@ -47,7 +47,7 @@ extension ClosedRange: RangeExpression2 {
}
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension PartialRangeFrom: RangeExpression2 {
@inlinable
public func relative<C: Container & ~Copyable & ~Escapable>(
@@ -57,7 +57,7 @@ extension PartialRangeFrom: RangeExpression2 {
}
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension PartialRangeUpTo: RangeExpression2 {
@inlinable
public func relative<C: Container & ~Copyable & ~Escapable>(
@@ -67,7 +67,7 @@ extension PartialRangeUpTo: RangeExpression2 {
}
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension PartialRangeThrough: RangeExpression2 {
@inlinable
public func relative<C: Container & ~Copyable & ~Escapable>(
@@ -19,7 +19,7 @@ import InternalCollectionsUtilities
//MARK: - Protocol Definition
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
public protocol RangeReplaceableContainer<Element>
: Container, ~Copyable, ~Escapable
where
@@ -70,7 +70,7 @@ where
//MARK: - Default Implementations
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension RangeReplaceableContainer
where Self: ~Copyable & ~Escapable, Element: ~Copyable
{
@@ -170,7 +170,7 @@ where Self: ~Copyable & ~Escapable, Element: ~Copyable
//MARK: - Standard Extensions
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension RangeReplaceableContainer
where Self: ~Copyable & ~Escapable, Element: ~Copyable
{
@@ -291,7 +291,7 @@ where Self: ~Copyable & ~Escapable, Element: ~Copyable
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension RangeReplaceableContainer
where Self: ~Copyable & ~Escapable, Element: ~Copyable {
@_alwaysEmitIntoClient
@@ -353,7 +353,7 @@ where Self: ~Copyable & ~Escapable, Element: ~Copyable {
}
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension RangeReplaceableContainer
where
Self: BidirectionalContainer,
@@ -373,7 +373,7 @@ where
}
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension RangeReplaceableContainer
where Self: ~Copyable & ~Escapable, Element: ~Copyable
{
@@ -397,7 +397,7 @@ where Self: ~Copyable & ~Escapable, Element: ~Copyable
}
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension RangeReplaceableContainer
where Self: BidirectionalContainer & ~Copyable & ~Escapable, Element: ~Copyable
{
@@ -427,7 +427,7 @@ where Self: BidirectionalContainer & ~Copyable & ~Escapable, Element: ~Copyable
}
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension RangeReplaceableContainer
where Self: BidirectionalContainer & ~Copyable & ~Escapable, Element: ~Copyable
{
@@ -439,7 +439,7 @@ where Self: BidirectionalContainer & ~Copyable & ~Escapable, Element: ~Copyable
}
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension RangeReplaceableContainer
where Self: ~Copyable & ~Escapable, Element: ~Copyable
{
@@ -556,7 +556,7 @@ where Self: ~Copyable & ~Escapable, Element: ~Copyable
}
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension RangeReplaceableContainer
where Self: ~Copyable & ~Escapable, Element: ~Copyable {
/// Appends at most `newItemCount` items generated by a producer to the end of
@@ -663,7 +663,7 @@ where Self: ~Copyable & ~Escapable, Element: ~Copyable {
//MARK: - Standard Extensions Requiring Copyability
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension RangeReplaceableContainer
where
Self: ~Copyable & ~Escapable,
@@ -13,7 +13,7 @@
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension Iterable_
where Self: ~Copyable & ~Escapable, Element_: ~Copyable
{
@@ -37,7 +37,7 @@ extension Iterable_
}
// Ambiguity breakers
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension Sequence where Self: Iterable_ {
public func reduce<Result: ~Copyable>(
_ initialResult: consuming Result,
@@ -57,7 +57,7 @@ extension Sequence where Self: Iterable_ {
}
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension Iterable_
where Self: ~Copyable & ~Escapable, Element_: ~Copyable
{
@@ -92,7 +92,7 @@ extension Iterable_
}
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension Iterable_
where Self: ~Copyable & ~Escapable, Element_: ~Copyable & Equatable {
@inlinable
@@ -1,223 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Collections open source project
//
// Copyright (c) 2026 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
//
// SPDX-License-Identifier: Apache-2.0 WITH Swift-exception
//
//===----------------------------------------------------------------------===//
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 5.0, *)
extension Span: Iterable_ where Element: ~Copyable {
public typealias BorrowingIterator_ = SpanIterator<Element>
public typealias Element_ = Element
@inlinable
public var underestimatedCount_: Int { count }
@_lifetime(borrow self)
@inlinable
public func makeBorrowingIterator_() -> SpanIterator<Element> {
SpanIterator(self)
}
}
@available(SwiftStdlib 5.0, *)
extension MutableSpan: Iterable_ where Element: ~Copyable {
public typealias BorrowingIterator_ = SpanIterator<Element>
public typealias Element_ = Element
@inlinable
public var underestimatedCount_: Int { count }
@_lifetime(borrow self)
@inlinable
public func makeBorrowingIterator_() -> SpanIterator<Element> {
// FIXME: This should be declared to return BorrowingIterator, but it
// clashes with the stdlib's alternate definition:
// error: 'BorrowingIterator' is ambiguous for type lookup in this context
// Two different typealiases with the same name wreaks havoc with inference?
SpanIterator(self.span)
}
}
@available(SwiftStdlib 5.0, *)
extension OutputSpan: Iterable_ where Element: ~Copyable {
public typealias BorrowingIterator_ = SpanIterator<Element>
@inlinable
public var underestimatedCount_: Int { count }
@_lifetime(borrow self)
@inlinable
public func makeBorrowingIterator_() -> BorrowingIterator_ {
SpanIterator(self.span)
}
}
@available(SwiftStdlib 5.0, *)
extension InputSpan: Iterable_ where Element: ~Copyable {
public typealias BorrowingIterator_ = SpanIterator<Element>
@inlinable
public var underestimatedCount_: Int { count }
@_lifetime(borrow self)
@inlinable
public func makeBorrowingIterator_() -> BorrowingIterator_ {
SpanIterator(self.span)
}
}
@available(SwiftStdlib 6.2, *)
extension Array: Iterable_ {
public typealias BorrowingIterator_ = SpanIterator<Element>
@inlinable
public var underestimatedCount_: Int { count }
@_lifetime(borrow self)
@inlinable
public func makeBorrowingIterator_() -> BorrowingIterator_ {
SpanIterator(self.span)
}
}
@available(SwiftStdlib 6.2, *)
extension InlineArray: Iterable_ where Element: ~Copyable {
public typealias BorrowingIterator_ = SpanIterator<Element>
@inlinable
public var underestimatedCount_: Int { count }
@_lifetime(borrow self)
@inlinable
public func makeBorrowingIterator_() -> SpanIterator<Element> {
// FIXME: This should be declared to return BorrowingIterator, but it
// clashes with the stdlib's alternate definition:
// error: 'BorrowingIterator' is ambiguous for type lookup in this context
// Two different typealiases with the same name wreaks havoc with inference?
SpanIterator(self.span)
}
}
@available(SwiftStdlib 6.2, *)
extension Range: Iterable_
where Bound: Strideable, Bound.Stride: SignedInteger
{
public typealias Element = Bound
@frozen
public struct BorrowingIterator_: BorrowingIteratorProtocol_, ~Copyable {
@usableFromInline
internal var _current: InlineArray<1, Bound>
@usableFromInline
internal var _end: Bound
@usableFromInline
internal var _progress: Bool
@inlinable
internal init(_ base: Range<Bound>) {
self._current = .init(repeating: base.lowerBound)
self._end = base.upperBound
self._progress = false
}
@inlinable
@_lifetime(&self)
public mutating func nextSpan_(maxCount: Int) -> Span<Bound> {
if _progress {
_current[0] = _current[0].advanced(by: 1)
}
guard _current[0] < _end else {
_progress = false
return .init()
}
_progress = true
return _current.span
}
}
@_alwaysEmitIntoClient
@_transparent
package var _borrowingUnderestimatedCount: Int {
guard let count = Int(exactly: lowerBound.distance(to: upperBound)) else {
return 0
}
return count
}
@inlinable
public var underestimatedCount_: Int { _borrowingUnderestimatedCount }
@inlinable
public func makeBorrowingIterator_() -> BorrowingIterator_ {
BorrowingIterator_(self)
}
}
@available(SwiftStdlib 6.2, *)
extension ClosedRange: Iterable_
where Bound: Strideable, Bound.Stride: SignedInteger
{
public typealias Element = Bound
@frozen
public struct BorrowingIterator_: BorrowingIteratorProtocol_, ~Copyable {
@usableFromInline
internal var _current: InlineArray<1, Bound>
@usableFromInline
internal var _last: Bound
@usableFromInline
internal var _progress: Bool
@inlinable
internal init(_ base: ClosedRange<Bound>) {
self._current = .init(repeating: base.lowerBound)
self._last = base.upperBound
self._progress = false
}
@inlinable
@_lifetime(&self)
public mutating func nextSpan_(maxCount: Int) -> Span<Bound> {
if _progress {
_current[0] = _current[0].advanced(by: 1)
}
guard _current[0] <= _last else {
_progress = false
return .init()
}
_progress = true
return _current.span
}
}
@_alwaysEmitIntoClient
@_transparent
package var _borrowingUnderestimatedCount: Int {
guard let distance = Int(exactly: lowerBound.distance(to: upperBound))
else { return 0 }
let advanced = distance.addingReportingOverflow(1)
guard !advanced.overflow else { return 0 }
return advanced.partialValue
}
@inlinable
public var underestimatedCount_: Int { _borrowingUnderestimatedCount }
@inlinable
public func makeBorrowingIterator_() -> BorrowingIterator_ {
BorrowingIterator_(self)
}
}
#endif
@@ -17,7 +17,7 @@ import InternalCollectionsUtilities
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension Iterable_ where Self: ~Copyable & ~Escapable, Element_: Copyable {
@inlinable
package func _copyContents(
@@ -13,8 +13,14 @@
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
public protocol Iterable_<Element_, Failure_>: ~Copyable, ~Escapable {
// FIXME: None of these names should not have trailing underscores, but that
// would clash with the stdlib's versions:
// error: 'BorrowingIterator' is ambiguous for type lookup in this context
//
// This is likely best resolved by removing these definitions as soon as they
// appear in the stdlib.
associatedtype Element_: ~Copyable
associatedtype Failure_: Error = Never
@@ -30,7 +36,7 @@ public protocol Iterable_<Element_, Failure_>: ~Copyable, ~Escapable {
) -> Bool?
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension Iterable_
where
Self: ~Copyable & ~Escapable, Element_: ~Copyable
@@ -44,7 +50,7 @@ where
}
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension Iterable_ where Self: Sequence {
@inlinable
public var underestimatedCount_: Int { 0 }
@@ -15,6 +15,7 @@
@available(SwiftStdlib 5.0, *)
extension Producer where Self: ~Copyable & ~Escapable, Element: ~Copyable {
@available(SwiftStdlib 6.4, *)
@inlinable
public consuming func collect<
R: DynamicContainer<Element> & ~Copyable
@@ -27,6 +28,7 @@ extension Producer where Self: ~Copyable & ~Escapable, Element: ~Copyable {
/// Collect all items generated by this producer into the provided
/// range-replaceable container instance, which must be able to accommodate
/// every new element.
@available(SwiftStdlib 6.4, *)
@inlinable
public consuming func collect(
into container: inout some RangeReplaceableContainer<Element> & ~Copyable & ~Escapable
@@ -49,6 +51,7 @@ extension Producer where Self: ~Copyable & ~Escapable, Element: ~Copyable {
/// Collect all items generated by this producer into the provided
/// dynamic container instance, resizing it if necessary.
@available(SwiftStdlib 6.4, *)
@inlinable
public consuming func collect(
into container: inout some DynamicContainer<Element> & ~Copyable
@@ -1,61 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Collections open source project
//
// Copyright (c) 2026 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
//
// SPDX-License-Identifier: Apache-2.0 WITH Swift-exception
//
//===----------------------------------------------------------------------===//
#if compiler(>=6.4) && UnstableContainersPreview
/// A borrowing iterator that provides access to the elements of a single
/// span through a `BorrowingIteratorProtocol` interface.
@available(SwiftStdlib 5.0, *)
public struct SpanIterator<Element_>: BorrowingIteratorProtocol_, ~Copyable, ~Escapable
where Element_: ~Copyable
{
@usableFromInline
internal var _span: Span<Element_>
@usableFromInline
internal var _start: Int
@usableFromInline
internal var _count: Int
@_lifetime(copy elements)
public init(_ elements: Span<Element_>) {
_span = elements
_start = 0
_count = elements.count
}
@_alwaysEmitIntoClient
@_lifetime(&self)
@_lifetime(self: copy self)
@_transparent
public mutating func nextSpan_(maxCount: Int) -> Span<Element_> {
let c = Swift.min(maxCount, _count)
defer {
_start &+= c
_count &-= c
}
return _span.extracting(droppingFirst: _start).extracting(first: c)
}
@_alwaysEmitIntoClient
@_lifetime(self: copy self)
public mutating func skip_(by offset: Int) -> Int {
let c = Swift.min(offset, _count)
defer {
_start &+= c
_count &-= c
}
return c
}
}
#endif
@@ -311,6 +311,7 @@ extension RigidDeque /*where Element: Copyable*/ {
}
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
internal mutating func _append<
S: Iterable_ & ~Copyable & ~Escapable
@@ -334,6 +335,7 @@ extension RigidDeque /*where Element: Copyable*/ {
/// - newElements: The new elements to copy into the deque.
///
/// - Complexity: O(*m*), where *m* is the length of `newElements`.
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
public mutating func append<S: Iterable_ & ~Copyable & ~Escapable>(
copying newElements: borrowing S
@@ -375,6 +377,7 @@ extension RigidDeque /*where Element: Copyable*/ {
/// - items: The new elements to copy into the deque.
///
/// - Complexity: O(*m*), where *m* is the length of `items`. @available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
public mutating func append<
S: Iterable_ & Sequence<Element>
@@ -40,13 +40,14 @@ extension RigidDeque where Element: Equatable & ~Copyable {
guard !left.isTriviallyIdentical(to: right) else { return true }
#if compiler(>=6.4) && UnstableContainersPreview
return left._elementsEqual(right)
#else
if #available(anyAppleOS 27, *) {
return left._elementsEqual(right)
}
#endif
for i in 0 ..< left.count {
guard left[i] == right[i] else { return false }
}
return true
#endif
}
}
@@ -129,6 +129,7 @@ extension RigidDeque /*where Element: Copyable*/ {
/// - capacity: The storage capacity of the new deque.
/// - contents: A sequence whose contents to copy into the new deque.
/// The sequence must not contain more than `capacity` elements.
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
@inline(__always)
public init<S: Iterable_ & ~Copyable & ~Escapable>(
@@ -183,6 +184,7 @@ extension RigidDeque /*where Element: Copyable*/ {
/// - capacity: The storage capacity of the new deque.
/// - contents: A sequence whose contents to copy into the new deque.
/// The sequence must not contain more than `capacity` elements.
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
@inline(__always)
public init<S: Iterable_ & Sequence<Element>>(
@@ -193,7 +195,9 @@ extension RigidDeque /*where Element: Copyable*/ {
self.init(capacity: capacity)
try self._append(copying: contents)
}
#endif
#if compiler(>=6.4) && UnstableContainersPreview
/// Creates a new deque with the specified capacity, holding a copy
/// of the contents of a given collection.
///
@@ -203,6 +207,7 @@ extension RigidDeque /*where Element: Copyable*/ {
/// than or equal to the count of the collection.
/// - contents: A collection whose contents to copy into the new deque.
/// The sequence must not contain more than `capacity` elements.
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
@inline(__always)
public init<S: Iterable_ & Collection<Element>>(
@@ -356,6 +356,7 @@ extension RigidDeque /* where Element: Copyable */ {
}
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
@inlinable
internal mutating func _insertContainer<
C: Container<Element> & ~Copyable & ~Escapable
@@ -418,6 +419,7 @@ extension RigidDeque /* where Element: Copyable */ {
/// a valid index of the deque.
///
/// - Complexity: O(`self.count` + `items.count`).
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
@inline(__always)
public mutating func insert<
@@ -480,6 +482,7 @@ extension RigidDeque /* where Element: Copyable */ {
/// a valid index of the deque.
///
/// - Complexity: O(`self.count` + `items.count`)
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
@inline(__always)
public mutating func insert<
@@ -288,6 +288,7 @@ extension RigidDeque /*where Element: Copyable*/ {
}
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
@inlinable
internal mutating func _prepend<
S: Iterable_ & ~Copyable & ~Escapable
@@ -307,6 +308,7 @@ extension RigidDeque /*where Element: Copyable*/ {
_handle.rotate(toStartAtOffset: oldCount)
}
@available(SwiftStdlib 6.4, *)
@inlinable
internal mutating func _prepend<
S: Iterable_ & ~Copyable & ~Escapable
@@ -336,6 +338,7 @@ extension RigidDeque /*where Element: Copyable*/ {
/// - items: The new elements to copy into the deque.
///
/// - Complexity: O(*m*), where *m* is the length of `items`.
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
public mutating func prepend<S: Iterable_ & ~Copyable & ~Escapable>(
copying items: borrowing S
@@ -354,6 +357,7 @@ extension RigidDeque /*where Element: Copyable*/ {
/// - items: The new elements to copy into the deque.
///
/// - Complexity: O(`items.count`)
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
public mutating func prepend<C: Container<Element> & ~Copyable & ~Escapable>(
copying items: borrowing C
@@ -441,6 +445,7 @@ extension RigidDeque /*where Element: Copyable*/ {
/// - items: The new elements to copy into the deque.
///
/// - Complexity: O(*m*), where *m* is the length of `items`.
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
public mutating func prepend<S: Iterable_ & Sequence<Element>>(
copying items: borrowing S
@@ -458,6 +463,7 @@ extension RigidDeque /*where Element: Copyable*/ {
/// - items: The new elements to copy into the deque.
///
/// - Complexity: O(*m*), where *m* is the length of `items`.
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
public mutating func prepend<S: Iterable_ & Collection<Element>>(
copying items: borrowing S
@@ -475,6 +481,7 @@ extension RigidDeque /*where Element: Copyable*/ {
/// - items: The new elements to copy into the deque.
///
/// - Complexity: O(*m*), where *m* is the length of `items`.
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
public mutating func prepend<C: Container<Element> & Sequence<Element>>(
copying items: borrowing C
@@ -491,6 +498,7 @@ extension RigidDeque /*where Element: Copyable*/ {
/// - items: The new elements to copy into the deque.
///
/// - Complexity: O(*m*), where *m* is the length of `items`.
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
public mutating func prepend<C: Container<Element> & Collection<Element>>(
copying items: borrowing C
@@ -153,7 +153,6 @@ extension RigidDeque where Element: ~Copyable {
return _handle.uncheckedRemoveFirst()
}
#if !UnstableContainersPreview
/// Removes and returns the last element of the deque, if there is one.
///
/// - Returns: The last element of the original deque if it was not empty;
@@ -162,10 +161,11 @@ extension RigidDeque where Element: ~Copyable {
/// - Complexity: O(1)
@_alwaysEmitIntoClient
public mutating func popLast() -> Element? {
// FIXME: Remove this algorithm; it is already provided by
// RangeReplaceableContainer, albeit with stricter availability.
guard !isEmpty else { return nil }
return _handle.uncheckedRemoveLast()
}
#endif
}
#endif
@@ -456,6 +456,7 @@ extension RigidDeque /* where Element: Copyable */ {
}
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
@inlinable
internal mutating func _replace<
C: Container<Element> & ~Copyable & ~Escapable
@@ -529,6 +530,7 @@ extension RigidDeque /* where Element: Copyable */ {
/// - items: The new elements to copy into the collection.
///
/// - Complexity: O(`self.count` + `items.count`)
@available(SwiftStdlib 6.4, *)
@inlinable
@inline(__always)
public mutating func replace<
@@ -606,6 +608,7 @@ extension RigidDeque /* where Element: Copyable */ {
///
/// - Complexity: O(*n* + *m*), where *n* is count of this deque and
/// *m* is the count of `items`.
@available(SwiftStdlib 6.4, *)
@inlinable
@inline(__always)
public mutating func replace<
@@ -298,6 +298,7 @@ extension UniqueDeque /*where Element: Copyable*/ {
}
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
internal mutating func _append<S: Iterable_ & ~Copyable & ~Escapable>(
copying items: borrowing S
@@ -323,6 +324,7 @@ extension UniqueDeque /*where Element: Copyable*/ {
///
/// - Complexity: O(*m*), where *m* is the length of `items`, when amortized
/// over many similar invocations on the same deque
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
public mutating func append<S: Iterable_ & ~Copyable & ~Escapable>(
copying items: borrowing S
@@ -374,6 +376,7 @@ extension UniqueDeque /*where Element: Copyable*/ {
///
/// - Complexity: O(*m*), where *m* is the length of `items`, when
/// amortized over many similar invocations over the same deque.
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
public mutating func append<S: Iterable_ & Sequence<Element>>(
copying items: S
@@ -142,6 +142,7 @@ extension UniqueDeque /*where Element: Copyable*/ {
/// - capacity: The storage capacity of the new deque, or nil to let the
/// deque grow itself as needed to accomodate all items in `contents`.
/// - contents: A sequence whose contents to copy into the new deque.
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
@inline(__always)
public init<S: Iterable_ & ~Copyable & ~Escapable>(
@@ -180,6 +181,7 @@ extension UniqueDeque /*where Element: Copyable*/ {
/// deque grow itself as needed to accomodate all items in `contents`.
/// - contents: A sequence whose contents to copy into the new deque.
/// The sequence must not contain more than `capacity` elements.
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
@inline(__always)
public init<S: Iterable_ & Sequence<Element>>(
@@ -198,6 +200,7 @@ extension UniqueDeque /*where Element: Copyable*/ {
/// - capacity: The storage capacity of the new deque.
/// - contents: A sequence whose contents to copy into the new deque.
/// The sequence must not contain more than `capacity` elements.
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
@inline(__always)
public init<S: Iterable_ & Collection<Element>>(
@@ -374,6 +374,7 @@ extension UniqueDeque /* where Element: Copyable */ {
}
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
@inlinable
internal mutating func _insertContainer<
C: Container<Element> & ~Copyable & ~Escapable
@@ -439,6 +440,7 @@ extension UniqueDeque /* where Element: Copyable */ {
///
/// - Complexity: O(`self.count` + `items.count`) when amortized over many
/// similar invocations on the same deque.
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
@inline(__always)
public mutating func insert<
@@ -505,6 +507,7 @@ extension UniqueDeque /* where Element: Copyable */ {
///
/// - Complexity: O(`self.count` + `items.count`) when amortized over many
/// similar invocations on the same deque.
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
@inline(__always)
public mutating func insert<
@@ -320,6 +320,7 @@ extension UniqueDeque /*where Element: Copyable*/ {
}
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
@inlinable
internal mutating func _prepend<S: Iterable_ & ~Copyable & ~Escapable>(
copying items: borrowing S
@@ -338,6 +339,7 @@ extension UniqueDeque /*where Element: Copyable*/ {
_storage._handle.rotate(toStartAtOffset: oldCount)
}
@available(SwiftStdlib 6.4, *)
@inlinable
internal mutating func _prepend<S: Iterable_ & ~Copyable & ~Escapable>(
copying items: borrowing S,
@@ -366,6 +368,7 @@ extension UniqueDeque /*where Element: Copyable*/ {
///
/// - Complexity: O(*m*), where *m* is the length of `items`, as amortized
/// over many similar invocations on the same deque.
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
public mutating func prepend<S: Iterable_ & ~Copyable & ~Escapable>(
copying items: borrowing S
@@ -385,6 +388,7 @@ extension UniqueDeque /*where Element: Copyable*/ {
///
/// - Complexity: O(`items.count`) when amortized over many similar
/// invocations on the same deque.
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
public mutating func prepend<C: Container<Element> & ~Copyable & ~Escapable>(
copying items: borrowing C
@@ -477,6 +481,7 @@ extension UniqueDeque /*where Element: Copyable*/ {
///
/// - Complexity: O(*m*), where *m* is the length of `items`, as amortized
/// over many similar invocations on the same deque.
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
public mutating func prepend<S: Iterable_ & Sequence<Element>>(
copying items: borrowing S
@@ -495,6 +500,7 @@ extension UniqueDeque /*where Element: Copyable*/ {
///
/// - Complexity: O(*m*), where *m* is the length of `items` when amortized
/// over many similar invocations on the same deque.
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
public mutating func prepend<S: Iterable_ & Collection<Element>>(
copying items: borrowing S
@@ -513,6 +519,7 @@ extension UniqueDeque /*where Element: Copyable*/ {
///
/// - Complexity: O(*m*), where *m* is the length of `items` when amortized
/// over many similar invocations on the same deque.
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
public mutating func prepend<C: Container<Element> & Sequence<Element>>(
copying items: borrowing C
@@ -530,6 +537,7 @@ extension UniqueDeque /*where Element: Copyable*/ {
///
/// - Complexity: O(*m*), where *m* is the length of `items` when amortized
/// over many similar invocations on the same deque.
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
public mutating func prepend<C: Container<Element> & Collection<Element>>(
copying items: C
@@ -136,7 +136,6 @@ extension UniqueDeque where Element: ~Copyable {
_storage.popFirst()
}
#if !UnstableContainersPreview
/// Removes and returns the last element of the deque, if there is one.
///
/// - Returns: The last element of the original deque if it was not empty;
@@ -146,9 +145,10 @@ extension UniqueDeque where Element: ~Copyable {
@_alwaysEmitIntoClient
@inline(__always)
public mutating func popLast() -> Element? {
// FIXME: Remove this algorithm; it is already provided by
// RangeReplaceableContainer, albeit with stricter availability.
_storage.popLast()
}
#endif
}
#endif
@@ -465,6 +465,7 @@ extension UniqueDeque /* where Element: Copyable */ {
}
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
@inlinable
internal mutating func _replace<
C: Container<Element> & ~Copyable & ~Escapable
@@ -539,6 +540,7 @@ extension UniqueDeque /* where Element: Copyable */ {
/// - items: The new elements to copy into the collection.
///
/// - Complexity: O(`self.count` + `items.count`)
@available(SwiftStdlib 6.4, *)
@inlinable
@inline(__always)
public mutating func replace<
@@ -618,6 +620,7 @@ extension UniqueDeque /* where Element: Copyable */ {
///
/// - Complexity: O(*n* + *m*), where *n* is count of this deque and
/// *m* is the count of `items`.
@available(SwiftStdlib 6.4, *)
@inlinable
@inline(__always)
public mutating func replace<
@@ -74,7 +74,9 @@ class RigidArrayTests: CollectionTestCase {
expectEqual(tracker.instances, 2 * layout.count)
expectRigidArrayContents(items, equalTo: expected)
#if compiler(>=6.4) && UnstableContainersPreview
checkIterable(items, expectedContents: expected)
if #available(SwiftStdlib 6.4, *) {
checkIterable(items, expectedContents: expected)
}
#endif
}
}
@@ -1206,6 +1208,7 @@ class RigidArrayTests: CollectionTestCase {
}
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
func test_insert_copying_Container() {
withSomeArrayLayouts("layout", ofCapacities: [0, 5, 10]) { layout in
withEvery("i", in: 0 ... layout.count) { i in
@@ -1438,6 +1441,7 @@ class RigidArrayTests: CollectionTestCase {
}
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
func test_replace_Container() {
withSomeArrayLayouts("layout", ofCapacities: [0, 5, 10]) { layout in
withEveryRange("range", in: 0 ..< layout.count) { range in
@@ -76,7 +76,9 @@ class UniqueArrayTests: CollectionTestCase {
expectEqual(tracker.instances, 2 * layout.count)
expectUniqueArrayContents(items, equalTo: expected)
#if compiler(>=6.4) && UnstableContainersPreview
checkIterable(items, expectedContents: expected)
if #available(SwiftStdlib 6.4, *) {
checkIterable(items, expectedContents: expected)
}
#endif
}
}
@@ -22,7 +22,7 @@ import ContainersPreview
#if compiler(>=6.4) && UnstableContainersPreview
final class IterableTests: XCTestCase {
@available(SwiftStdlib 6.2, *)
@available(SwiftStdlib 6.4, *)
func testBasic() {
let array = [1, 2, 3, 4, 5, 6, 7, 8]
@@ -63,7 +63,7 @@ final class IterableTests: XCTestCase {
}
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension Iterable_ where Self: ~Copyable & ~Escapable, Element_: Copyable {
func collectViaBorrowing() throws(Failure_) -> [Element_] {
var borrowIterator = makeBorrowingIterator_()
+16 -12
View File
@@ -82,16 +82,19 @@ internal func expectRigidDequeContents<
line: UInt = #line
) {
#if compiler(>=6.4) && UnstableContainersPreview
expectIterableContents(
left,
equivalentTo: right,
by: areEquivalent,
printer: printer,
message(),
trapping: trapping,
file: file,
line: line)
#else
if #available(SwiftStdlib 6.4, *) {
expectIterableContents(
left,
equivalentTo: right,
by: areEquivalent,
printer: printer,
message(),
trapping: trapping,
file: file,
line: line)
return
}
#endif
var c = 0
var j = right.startIndex
for i in 0 ..< left.count {
@@ -106,7 +109,6 @@ internal func expectRigidDequeContents<
right.formIndex(after: &j)
c += 1
}
#endif
}
final class RigidDequeTests: CollectionTestCase {
@@ -424,6 +426,7 @@ final class RigidDequeTests: CollectionTestCase {
}
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
func test_initCopyingBorrowingSequence() {
withEvery("c", in: 0 ..< 10) { c in
withEvery("capacity", in: [c, c + 1]) { capacity in
@@ -534,7 +537,7 @@ final class RigidDequeTests: CollectionTestCase {
}
}
}
func test_popLast() {
withEveryDeque("layout", ofCapacities: [0, 1, 2, 3, 5, 10]) { layout in
withLifetimeTracking { tracker in
@@ -1274,6 +1277,7 @@ final class RigidDequeTests: CollectionTestCase {
}
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 6.4, *)
func test_insert_RigidArray() {
withEveryDeque("layout", ofCapacities: [0, 1, 2, 3, 5, 10]) { layout in
withEvery("i", in: 0 ... layout.count) { i in
+13 -11
View File
@@ -82,16 +82,19 @@ internal func expectUniqueDequeContents<
line: UInt = #line
) {
#if compiler(>=6.4) && UnstableContainersPreview
expectIterableContents(
left,
equivalentTo: right,
by: areEquivalent,
printer: printer,
message(),
trapping: trapping,
file: file,
line: line)
#else
if #available(SwiftStdlib 6.4, *) {
expectIterableContents(
left,
equivalentTo: right,
by: areEquivalent,
printer: printer,
message(),
trapping: trapping,
file: file,
line: line)
return
}
#endif
var c = 0
var j = right.startIndex
for i in 0 ..< left.count {
@@ -106,7 +109,6 @@ internal func expectUniqueDequeContents<
right.formIndex(after: &j)
c += 1
}
#endif
}
final class UniqueDequeTests: CollectionTestCase {
@@ -124,7 +124,7 @@ public func expectIterableContents<
#if compiler(>=6.4) && UnstableContainersPreview
/// Check if `left` contains lifetime tracked instances whose payloads equal
/// the elements in `right`.
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
public func expectIterablePayloads<
Payload: Equatable,
E1: Iterable_<LifetimeTrackedStruct<Payload>, E> & ~Copyable & ~Escapable,
@@ -172,7 +172,7 @@ public func expectIterablePayloads<
/// Check if `left` contains lifetime tracked instances whose payloads equal
/// the elements in `right`.
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
public func expectIterablePayloads<
Payload: Equatable,
E1: Iterable_<LifetimeTracked<Payload>, E> & ~Copyable & ~Escapable,
@@ -220,7 +220,7 @@ public func expectIterablePayloads<
#endif
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
public func expectIterablesWithEquivalentElements<
S1: Iterable_ & ~Copyable & ~Escapable,
S2: Iterable_ & ~Copyable & ~Escapable
@@ -245,7 +245,7 @@ where
}
/// Check if `left` and `right` contain equal elements in the same order.
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
public func expectIterablesWithEqualElements<
Element: Equatable,
S1: Iterable_<Element, E> & ~Copyable & ~Escapable,
@@ -270,7 +270,7 @@ where
}
/// Check if `left` and `right` contain equal elements in the same order.
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
public func expectIterableContents<
Element: Equatable,
S1: Iterable_<Element, E> & ~Copyable & ~Escapable,
@@ -313,7 +313,7 @@ public func expectIterableContents<
}
/// Check if `left` and `right` contain equal elements in the same order.
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
public func expectIterableContents<
S1: Iterable_ & ~Copyable & ~Escapable,
C2: Collection,
@@ -19,7 +19,7 @@ import Collections
import ContainersPreview
#endif
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
@inlinable
public func checkIterable<
S: Iterable_ & ~Copyable & ~Escapable,
@@ -37,7 +37,7 @@ public func checkIterable<
file: file, line: line)
}
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
@inlinable
public func checkIterable<
S: Iterable_ & ~Copyable & ~Escapable,
@@ -84,10 +84,15 @@ public struct _StaccatoBorrowingIterator<Element: ~Copyable>: BorrowingIteratorP
internal var _offset: Int
@_lifetime(copy contents)
internal init(contents: Span<Element>, params: _StaccatoParameters) {
internal init(
contents: Span<Element>,
params: _StaccatoParameters,
start: _StaccatoIndex = .init(_offset: 0)
) {
precondition(start._offset >= 0 && start._offset <= params._count)
self._contents = contents
self._params = params
self._offset = 0
self._offset = start._offset
}
@_lifetime(&self) // FIXME: Should be `@_lifetime(copy self)`
@@ -97,6 +102,10 @@ public struct _StaccatoBorrowingIterator<Element: ~Copyable>: BorrowingIteratorP
_offset = endOffset
return _contents.extracting(startOffset ..< endOffset)
}
public var currentIndex: _StaccatoIndex {
_StaccatoIndex(_offset: _offset)
}
}
@available(SwiftStdlib 5.0, *)
@@ -132,8 +141,16 @@ extension StaccatoContainer: Container where Element: ~Copyable {
public var isEmpty: Bool { _contents.isEmpty }
public var count: Int { _contents.count }
@_lifetime(borrow self)
public func makeBorrowingIterator(from start: Index) -> BorrowingIterator_ {
BorrowingIterator_(contents: _contents.span, params: _params, start: start)
}
public func currentIndex(of iterator: borrowing BorrowingIterator_) -> Index {
iterator.currentIndex
}
package func _isValid(_ index: Index) -> Bool {
index._offset >= 0 && index._offset <= count
}
+32 -8
View File
@@ -7,6 +7,10 @@
objects = {
/* Begin PBXBuildFile section */
7D0DC7BF2FFD929900BEE8B2 /* Array+Iterable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D0DC7BE2FFD929500BEE8B2 /* Array+Iterable.swift */; };
7D0DC7C12FFD92BB00BEE8B2 /* InlineArray+Iterable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D0DC7C02FFD92B500BEE8B2 /* InlineArray+Iterable.swift */; };
7D0DC7C32FFD987800BEE8B2 /* Range+Iterable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D0DC7C22FFD987400BEE8B2 /* Range+Iterable.swift */; };
7D0DC7C52FFD990E00BEE8B2 /* ClosedRange+Iterable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D0DC7C42FFD990E00BEE8B2 /* ClosedRange+Iterable.swift */; };
7D12E33D2FF5CC2A003050AB /* OutputSpan+Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D12E33C2FF5CC2A003050AB /* OutputSpan+Helpers.swift */; };
7D12E33F2FF5DAE4003050AB /* _HTable+Deprecated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D12E33E2FF5DADE003050AB /* _HTable+Deprecated.swift */; };
7D12E3412FF5DD0B003050AB /* RigidSet+Deprecated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D12E3402FF5DD07003050AB /* RigidSet+Deprecated.swift */; };
@@ -157,6 +161,10 @@
7D77E6252FD0F880003FA63B /* UnsafePointer+Extras.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D77E6242FD0F87B003FA63B /* UnsafePointer+Extras.swift */; };
7D77E6272FD0F94B003FA63B /* UnsafeMutablePointer+Extras.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D77E6262FD0F940003FA63B /* UnsafeMutablePointer+Extras.swift */; };
7D945E6B2FF5E0D1001041A6 /* UniqueSet+Deprecations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D945E6A2FF5E0CB001041A6 /* UniqueSet+Deprecations.swift */; };
7D945E6D2FF71D76001041A6 /* Span+Iterable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D945E6C2FF71D76001041A6 /* Span+Iterable.swift */; };
7D945E6F2FF71DFF001041A6 /* MutableSpan+Iterable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D945E6E2FF71DF8001041A6 /* MutableSpan+Iterable.swift */; };
7D945E712FF71E58001041A6 /* OutputSpan+Iterable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D945E702FF71E53001041A6 /* OutputSpan+Iterable.swift */; };
7D945E732FF71E8C001041A6 /* InputSpan+Iterable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D945E722FF71E86001041A6 /* InputSpan+Iterable.swift */; };
7D9748D42E9748930098631A /* BigString+Chunk+UTF16.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D9748D32E9748930098631A /* BigString+Chunk+UTF16.swift */; };
7D9748D52E9748930098631A /* BigString+Chunk+UnicodeScalar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D9748D12E9748930098631A /* BigString+Chunk+UnicodeScalar.swift */; };
7D9748D62E9748930098631A /* BigString+Chunk+Character.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D9748CF2E9748930098631A /* BigString+Chunk+Character.swift */; };
@@ -189,7 +197,6 @@
7DA23F5A2F32C68300E4C03A /* RigidArray+Hashable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DA23F592F32C67D00E4C03A /* RigidArray+Hashable.swift */; };
7DA23F5C2F32C69100E4C03A /* RigidArray+Descriptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DA23F5B2F32C68B00E4C03A /* RigidArray+Descriptions.swift */; };
7DA296012FB79DC5005042B0 /* CollectionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DA295FF2FB79DC5005042B0 /* CollectionsTests.swift */; };
7DACFA122F75FBF100291F2E /* SpanIterator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DACFA112F75FBF100291F2E /* SpanIterator.swift */; };
7DAD899E2E8B09C300DD5786 /* UInt+first and last set bit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DAD899C2E8B09C300DD5786 /* UInt+first and last set bit.swift */; };
7DAD899F2E8B09C300DD5786 /* UInt+reversed.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DAD899D2E8B09C300DD5786 /* UInt+reversed.swift */; };
7DAD89A02E8B09C300DD5786 /* FixedWidthInteger+roundUpToPowerOfTwo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DAD899A2E8B09C300DD5786 /* FixedWidthInteger+roundUpToPowerOfTwo.swift */; };
@@ -209,7 +216,6 @@
7DB257A32F58B1D3007B539F /* UniqueDictionary+Debugging.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DB257A22F58B1CC007B539F /* UniqueDictionary+Debugging.swift */; };
7DC037B72FE3492D00CF0CB8 /* BorrowingIteratorProtocol+Copy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DC037B12FE3492D00CF0CB8 /* BorrowingIteratorProtocol+Copy.swift */; };
7DC037B82FE3492D00CF0CB8 /* Iterable+Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DC037AF2FE3492D00CF0CB8 /* Iterable+Utilities.swift */; };
7DC037B92FE3492D00CF0CB8 /* Iterable+Standard Conformances.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DC037AE2FE3492D00CF0CB8 /* Iterable+Standard Conformances.swift */; };
7DC037BA2FE3492D00CF0CB8 /* BorrowingIteratorProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DC037B02FE3492D00CF0CB8 /* BorrowingIteratorProtocol.swift */; };
7DC037BB2FE3492D00CF0CB8 /* Iterable+Algorithms.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DC037AD2FE3492D00CF0CB8 /* Iterable+Algorithms.swift */; };
7DC037BC2FE3492D00CF0CB8 /* BorrowingIteratorProtocol+Filter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DC037B32FE3492D00CF0CB8 /* BorrowingIteratorProtocol+Filter.swift */; };
@@ -619,6 +625,10 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
7D0DC7BE2FFD929500BEE8B2 /* Array+Iterable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Array+Iterable.swift"; sourceTree = "<group>"; };
7D0DC7C02FFD92B500BEE8B2 /* InlineArray+Iterable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "InlineArray+Iterable.swift"; sourceTree = "<group>"; };
7D0DC7C22FFD987400BEE8B2 /* Range+Iterable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Range+Iterable.swift"; sourceTree = "<group>"; };
7D0DC7C42FFD990E00BEE8B2 /* ClosedRange+Iterable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ClosedRange+Iterable.swift"; sourceTree = "<group>"; };
7D12E33C2FF5CC2A003050AB /* OutputSpan+Helpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "OutputSpan+Helpers.swift"; sourceTree = "<group>"; };
7D12E33E2FF5DADE003050AB /* _HTable+Deprecated.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "_HTable+Deprecated.swift"; sourceTree = "<group>"; };
7D12E3402FF5DD07003050AB /* RigidSet+Deprecated.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "RigidSet+Deprecated.swift"; sourceTree = "<group>"; };
@@ -783,6 +793,10 @@
7D77E6242FD0F87B003FA63B /* UnsafePointer+Extras.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UnsafePointer+Extras.swift"; sourceTree = "<group>"; };
7D77E6262FD0F940003FA63B /* UnsafeMutablePointer+Extras.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UnsafeMutablePointer+Extras.swift"; sourceTree = "<group>"; };
7D945E6A2FF5E0CB001041A6 /* UniqueSet+Deprecations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UniqueSet+Deprecations.swift"; sourceTree = "<group>"; };
7D945E6C2FF71D76001041A6 /* Span+Iterable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Span+Iterable.swift"; sourceTree = "<group>"; };
7D945E6E2FF71DF8001041A6 /* MutableSpan+Iterable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MutableSpan+Iterable.swift"; sourceTree = "<group>"; };
7D945E702FF71E53001041A6 /* OutputSpan+Iterable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "OutputSpan+Iterable.swift"; sourceTree = "<group>"; };
7D945E722FF71E86001041A6 /* InputSpan+Iterable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "InputSpan+Iterable.swift"; sourceTree = "<group>"; };
7D9748CF2E9748930098631A /* BigString+Chunk+Character.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "BigString+Chunk+Character.swift"; sourceTree = "<group>"; };
7D9748D02E9748930098631A /* BigString+Chunk+Index.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "BigString+Chunk+Index.swift"; sourceTree = "<group>"; };
7D9748D12E9748930098631A /* BigString+Chunk+UnicodeScalar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "BigString+Chunk+UnicodeScalar.swift"; sourceTree = "<group>"; };
@@ -816,7 +830,6 @@
7DA23F592F32C67D00E4C03A /* RigidArray+Hashable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "RigidArray+Hashable.swift"; sourceTree = "<group>"; };
7DA23F5B2F32C68B00E4C03A /* RigidArray+Descriptions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "RigidArray+Descriptions.swift"; sourceTree = "<group>"; };
7DA295FF2FB79DC5005042B0 /* CollectionsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectionsTests.swift; sourceTree = "<group>"; };
7DACFA112F75FBF100291F2E /* SpanIterator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpanIterator.swift; sourceTree = "<group>"; };
7DAD899A2E8B09C300DD5786 /* FixedWidthInteger+roundUpToPowerOfTwo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "FixedWidthInteger+roundUpToPowerOfTwo.swift"; sourceTree = "<group>"; };
7DAD899B2E8B09C300DD5786 /* Integer rank.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Integer rank.swift"; sourceTree = "<group>"; };
7DAD899C2E8B09C300DD5786 /* UInt+first and last set bit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UInt+first and last set bit.swift"; sourceTree = "<group>"; };
@@ -836,7 +849,6 @@
7DB257A22F58B1CC007B539F /* UniqueDictionary+Debugging.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UniqueDictionary+Debugging.swift"; sourceTree = "<group>"; };
7DC037AC2FE3492D00CF0CB8 /* Iterable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Iterable.swift; sourceTree = "<group>"; };
7DC037AD2FE3492D00CF0CB8 /* Iterable+Algorithms.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Iterable+Algorithms.swift"; sourceTree = "<group>"; };
7DC037AE2FE3492D00CF0CB8 /* Iterable+Standard Conformances.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Iterable+Standard Conformances.swift"; sourceTree = "<group>"; };
7DC037AF2FE3492D00CF0CB8 /* Iterable+Utilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Iterable+Utilities.swift"; sourceTree = "<group>"; };
7DC037B02FE3492D00CF0CB8 /* BorrowingIteratorProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BorrowingIteratorProtocol.swift; sourceTree = "<group>"; };
7DC037B12FE3492D00CF0CB8 /* BorrowingIteratorProtocol+Copy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "BorrowingIteratorProtocol+Copy.swift"; sourceTree = "<group>"; };
@@ -1331,7 +1343,6 @@
children = (
7DC037AC2FE3492D00CF0CB8 /* Iterable.swift */,
7DC037AD2FE3492D00CF0CB8 /* Iterable+Algorithms.swift */,
7DC037AE2FE3492D00CF0CB8 /* Iterable+Standard Conformances.swift */,
7DC037AF2FE3492D00CF0CB8 /* Iterable+Utilities.swift */,
7DC037B02FE3492D00CF0CB8 /* BorrowingIteratorProtocol.swift */,
7DC037B12FE3492D00CF0CB8 /* BorrowingIteratorProtocol+Copy.swift */,
@@ -1363,7 +1374,6 @@
7D12E33C2FF5CC2A003050AB /* OutputSpan+Helpers.swift */,
7D2A77352F27F1E4005780C7 /* InputSpan.swift */,
7D2A77362F27F1E4005780C7 /* Shared.swift */,
7DACFA112F75FBF100291F2E /* SpanIterator.swift */,
);
path = Types;
sourceTree = "<group>";
@@ -1516,9 +1526,17 @@
7D59D0652FE49C87005B5097 /* Conformances */ = {
isa = PBXGroup;
children = (
7D0DC7BE2FFD929500BEE8B2 /* Array+Iterable.swift */,
7D0DC7C42FFD990E00BEE8B2 /* ClosedRange+Iterable.swift */,
7D0DC7C02FFD92B500BEE8B2 /* InlineArray+Iterable.swift */,
7D945E722FF71E86001041A6 /* InputSpan+Iterable.swift */,
7D59D0612FE49C87005B5097 /* InputSpan+Container.swift */,
7D945E6E2FF71DF8001041A6 /* MutableSpan+Iterable.swift */,
7D59D0622FE49C87005B5097 /* MutableSpan+Container.swift */,
7D945E702FF71E53001041A6 /* OutputSpan+Iterable.swift */,
7D59D0632FE49C87005B5097 /* OutputSpan+Container.swift */,
7D0DC7C22FFD987400BEE8B2 /* Range+Iterable.swift */,
7D945E6C2FF71D76001041A6 /* Span+Iterable.swift */,
7D59D0642FE49C87005B5097 /* Span+Container.swift */,
);
path = Conformances;
@@ -2677,7 +2695,6 @@
7DE9203C29CA70F3004483EB /* OrderedSet+Partial SetAlgebra formSymmetricDifference.swift in Sources */,
7DC037B72FE3492D00CF0CB8 /* BorrowingIteratorProtocol+Copy.swift in Sources */,
7DC037B82FE3492D00CF0CB8 /* Iterable+Utilities.swift in Sources */,
7DC037B92FE3492D00CF0CB8 /* Iterable+Standard Conformances.swift in Sources */,
7DC037BA2FE3492D00CF0CB8 /* BorrowingIteratorProtocol.swift in Sources */,
7DC037BB2FE3492D00CF0CB8 /* Iterable+Algorithms.swift in Sources */,
7DC037BC2FE3492D00CF0CB8 /* BorrowingIteratorProtocol+Filter.swift in Sources */,
@@ -2697,6 +2714,7 @@
7D2A777F2F27F2BF005780C7 /* RigidDeque+Container.swift in Sources */,
7D2A77802F27F2BF005780C7 /* Deque.swift in Sources */,
7D2A77812F27F2BF005780C7 /* UniqueDeque+Append.swift in Sources */,
7D945E712FF71E58001041A6 /* OutputSpan+Iterable.swift in Sources */,
7D2A77822F27F2BF005780C7 /* UniqueDeque+Initializers.swift in Sources */,
7D2A77832F27F2BF005780C7 /* Deque+Equatable.swift in Sources */,
7D2A77842F27F2BF005780C7 /* UniqueDeque+Container.swift in Sources */,
@@ -2814,7 +2832,6 @@
7DE9209A29CA70F4004483EB /* Rope+Append.swift in Sources */,
7DE9203F29CA70F3004483EB /* OrderedSet+Partial SetAlgebra isDisjoint.swift in Sources */,
7DC85F8D2F3FDC91004A4E3D /* String+Padding.swift in Sources */,
7DACFA122F75FBF100291F2E /* SpanIterator.swift in Sources */,
7DE9208629CA70F4004483EB /* BigString+LosslessStringConvertible.swift in Sources */,
7DE9204329CA70F3004483EB /* _HashTable+Bucket.swift in Sources */,
7DE9216A29CA70F4004483EB /* TreeDictionary.swift in Sources */,
@@ -2837,6 +2854,7 @@
7D479CE72F47D88600A8CB59 /* _HTable+Consumption.swift in Sources */,
7DE9202B29CA70F3004483EB /* OrderedSet+Equatable.swift in Sources */,
7D479CC52F46D20B00A8CB59 /* UniqueSet+Consumption.swift in Sources */,
7D0DC7BF2FFD929900BEE8B2 /* Array+Iterable.swift in Sources */,
7DE920EA29CA70F4004483EB /* BitArray.swift in Sources */,
7DE920CB29CA70F4004483EB /* BitSet+Random.swift in Sources */,
7DE9201629CA70F3004483EB /* OrderedDictionary+Elements.swift in Sources */,
@@ -2965,6 +2983,7 @@
7DE920A329CA70F4004483EB /* Rope+Index.swift in Sources */,
7DA23F462F329A2300E4C03A /* RigidArray+Experimental.swift in Sources */,
7DA23F472F329A2300E4C03A /* UniqueArray.swift in Sources */,
7D945E732FF71E8C001041A6 /* InputSpan+Iterable.swift in Sources */,
7DFA40842FD3A98D00CD20C1 /* OrderedSet+Move.swift in Sources */,
7DA23F482F329A2300E4C03A /* RigidArray+Replacements.swift in Sources */,
7DA23F492F329A2300E4C03A /* RigidArray+Container.swift in Sources */,
@@ -3048,6 +3067,7 @@
7DE9202729CA70F3004483EB /* OrderedSet+Insertions.swift in Sources */,
7D479CD42F46DD9600A8CB59 /* UniqueSet+Initializers.swift in Sources */,
7DE9208729CA70F4004483EB /* BigString+Sequence.swift in Sources */,
7D0DC7C32FFD987800BEE8B2 /* Range+Iterable.swift in Sources */,
7DE9202229CA70F3004483EB /* OrderedSet+Diffing.swift in Sources */,
7DE920CA29CA70F4004483EB /* BitSet+CustomStringConvertible.swift in Sources */,
7DEB31622F4F98D700F9AF28 /* RigidDictionary+Indices.swift in Sources */,
@@ -3078,6 +3098,7 @@
7DE9201829CA70F3004483EB /* OrderedDictionary+Invariants.swift in Sources */,
7DE920CD29CA70F4004483EB /* BitSet+CustomDebugStringConvertible.swift in Sources */,
7DE9212529CA70F4004483EB /* TreeSet+SetAlgebra isStrictSubset.swift in Sources */,
7D945E6F2FF71DFF001041A6 /* MutableSpan+Iterable.swift in Sources */,
7DE9209229CA70F4004483EB /* Rope+_Storage.swift in Sources */,
7DE9203929CA70F3004483EB /* OrderedSet+Partial RangeReplaceableCollection.swift in Sources */,
7DE9206329CA70F4004483EB /* BigString+Contents.swift in Sources */,
@@ -3135,6 +3156,7 @@
7DE920E029CA70F4004483EB /* Range+Utilities.swift in Sources */,
7DE920D929CA70F4004483EB /* BitSet+SetAlgebra intersection.swift in Sources */,
7DE920DD29CA70F4004483EB /* BitSet+SetAlgebra isStrictSubset.swift in Sources */,
7D0DC7C52FFD990E00BEE8B2 /* ClosedRange+Iterable.swift in Sources */,
7DE920F229CA70F4004483EB /* BitArray._UnsafeHandle.swift in Sources */,
7D479CEB2F47F3C100A8CB59 /* UniqueDictionary+Resizing.swift in Sources */,
7DE9204229CA70F3004483EB /* _HashTable+UnsafeHandle.swift in Sources */,
@@ -3144,11 +3166,13 @@
7D77E6122FCF810E003FA63B /* CountedProducer.swift in Sources */,
7DE920E829CA70F4004483EB /* BitArray+BitwiseOperations.swift in Sources */,
7DE9207829CA70F4004483EB /* BigString+Append.swift in Sources */,
7D0DC7C12FFD92BB00BEE8B2 /* InlineArray+Iterable.swift in Sources */,
7DE9217F29CA70F4004483EB /* _HeapNode.swift in Sources */,
7D479CB92F46A6DB00A8CB59 /* RigidSet+Debugging.swift in Sources */,
7DE9202929CA70F3004483EB /* OrderedSet+Codable.swift in Sources */,
7DE9204829CA70F3004483EB /* _HashTable+CustomStringConvertible.swift in Sources */,
7D479CE52F47D74500A8CB59 /* RigidDictionary+Resizing.swift in Sources */,
7D945E6D2FF71D76001041A6 /* Span+Iterable.swift in Sources */,
7DE9213029CA70F4004483EB /* TreeSet+SetAlgebra isSuperset.swift in Sources */,
7DE9217529CA70F4004483EB /* TreeDictionary+MapValues.swift in Sources */,
7DE9206C29CA70F4004483EB /* BigString+Chunk.swift in Sources */,