diff --git a/Sources/ContainersPreview/Conformances/InputSpan+Container.swift b/Sources/ContainersPreview/Conformances/InputSpan+Container.swift index 51652cb7..a65d2637 100644 --- a/Sources/ContainersPreview/Conformances/InputSpan+Container.swift +++ b/Sources/ContainersPreview/Conformances/InputSpan+Container.swift @@ -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 } diff --git a/Sources/ContainersPreview/Conformances/MutableSpan+Container.swift b/Sources/ContainersPreview/Conformances/MutableSpan+Container.swift index 1a1292f5..9f61e033 100644 --- a/Sources/ContainersPreview/Conformances/MutableSpan+Container.swift +++ b/Sources/ContainersPreview/Conformances/MutableSpan+Container.swift @@ -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 diff --git a/Sources/ContainersPreview/Conformances/OutputSpan+Container.swift b/Sources/ContainersPreview/Conformances/OutputSpan+Container.swift index 4ce98bdf..a73894e7 100644 --- a/Sources/ContainersPreview/Conformances/OutputSpan+Container.swift +++ b/Sources/ContainersPreview/Conformances/OutputSpan+Container.swift @@ -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 diff --git a/Sources/ContainersPreview/Conformances/Span+Container.swift b/Sources/ContainersPreview/Conformances/Span+Container.swift index 55cdd921..b6f872db 100644 --- a/Sources/ContainersPreview/Conformances/Span+Container.swift +++ b/Sources/ContainersPreview/Conformances/Span+Container.swift @@ -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 diff --git a/Sources/ContainersPreview/Types/UniqueBox.swift b/Sources/ContainersPreview/Types/UniqueBox.swift index 2e646b83..1ef213ad 100644 --- a/Sources/ContainersPreview/Types/UniqueBox.swift +++ b/Sources/ContainersPreview/Types/UniqueBox.swift @@ -28,19 +28,13 @@ public struct UniqueBox: ~Copyable { public typealias T = Value @usableFromInline - internal let _pointer: UnsafeMutablePointer + internal let _pointer: UnsafeMutablePointer @_alwaysEmitIntoClient @_transparent public init(_ value: consuming Value) { fatalError() } - - @_alwaysEmitIntoClient - @inlinable - deinit { - fatalError() - } } #else