mirror of
https://github.com/apple/swift-collections
synced 2026-11-28 05:04:21 +00:00
Stop catering to toolchains older than Swift 6.2
This commit is contained in:
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
|
||||
Reference in new issue
Block a user