Disambiguate ContainersPreview and stdlib

Adds trailing underscores to the BorrowingSequence protocols and
requirements, in order to allow both parallel conformances and
the ability to evolve the requirements in this package.
This commit is contained in:
Nate Cook committed 2026-03-27 07:41:32 -05:00
1 parent 4c04822689
commit a99a015934
49 files changed
+350 -363

No files matched your search

@@ -311,14 +311,14 @@ extension UniqueArray {
@available(SwiftStdlib 6.4, *)
@inlinable
internal mutating func _append<
Source: BorrowingSequence<Element> & ~Copyable & ~Escapable
Source: BorrowingSequence_<Element> & ~Copyable & ~Escapable
>(
copying newElements: borrowing Source
) {
_ensureFreeCapacity(newElements.underestimatedCount)
var it = newElements.makeBorrowingIterator()
_ensureFreeCapacity(newElements.underestimatedCount_)
var it = newElements.makeBorrowingIterator_()
while true {
let span = it.nextSpan()
let span = it.nextSpan_()
if span.isEmpty { break }
_ensureFreeCapacity(span.count)
_storage.append(copying: span)
@@ -345,7 +345,7 @@ extension UniqueArray {
@_alwaysEmitIntoClient
@inline(__always)
public mutating func append<
Source: BorrowingSequence<Element> & ~Copyable & ~Escapable
Source: BorrowingSequence_<Element> & ~Copyable & ~Escapable
>(
copying newElements: borrowing Source
) {
@@ -400,7 +400,7 @@ extension UniqueArray {
@_alwaysEmitIntoClient
@inline(__always)
public mutating func append<
Source: BorrowingSequence<Element> & Sequence<Element>
Source: BorrowingSequence_<Element> & Sequence<Element>
>(copying newElements: Source) {
self._append(copying: newElements)
}
@@ -20,16 +20,16 @@ import ContainersPreview
#if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
@available(SwiftStdlib 6.4, *)
extension UniqueArray: BorrowingSequence where Element: ~Copyable {
public typealias BorrowingIterator = RigidArray<Element>.BorrowingIterator
extension UniqueArray: BorrowingSequence_ where Element: ~Copyable {
public typealias BorrowingIterator_ = RigidArray<Element>.BorrowingIterator_
@inlinable
public var underestimatedCount: Int { count }
public var underestimatedCount_: Int { count }
@_alwaysEmitIntoClient
@inline(__always)
public func makeBorrowingIterator() -> BorrowingIterator {
self._storage.makeBorrowingIterator()
public func makeBorrowingIterator_() -> BorrowingIterator_ {
self._storage.makeBorrowingIterator_()
}
}
#endif
@@ -105,7 +105,7 @@ extension UniqueArray /*where Element: Copyable*/ {
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
@inline(__always)
public init<Source: BorrowingSequence<Element> & ~Copyable & ~Escapable>(
public init<Source: BorrowingSequence_<Element> & ~Copyable & ~Escapable>(
capacity: Int? = nil,
copying contents: borrowing Source
) {
@@ -142,7 +142,7 @@ extension UniqueArray /*where Element: Copyable*/ {
@available(SwiftStdlib 6.4, *)
@_alwaysEmitIntoClient
@inline(__always)
public init<Source: BorrowingSequence<Element> & Sequence<Element>>(
public init<Source: BorrowingSequence_<Element> & Sequence<Element>>(
capacity: Int? = nil,
copying contents: Source
) {