[ContainersPreview] Exhibit A in the case against prototyping things in the stdlib 😞

This commit is contained in:
Karoy Lorentey committed 2026-03-26 17:14:45 -07:00
1 parent 3e380cb358
commit 419e2f7df2
56 files changed
+200 -98

No files matched your search

@@ -304,6 +304,7 @@ extension UniqueArray {
}
#if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
@available(SwiftStdlib 6.4, *)
@inlinable
internal mutating func _append<
Source: BorrowingSequence<Element> & ~Copyable & ~Escapable
@@ -336,6 +337,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<
@@ -390,6 +392,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,7 +19,7 @@ import ContainersPreview
#if compiler(>=6.2)
#if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
extension UniqueArray: BorrowingSequence where Element: ~Copyable {
public typealias BorrowingIterator = RigidArray<Element>.BorrowingIterator
@@ -35,23 +35,23 @@ extension UniqueArray: BorrowingSequence where Element: ~Copyable {
#endif
#if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
@available(SwiftStdlib 5.0, *)
@available(SwiftStdlib 6.4, *)
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.3)
@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
@@ -102,6 +102,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: BorrowingSequence<Element> & ~Copyable & ~Escapable>(
@@ -138,6 +139,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: BorrowingSequence<Element> & Sequence<Element>>(
@@ -388,6 +388,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, *)
@_alwaysEmitIntoClient
@inline(__always)
public mutating func insert<
@@ -455,6 +456,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, *)
@_alwaysEmitIntoClient
@inline(__always)
public mutating func insert<
@@ -549,6 +549,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<
@@ -639,6 +640,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<