Stop catering to toolchains older than Swift 6.2

This commit is contained in:
Karoy Lorentey committed 2026-11-05 17:40:50 -08:00
1 parent a99833003c
commit daeac4ebb8
5 files changed
-117

No files matched your search

@@ -15,37 +15,6 @@
import InternalCollectionsUtilities
#endif
#if compiler(<6.2)
/// A fixed capacity, heap allocated, noncopyable array of potentially
/// noncopyable elements.
@frozen
@available(*, unavailable, message: "RigidArray requires a Swift 6.2 toolchain")
@safe
public struct RigidArray<Element: ~Copyable>: ~Copyable {
@usableFromInline
internal var _ptr: UnsafeMutablePointer<Element>
@usableFromInline
internal var _capacity: Int
@usableFromInline
internal var _count: Int
deinit {
if _capacity != 0 {
_ptr.deinitialize(count: _count)
_ptr.deallocate()
}
}
public init() {
fatalError()
}
}
#else
/// A fixed capacity, heap allocated, noncopyable array of potentially
/// noncopyable elements.
///
@@ -404,5 +373,3 @@ extension RigidArray where Element: ~Copyable {
return unsafe _storage.extracting(gapRange)
}
}
#endif
@@ -15,24 +15,6 @@
import InternalCollectionsUtilities
#endif
#if compiler(<6.2)
/// A dynamically self-resizing, heap allocated, noncopyable array
/// of potentially noncopyable elements.
@frozen
@available(*, unavailable, message: "UniqueArray requires a Swift 6.2 toolchain")
public struct UniqueArray<Element: ~Copyable>: ~Copyable {
@usableFromInline
package var _storage: RigidArray<Element>
@inlinable
public init() {
fatalError()
}
}
#else
/// A dynamically self-resizing, heap allocated, noncopyable array of
/// potentially noncopyable elements.
///
@@ -245,4 +227,3 @@ extension UniqueArray {
UniqueArray(consuming: _storage.clone(capacity: capacity))
}
}
#endif
@@ -11,34 +11,6 @@
//
//===----------------------------------------------------------------------===//
#if compiler(<6.2)
@available(*, unavailable, renamed: "UniqueBox", message: "struct UniqueBox requires a Swift 6.2 toolchain")
public typealias Box = UniqueBox
/// A wrapper type that forms a noncopyable, heap allocated box around an
/// arbitrary value.
///
/// This can be used to form a noncopyable, uniquely referenced box around any
/// Swift value.
@available(*, unavailable, message: "struct Box requires a Swift 6.2 toolchain")
@frozen
public struct UniqueBox<Value: ~Copyable>: ~Copyable {
@available(*, deprecated, renamed: "Value")
public typealias T = Value
@usableFromInline
internal let _pointer: UnsafeMutablePointer<Value>
@_alwaysEmitIntoClient
@_transparent
public init(_ value: consuming Value) {
fatalError()
}
}
#else
@available(*, deprecated, renamed: "UniqueBox")
public typealias Box = UniqueBox
@@ -216,5 +188,3 @@ extension UniqueBox where Value: ~Copyable {
}
#endif
}
#endif
@@ -15,20 +15,6 @@
import InternalCollectionsUtilities
#endif
#if compiler(<6.2)
/// A fixed capacity, heap allocated, noncopyable double-ended queue of
/// potentially noncopyable elements.
@frozen
@available(*, unavailable, message: "RigidDeque requires a Swift 6.2 toolchain")
public struct RigidDeque<Element: ~Copyable>: ~Copyable {
public init() {
fatalError()
}
}
#else
/// A fixed capacity, heap allocated, noncopyable double-ended queue of
/// potentially noncopyable elements. A deque (pronounced "deck")
/// is an ordered random-access container that supports efficient
@@ -379,5 +365,3 @@ extension RigidDeque {
unsafe RigidDeque(_handle: _handle.allocateCopy(capacity: capacity))
}
}
#endif // compiler(<6.2)
@@ -15,22 +15,6 @@
import InternalCollectionsUtilities
#endif
#if compiler(<6.2)
/// A dynamically self-resizing, heap allocated, noncopyable double-ended
/// queue of potentially noncopyable elements. A deque (pronounced "deck")
/// is an ordered random-access container that supports efficient
/// insertions and removals from both ends.
@frozen
@available(*, unavailable, message: "UniqueDeque requires a Swift 6.2 toolchain")
public struct UniqueDeque<Element: ~Copyable>: ~Copyable {
public init() {
fatalError()
}
}
#else
/// A dynamically self-resizing, heap allocated, noncopyable double-ended
/// queue of potentially noncopyable elements. A deque (pronounced "deck")
/// is an ordered random-access container that supports efficient
@@ -336,6 +320,3 @@ extension UniqueDeque {
UniqueDeque(_storage: _storage.clone(capacity: capacity))
}
}
#endif // compiler(<6.2)