mirror of
https://github.com/apple/swift-collections
synced 2026-11-25 04:37:48 +00:00
Fix some issues on earlier toolchains
This commit is contained in:
5 files changed
+24
-16
No files matched your search
@@ -15,8 +15,7 @@
|
||||
import InternalCollectionsUtilities
|
||||
#endif
|
||||
|
||||
#if compiler(>=6.2) && UnstableContainersPreview
|
||||
|
||||
#if compiler(>=6.4) && UnstableContainersPreview
|
||||
@available(SwiftStdlib 6.4, *)
|
||||
extension InputSpan: RandomAccessContainer, MutableContainer
|
||||
where Element: ~Copyable
|
||||
@@ -36,7 +35,12 @@ where Element: ~Copyable
|
||||
public func currentIndex(of iterator: borrowing BorrowingIterator_) -> Index {
|
||||
self.span.currentIndex(of: iterator)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if compiler(>=6.2) && UnstableContainersPreview
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension InputSpan where Element: ~Copyable {
|
||||
@_alwaysEmitIntoClient
|
||||
@inline(__always)
|
||||
public var startIndex: Index { 0 }
|
||||
|
||||
@@ -11,12 +11,11 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6.4) && UnstableContainersPreview
|
||||
|
||||
#if !COLLECTIONS_SINGLE_MODULE
|
||||
import InternalCollectionsUtilities
|
||||
#endif
|
||||
|
||||
#if compiler(>=6.4) && UnstableContainersPreview
|
||||
@available(SwiftStdlib 6.4, *)
|
||||
extension MutableSpan: RandomAccessContainer where Element: ~Copyable {
|
||||
@_alwaysEmitIntoClient
|
||||
@@ -43,7 +42,12 @@ extension MutableSpan: RandomAccessContainer where Element: ~Copyable {
|
||||
"Invalid iterator")
|
||||
return iterator._start
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if compiler(>=6.2) && UnstableContainersPreview
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension MutableSpan where Element: ~Copyable {
|
||||
@_alwaysEmitIntoClient
|
||||
public var startIndex: Int {
|
||||
0
|
||||
@@ -84,9 +88,16 @@ extension MutableSpan: RandomAccessContainer where Element: ~Copyable {
|
||||
self.span.spanBoundary(before: index, maxDistance: maxDistance, limitedBy: limit)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if compiler(>=6.4) && UnstableContainersPreview
|
||||
@available(SwiftStdlib 6.4, *)
|
||||
extension MutableSpan: MutableContainer where Element: ~Copyable {
|
||||
extension MutableSpan: MutableContainer where Element: ~Copyable {}
|
||||
#endif
|
||||
|
||||
#if compiler(>=6.2) && UnstableContainersPreview
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension MutableSpan where Element: ~Copyable {
|
||||
@_alwaysEmitIntoClient
|
||||
@_lifetime(copy self)
|
||||
public consuming func _nextMutableSpan(
|
||||
@@ -148,5 +159,4 @@ extension MutableSpan: MutableContainer where Element: ~Copyable {
|
||||
return r
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -15,7 +15,7 @@
|
||||
import InternalCollectionsUtilities
|
||||
#endif
|
||||
|
||||
#if compiler(>=6.2) && UnstableContainersPreview
|
||||
#if compiler(>=6.4) && UnstableContainersPreview
|
||||
@available(SwiftStdlib 6.4, *)
|
||||
extension OutputSpan: RandomAccessContainer, MutableContainer
|
||||
where Element: ~Copyable
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6.4) && UnstableContainersPreview
|
||||
|
||||
@available(SwiftStdlib 6.4, *)
|
||||
extension Span: RandomAccessContainer where Element: ~Copyable {
|
||||
@_alwaysEmitIntoClient
|
||||
@@ -39,7 +38,9 @@ extension Span: RandomAccessContainer where Element: ~Copyable {
|
||||
return iterator._start
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if compiler(>=6.2)
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension Span where Element: ~Copyable {
|
||||
@_alwaysEmitIntoClient
|
||||
@@ -112,5 +113,4 @@ extension Span where Element: ~Copyable {
|
||||
return (p, index &- p)
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -28,19 +28,13 @@ public struct UniqueBox<Value: ~Copyable>: ~Copyable {
|
||||
public typealias T = Value
|
||||
|
||||
@usableFromInline
|
||||
internal let _pointer: UnsafeMutablePointer<T>
|
||||
internal let _pointer: UnsafeMutablePointer<Value>
|
||||
|
||||
@_alwaysEmitIntoClient
|
||||
@_transparent
|
||||
public init(_ value: consuming Value) {
|
||||
fatalError()
|
||||
}
|
||||
|
||||
@_alwaysEmitIntoClient
|
||||
@inlinable
|
||||
deinit {
|
||||
fatalError()
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
Reference in new issue
Block a user