diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e2fdbf1..03a62d01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,9 +55,10 @@ set(collections_swift_flags "-enable-experimental-feature BuiltinModule" "-enable-experimental-feature Lifetimes" "-enable-experimental-feature InoutLifetimeDependence" - "-enable-experimental-feature SuppressedAssociatedTypesWithDefaults" "-enable-experimental-feature AddressableParameters" "-enable-experimental-feature AddressableTypes" + "-enable-experimental-feature SuppressedAssociatedTypesWithDefaults" + "-enable-experimental-feature BorrowingSequence" ) foreach(flag ${collections_swift_flags}) add_compile_options("$<$:SHELL:${flag}>") @@ -77,6 +78,7 @@ set(availability_defs "SwiftStdlib 6.1: macOS 15.4, iOS 18.4, watchOS 11.4, tvOS 18.4, visionOS 2.4" "SwiftStdlib 6.2: macOS 26.0, iOS 26.0, watchOS 26.0, tvOS 26.0, visionOS 26.0" "SwiftStdlib 6.3: macOS 26.4, iOS 26.4, watchOS 26.4, tvOS 26.4, visionOS 26.4" + "SwiftStdlib 6.4: macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, visionOS 9999" ) foreach(def ${availability_defs}) add_compile_options("$<$:SHELL:-enable-experimental-feature \"AvailabilityMacro=${def}\">") diff --git a/Package.swift b/Package.swift index 2d4e3a78..89837226 100644 --- a/Package.swift +++ b/Package.swift @@ -110,6 +110,7 @@ let availabilityMacros: KeyValuePairs = [ "SwiftStdlib 6.1": "macOS 15.4, iOS 18.4, watchOS 11.4, tvOS 18.4, visionOS 2.4", "SwiftStdlib 6.2": "macOS 26.0, iOS 26.0, watchOS 26.0, tvOS 26.0, visionOS 26.0", "SwiftStdlib 6.3": "macOS 26.4, iOS 26.4, watchOS 26.4, tvOS 26.4, visionOS 26.4", + "SwiftStdlib 6.4": "macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, visionOS 9999", // Note: if you touch these, please make sure to also update the similar lists in // CMakeLists.txt and Xcode/Shared.xcconfig. ] @@ -120,9 +121,10 @@ let extraSettings: [SwiftSetting] = [ .enableExperimentalFeature("BuiltinModule"), .enableExperimentalFeature("Lifetimes"), .enableExperimentalFeature("InoutLifetimeDependence"), - .enableExperimentalFeature("SuppressedAssociatedTypesWithDefaults"), // Requires Swift 6.4 .enableExperimentalFeature("AddressableParameters"), .enableExperimentalFeature("AddressableTypes"), + .enableExperimentalFeature("SuppressedAssociatedTypesWithDefaults"), // Requires Swift 6.4 + .enableExperimentalFeature("BorrowingSequence"), // Requires Swift 6.4 // Note: if you touch these, please make sure to also update the similar lists in // CMakeLists.txt and Xcode/Shared.xcconfig. diff --git a/Sources/BasicContainers/RigidArray/RigidArray+Append.swift b/Sources/BasicContainers/RigidArray/RigidArray+Append.swift index f8cbd585..b82f20c1 100644 --- a/Sources/BasicContainers/RigidArray/RigidArray+Append.swift +++ b/Sources/BasicContainers/RigidArray/RigidArray+Append.swift @@ -343,6 +343,7 @@ extension RigidArray { } #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW + @available(SwiftStdlib 6.4, *) @inlinable internal mutating func _append< Source: BorrowingSequence & ~Copyable & ~Escapable @@ -364,6 +365,7 @@ extension RigidArray { /// - newElements: A container whose contents to copy into the array. /// /// - Complexity: O(`newElements.count`) + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient @inline(__always) public mutating func append< @@ -406,6 +408,7 @@ extension RigidArray { /// - newElements: The new elements to copy into the array. /// /// - Complexity: O(*m*), where *m* is the length of `newElements`. + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient @inline(__always) public mutating func append< diff --git a/Sources/BasicContainers/RigidArray/RigidArray+Container.swift b/Sources/BasicContainers/RigidArray/RigidArray+Container.swift index b7fe8e75..1c9d2788 100644 --- a/Sources/BasicContainers/RigidArray/RigidArray+Container.swift +++ b/Sources/BasicContainers/RigidArray/RigidArray+Container.swift @@ -19,13 +19,9 @@ import ContainersPreview #if compiler(>=6.2) #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension RigidArray: BorrowingSequence where Element: ~Copyable { public typealias BorrowingIterator = SpanIterator - - @inlinable - public var underestimatedCount: Int { count } - @_alwaysEmitIntoClient @inline(__always) public func makeBorrowingIterator() -> BorrowingIterator { @@ -55,6 +51,9 @@ extension RigidArray: RangeReplaceableContainer where Element: ~Copyable {} @available(SwiftStdlib 5.0, *) extension RigidArray where Element: ~Copyable { + @inlinable + public var underestimatedCount: Int { count } + /// A Boolean value indicating whether this array contains no elements. /// /// - Complexity: O(1) diff --git a/Sources/BasicContainers/RigidArray/RigidArray+Initializers.swift b/Sources/BasicContainers/RigidArray/RigidArray+Initializers.swift index a3ab34f6..ef2b7cc7 100644 --- a/Sources/BasicContainers/RigidArray/RigidArray+Initializers.swift +++ b/Sources/BasicContainers/RigidArray/RigidArray+Initializers.swift @@ -122,6 +122,7 @@ extension RigidArray /*where Element: Copyable*/ { /// just enough capacity to store the contents. /// - contents: The container whose contents to copy into the new array. /// The container must not contain more than `capacity` elements. + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient @inline(__always) public init & ~Copyable & ~Escapable>( @@ -143,6 +144,7 @@ extension RigidArray /*where Element: Copyable*/ { /// just enough capacity to store the contents. /// - contents: The container whose contents to copy into the new array. /// The container must not contain more than `capacity` elements. + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient @inline(__always) public init & Sequence>( diff --git a/Sources/BasicContainers/RigidArray/RigidArray+Insertions.swift b/Sources/BasicContainers/RigidArray/RigidArray+Insertions.swift index 87e375c8..6f49ce0c 100644 --- a/Sources/BasicContainers/RigidArray/RigidArray+Insertions.swift +++ b/Sources/BasicContainers/RigidArray/RigidArray+Insertions.swift @@ -405,6 +405,7 @@ extension RigidArray { } #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient internal mutating func _insertContainer< C: Container & ~Copyable & ~Escapable @@ -471,6 +472,7 @@ extension RigidArray { /// a valid index of the array. /// /// - Complexity: O(`self.count` + `newElements.count`). + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient @inline(__always) public mutating func insert< @@ -531,6 +533,7 @@ extension RigidArray { /// a valid index of the array. /// /// - Complexity: O(`self.count` + `newElements.count`) + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient @inline(__always) public mutating func insert< diff --git a/Sources/BasicContainers/RigidArray/RigidArray+Replacements.swift b/Sources/BasicContainers/RigidArray/RigidArray+Replacements.swift index 5da64cc6..31166729 100644 --- a/Sources/BasicContainers/RigidArray/RigidArray+Replacements.swift +++ b/Sources/BasicContainers/RigidArray/RigidArray+Replacements.swift @@ -580,6 +580,7 @@ extension RigidArray { } #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW + @available(SwiftStdlib 6.4, *) @inlinable internal mutating func _replace< C: Container & ~Copyable & ~Escapable @@ -658,6 +659,7 @@ extension RigidArray { /// - newElements: The new elements to copy into the collection. /// /// - Complexity: O(`self.count` + `newElements.count`) + @available(SwiftStdlib 6.4, *) @inlinable @inline(__always) public mutating func replace< @@ -739,6 +741,7 @@ extension RigidArray { /// /// - 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< diff --git a/Sources/BasicContainers/RigidSet/RigidSet+Equatable.swift b/Sources/BasicContainers/RigidSet/RigidSet+Equatable.swift index 3f704c53..3760e2e3 100644 --- a/Sources/BasicContainers/RigidSet/RigidSet+Equatable.swift +++ b/Sources/BasicContainers/RigidSet/RigidSet+Equatable.swift @@ -29,7 +29,7 @@ extension RigidSet { } #if COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension RigidSet: Equatable { @inlinable public static func ==(left: borrowing Self, right: borrowing Self) -> Bool { diff --git a/Sources/BasicContainers/RigidSet/RigidSet+Hashable.swift b/Sources/BasicContainers/RigidSet/RigidSet+Hashable.swift index 7a32f6a5..d49d9aec 100644 --- a/Sources/BasicContainers/RigidSet/RigidSet+Hashable.swift +++ b/Sources/BasicContainers/RigidSet/RigidSet+Hashable.swift @@ -18,7 +18,7 @@ import ContainersPreview #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_HASHED_CONTAINERS && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension RigidSet: Hashable { @inlinable public func hash(into hasher: inout Hasher) { diff --git a/Sources/BasicContainers/RigidSet/RigidSet+Initializers.swift b/Sources/BasicContainers/RigidSet/RigidSet+Initializers.swift index 71723cbf..14295eec 100644 --- a/Sources/BasicContainers/RigidSet/RigidSet+Initializers.swift +++ b/Sources/BasicContainers/RigidSet/RigidSet+Initializers.swift @@ -80,6 +80,7 @@ extension RigidSet where Element: ~Copyable { @available(SwiftStdlib 5.0, *) extension RigidSet /* where Element: Copyable */ { #if COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient @inline(__always) public init< @@ -114,6 +115,7 @@ extension RigidSet /* where Element: Copyable */ { } #if COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient @inline(__always) public init< @@ -126,6 +128,7 @@ extension RigidSet /* where Element: Copyable */ { self._insert(copying: contents) } + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient @inline(__always) public init< diff --git a/Sources/BasicContainers/RigidSet/RigidSet+Insertions.swift b/Sources/BasicContainers/RigidSet/RigidSet+Insertions.swift index 3c0a2d08..30c8d907 100644 --- a/Sources/BasicContainers/RigidSet/RigidSet+Insertions.swift +++ b/Sources/BasicContainers/RigidSet/RigidSet+Insertions.swift @@ -219,6 +219,7 @@ extension RigidSet /* where Element: Copyable */ { } #if COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient package mutating func _insert< S: BorrowingSequence & ~Copyable & ~Escapable @@ -235,6 +236,7 @@ extension RigidSet /* where Element: Copyable */ { #endif #if COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient @inline(__always) public mutating func insert< @@ -256,6 +258,7 @@ extension RigidSet /* where Element: Copyable */ { } #if COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient @inline(__always) public mutating func insert< diff --git a/Sources/BasicContainers/UniqueArray/UniqueArray+Append.swift b/Sources/BasicContainers/UniqueArray/UniqueArray+Append.swift index 9730f069..a4351f5c 100644 --- a/Sources/BasicContainers/UniqueArray/UniqueArray+Append.swift +++ b/Sources/BasicContainers/UniqueArray/UniqueArray+Append.swift @@ -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 & ~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< diff --git a/Sources/BasicContainers/UniqueArray/UniqueArray+Container.swift b/Sources/BasicContainers/UniqueArray/UniqueArray+Container.swift index 816b19df..a167706b 100644 --- a/Sources/BasicContainers/UniqueArray/UniqueArray+Container.swift +++ b/Sources/BasicContainers/UniqueArray/UniqueArray+Container.swift @@ -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.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 diff --git a/Sources/BasicContainers/UniqueArray/UniqueArray+Initializers.swift b/Sources/BasicContainers/UniqueArray/UniqueArray+Initializers.swift index 632e0ea7..03b723a5 100644 --- a/Sources/BasicContainers/UniqueArray/UniqueArray+Initializers.swift +++ b/Sources/BasicContainers/UniqueArray/UniqueArray+Initializers.swift @@ -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 & ~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 & Sequence>( diff --git a/Sources/BasicContainers/UniqueArray/UniqueArray+Insertions.swift b/Sources/BasicContainers/UniqueArray/UniqueArray+Insertions.swift index c5d7ffbe..671d6c68 100644 --- a/Sources/BasicContainers/UniqueArray/UniqueArray+Insertions.swift +++ b/Sources/BasicContainers/UniqueArray/UniqueArray+Insertions.swift @@ -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< diff --git a/Sources/BasicContainers/UniqueArray/UniqueArray+Replacements.swift b/Sources/BasicContainers/UniqueArray/UniqueArray+Replacements.swift index d3d9f319..a2ccc71f 100644 --- a/Sources/BasicContainers/UniqueArray/UniqueArray+Replacements.swift +++ b/Sources/BasicContainers/UniqueArray/UniqueArray+Replacements.swift @@ -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< diff --git a/Sources/BasicContainers/UniqueSet/UniqueSet+Hashable.swift b/Sources/BasicContainers/UniqueSet/UniqueSet+Hashable.swift index e752fc6d..f970950a 100644 --- a/Sources/BasicContainers/UniqueSet/UniqueSet+Hashable.swift +++ b/Sources/BasicContainers/UniqueSet/UniqueSet+Hashable.swift @@ -18,7 +18,7 @@ import ContainersPreview #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_HASHED_CONTAINERS && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension UniqueSet: Hashable { @inlinable public func hash(into hasher: inout Hasher) { diff --git a/Sources/BasicContainers/UniqueSet/UniqueSet+Initializers.swift b/Sources/BasicContainers/UniqueSet/UniqueSet+Initializers.swift index 69b164b2..fd31b291 100644 --- a/Sources/BasicContainers/UniqueSet/UniqueSet+Initializers.swift +++ b/Sources/BasicContainers/UniqueSet/UniqueSet+Initializers.swift @@ -73,6 +73,7 @@ extension UniqueSet where Element: ~Copyable { extension UniqueSet where Element: Copyable { #if COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient public init< S: BorrowingSequence & ~Copyable & ~Escapable @@ -91,6 +92,7 @@ extension UniqueSet where Element: Copyable { } #if COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient public init< S: BorrowingSequence & Sequence diff --git a/Sources/BasicContainers/UniqueSet/UniqueSet+Insertions.swift b/Sources/BasicContainers/UniqueSet/UniqueSet+Insertions.swift index 9406afc3..6963fe1f 100644 --- a/Sources/BasicContainers/UniqueSet/UniqueSet+Insertions.swift +++ b/Sources/BasicContainers/UniqueSet/UniqueSet+Insertions.swift @@ -128,6 +128,7 @@ extension UniqueSet /* where Element: Copyable */ { } #if COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient package mutating func _insert< S: BorrowingSequence & ~Copyable & ~Escapable @@ -145,6 +146,7 @@ extension UniqueSet /* where Element: Copyable */ { #endif #if COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient @inline(__always) public mutating func insert< @@ -167,6 +169,7 @@ extension UniqueSet /* where Element: Copyable */ { } #if COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient @inline(__always) public mutating func insert< diff --git a/Sources/ContainersPreview/Protocols/BorrowingIteratorProtocol+Copy.swift b/Sources/ContainersPreview/Protocols/BorrowingIteratorProtocol+Copy.swift index 5b06a0e2..d7ef0153 100644 --- a/Sources/ContainersPreview/Protocols/BorrowingIteratorProtocol+Copy.swift +++ b/Sources/ContainersPreview/Protocols/BorrowingIteratorProtocol+Copy.swift @@ -13,7 +13,7 @@ #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension BorrowingIteratorProtocol where Self: ~Copyable & ~Escapable, diff --git a/Sources/ContainersPreview/Protocols/BorrowingIteratorProtocol+ElementsEqual.swift b/Sources/ContainersPreview/Protocols/BorrowingIteratorProtocol+ElementsEqual.swift index c38cfe45..7c9c978f 100644 --- a/Sources/ContainersPreview/Protocols/BorrowingIteratorProtocol+ElementsEqual.swift +++ b/Sources/ContainersPreview/Protocols/BorrowingIteratorProtocol+ElementsEqual.swift @@ -17,7 +17,7 @@ import InternalCollectionsUtilities #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension BorrowingSequence where Self: ~Copyable & ~Escapable, Element: Equatable, @@ -35,7 +35,7 @@ where } } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension BorrowingSequence where Self: ~Copyable & ~Escapable, @@ -76,7 +76,7 @@ where } } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension BorrowingIteratorProtocol where Self: ~Copyable & ~Escapable, @@ -166,7 +166,7 @@ where } } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension BorrowingIteratorProtocol where Self: ~Copyable & ~Escapable, diff --git a/Sources/ContainersPreview/Protocols/BorrowingIteratorProtocol+Filter.swift b/Sources/ContainersPreview/Protocols/BorrowingIteratorProtocol+Filter.swift index 59a54461..ebc32e83 100644 --- a/Sources/ContainersPreview/Protocols/BorrowingIteratorProtocol+Filter.swift +++ b/Sources/ContainersPreview/Protocols/BorrowingIteratorProtocol+Filter.swift @@ -13,7 +13,7 @@ #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension BorrowingIteratorProtocol where Self: ~Copyable & ~Escapable, @@ -28,7 +28,7 @@ where } } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) public struct BorrowingFilter< Base: BorrowingIteratorProtocol & ~Copyable & ~Escapable >: ~Copyable, ~Escapable @@ -54,7 +54,7 @@ where Base.Element: ~Copyable { // FIXME: Sendable -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension BorrowingFilter: BorrowingIteratorProtocol where Base: ~Copyable & ~Escapable, Base.Element: ~Copyable { @_lifetime(&self) diff --git a/Sources/ContainersPreview/Protocols/BorrowingIteratorProtocol+Map.swift b/Sources/ContainersPreview/Protocols/BorrowingIteratorProtocol+Map.swift index 7f45c827..62184c5e 100644 --- a/Sources/ContainersPreview/Protocols/BorrowingIteratorProtocol+Map.swift +++ b/Sources/ContainersPreview/Protocols/BorrowingIteratorProtocol+Map.swift @@ -13,7 +13,7 @@ #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension BorrowingIteratorProtocol where Self: ~Copyable & ~Escapable, @@ -28,7 +28,7 @@ where } } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) public struct BorrowingMapProducer< Base: BorrowingIteratorProtocol & ~Copyable & ~Escapable, Element: ~Copyable, @@ -53,7 +53,7 @@ public struct BorrowingMapProducer< // FIXME: Sendable -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension BorrowingMapProducer: Producer where Base: ~Copyable & ~Escapable, diff --git a/Sources/ContainersPreview/Protocols/BorrowingIteratorProtocol+Reduce.swift b/Sources/ContainersPreview/Protocols/BorrowingIteratorProtocol+Reduce.swift index ccf6532f..30dcb6ca 100644 --- a/Sources/ContainersPreview/Protocols/BorrowingIteratorProtocol+Reduce.swift +++ b/Sources/ContainersPreview/Protocols/BorrowingIteratorProtocol+Reduce.swift @@ -13,7 +13,7 @@ #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension BorrowingIteratorProtocol where Self: ~Copyable & ~Escapable, diff --git a/Sources/ContainersPreview/Protocols/BorrowingIteratorProtocol+SpanwiseZip.swift b/Sources/ContainersPreview/Protocols/BorrowingIteratorProtocol+SpanwiseZip.swift index 247b36b9..ad19619c 100644 --- a/Sources/ContainersPreview/Protocols/BorrowingIteratorProtocol+SpanwiseZip.swift +++ b/Sources/ContainersPreview/Protocols/BorrowingIteratorProtocol+SpanwiseZip.swift @@ -17,7 +17,7 @@ import InternalCollectionsUtilities #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension BorrowingIteratorProtocol where Self: ~Copyable & ~Escapable, diff --git a/Sources/ContainersPreview/Protocols/BorrowingIteratorProtocol.swift b/Sources/ContainersPreview/Protocols/BorrowingIteratorProtocol.swift index 4074a596..5c2f3425 100644 --- a/Sources/ContainersPreview/Protocols/BorrowingIteratorProtocol.swift +++ b/Sources/ContainersPreview/Protocols/BorrowingIteratorProtocol.swift @@ -17,6 +17,8 @@ import InternalCollectionsUtilities #endif +#if false // Use the stdlib's definition + @available(SwiftStdlib 5.0, *) public protocol BorrowingIteratorProtocol: ~Copyable, ~Escapable { associatedtype Element: ~Copyable @@ -142,13 +144,16 @@ extension BorrowingIteratorProtocol where Self: ~Copyable & ~Escapable { // } } -@available(SwiftStdlib 5.0, *) +#endif + +@available(SwiftStdlib 6.4, *) extension BorrowingIteratorProtocol where Self: ~Copyable & ~Escapable, Element: Copyable { @_lifetime(self: copy self) + @inlinable @_transparent - public mutating func copyContents(into target: inout OutputSpan) { + package mutating func _copyContents(into target: inout OutputSpan) { target.withUnsafeMutableBufferPointer { dst, dstCount in var tail = dst._extracting(droppingFirst: dstCount) while !tail.isEmpty { @@ -161,4 +166,5 @@ where Self: ~Copyable & ~Escapable, Element: Copyable } } + #endif diff --git a/Sources/ContainersPreview/Protocols/BorrowingSequence+Algorithms.swift b/Sources/ContainersPreview/Protocols/BorrowingSequence+Algorithms.swift index 11a72ba7..7a528b40 100644 --- a/Sources/ContainersPreview/Protocols/BorrowingSequence+Algorithms.swift +++ b/Sources/ContainersPreview/Protocols/BorrowingSequence+Algorithms.swift @@ -13,7 +13,7 @@ #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension BorrowingSequence where Self: ~Copyable & ~Escapable, @@ -48,7 +48,7 @@ where } } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension BorrowingSequence where Self: ~Copyable & ~Escapable, @@ -84,7 +84,7 @@ where } } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension BorrowingSequence where Self: ~Copyable & ~Escapable, Element: ~Copyable & Equatable { @inlinable diff --git a/Sources/ContainersPreview/Protocols/BorrowingSequence+Standard Conformances.swift b/Sources/ContainersPreview/Protocols/BorrowingSequence+Standard Conformances.swift index de136829..0e042331 100644 --- a/Sources/ContainersPreview/Protocols/BorrowingSequence+Standard Conformances.swift +++ b/Sources/ContainersPreview/Protocols/BorrowingSequence+Standard Conformances.swift @@ -13,7 +13,8 @@ #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW -@available(SwiftStdlib 5.0, *) +#if false // Use the stdlib's conformance +@available(SwiftStdlib 6.4, *) extension Span: BorrowingSequence where Element: ~Copyable { public typealias BorrowingIterator = SpanIterator @@ -26,8 +27,10 @@ extension Span: BorrowingSequence where Element: ~Copyable { SpanIterator(self) } } +#endif -@available(SwiftStdlib 5.0, *) +#if false // Use the stdlib's conformance +@available(SwiftStdlib 6.4, *) extension MutableSpan: BorrowingSequence where Element: ~Copyable { public typealias BorrowingIterator = SpanIterator @@ -44,8 +47,10 @@ extension MutableSpan: BorrowingSequence where Element: ~Copyable { SpanIterator(self.span) } } +#endif -@available(SwiftStdlib 5.0, *) +#if false // Use the stdlib's conformance +@available(SwiftStdlib 6.4, *) extension OutputSpan: BorrowingSequence where Element: ~Copyable { public typealias BorrowingIterator = SpanIterator @@ -58,8 +63,9 @@ extension OutputSpan: BorrowingSequence where Element: ~Copyable { SpanIterator(self.span) } } +#endif -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension InputSpan: BorrowingSequence where Element: ~Copyable { public typealias BorrowingIterator = SpanIterator @@ -73,7 +79,8 @@ extension InputSpan: BorrowingSequence where Element: ~Copyable { } } -@available(SwiftStdlib 6.2, *) +#if false // Use the stdlib's conformance +@available(SwiftStdlib 6.4, *) extension Array: BorrowingSequence { public typealias BorrowingIterator = SpanIterator @@ -86,8 +93,10 @@ extension Array: BorrowingSequence { SpanIterator(self.span) } } +#endif -@available(SwiftStdlib 6.2, *) +#if false // Use the stdlib's conformance +@available(SwiftStdlib 6.4, *) extension InlineArray: BorrowingSequence where Element: ~Copyable { public typealias BorrowingIterator = SpanIterator @@ -104,8 +113,10 @@ extension InlineArray: BorrowingSequence where Element: ~Copyable { SpanIterator(self.span) } } +#endif -@available(SwiftStdlib 6.2, *) +#if false // Use the stdlib's conformance +@available(SwiftStdlib 6.4, *) extension Range: BorrowingSequence where Bound: Strideable, Bound.Stride: SignedInteger { @@ -160,8 +171,9 @@ where Bound: Strideable, Bound.Stride: SignedInteger BorrowingIterator(self) } } +#endif -@available(SwiftStdlib 6.2, *) +@available(SwiftStdlib 6.4, *) extension ClosedRange: BorrowingSequence where Bound: Strideable, Bound.Stride: SignedInteger { diff --git a/Sources/ContainersPreview/Protocols/BorrowingSequence+Utilities.swift b/Sources/ContainersPreview/Protocols/BorrowingSequence+Utilities.swift index 1451d9ec..0b587d27 100644 --- a/Sources/ContainersPreview/Protocols/BorrowingSequence+Utilities.swift +++ b/Sources/ContainersPreview/Protocols/BorrowingSequence+Utilities.swift @@ -17,7 +17,7 @@ import InternalCollectionsUtilities #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension BorrowingSequence where Self: ~Copyable & ~Escapable, Element: Copyable { @inlinable package func _copyContents( diff --git a/Sources/ContainersPreview/Protocols/BorrowingSequence.swift b/Sources/ContainersPreview/Protocols/BorrowingSequence.swift index 31e0e497..45dcadf2 100644 --- a/Sources/ContainersPreview/Protocols/BorrowingSequence.swift +++ b/Sources/ContainersPreview/Protocols/BorrowingSequence.swift @@ -13,6 +13,8 @@ #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW +#if false // Use the stdlib's definition + @available(SwiftStdlib 5.0, *) public protocol BorrowingSequence: ~Copyable, ~Escapable { associatedtype Element: ~Copyable @@ -75,3 +77,5 @@ where } #endif + +#endif diff --git a/Sources/ContainersPreview/Protocols/Container/BidirectionalContainer.swift b/Sources/ContainersPreview/Protocols/Container/BidirectionalContainer.swift index cbd61361..d80dc2d7 100644 --- a/Sources/ContainersPreview/Protocols/Container/BidirectionalContainer.swift +++ b/Sources/ContainersPreview/Protocols/Container/BidirectionalContainer.swift @@ -13,7 +13,7 @@ #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) public protocol BidirectionalContainer: Container, ~Copyable, ~Escapable where Element: ~Copyable { @@ -25,7 +25,7 @@ where Element: ~Copyable func previousSpan(before index: inout Index, maximumCount: Int) -> Span } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension BidirectionalContainer where Self: ~Copyable & ~Escapable, Element: ~Copyable { @inlinable diff --git a/Sources/ContainersPreview/Protocols/Container/Container+Filter.swift b/Sources/ContainersPreview/Protocols/Container/Container+Filter.swift index e7e42afa..ce353930 100644 --- a/Sources/ContainersPreview/Protocols/Container/Container+Filter.swift +++ b/Sources/ContainersPreview/Protocols/Container/Container+Filter.swift @@ -17,7 +17,7 @@ import InternalCollectionsUtilities #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension Container where Self: ~Copyable /*& ~Escapable*/, Element: ~Copyable { @_lifetime(borrow self) public func _filter( @@ -27,7 +27,7 @@ extension Container where Self: ~Copyable /*& ~Escapable*/, Element: ~Copyable { } } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension ContainerIterator where Base.Element: ~Copyable { @_lifetime(copy self) public func filter( @@ -37,7 +37,7 @@ extension ContainerIterator where Base.Element: ~Copyable { } } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) public struct ContainerFilter< Base: Container & ~Copyable/* FIXME & ~Escapable */ >: ~Copyable, ~Escapable @@ -85,7 +85,7 @@ where Base.Element: ~Copyable // FIXME: Sendable -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension ContainerFilter: BorrowingIteratorProtocol where Element: ~Copyable { @_lifetime(copy self) public mutating func nextSpan(maximumCount: Int) -> Span { diff --git a/Sources/ContainersPreview/Protocols/Container/Container+SpanwiseZip.swift b/Sources/ContainersPreview/Protocols/Container/Container+SpanwiseZip.swift index 73bb35d1..8fcf557a 100644 --- a/Sources/ContainersPreview/Protocols/Container/Container+SpanwiseZip.swift +++ b/Sources/ContainersPreview/Protocols/Container/Container+SpanwiseZip.swift @@ -17,7 +17,7 @@ import InternalCollectionsUtilities #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW -@available(SwiftStdlib 6.2, *) +@available(SwiftStdlib 6.4, *) extension Container where Self: ~Copyable & ~Escapable, Element: ~Copyable { @_alwaysEmitIntoClient internal func _spanwiseZip( diff --git a/Sources/ContainersPreview/Protocols/Container/Container.swift b/Sources/ContainersPreview/Protocols/Container/Container.swift index 46b4fbd5..d21e387b 100644 --- a/Sources/ContainersPreview/Protocols/Container/Container.swift +++ b/Sources/ContainersPreview/Protocols/Container/Container.swift @@ -13,7 +13,7 @@ #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) public protocol Container: BorrowingSequence, ~Copyable, ~Escapable where Element: ~Copyable { @@ -169,7 +169,7 @@ where Element: ~Copyable func index(alignedUp index: Index) -> Index } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension Container where Self: ~Copyable & ~Escapable, Element: ~Copyable { /// Return a span over the container's storage that begins with the element at /// the given index, and extends to the end of the contiguous storage chunk @@ -225,7 +225,7 @@ extension Container where Self: ~Copyable & ~Escapable, Element: ~Copyable { // } } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension Container where Self: ~Copyable & ~Escapable, Element: ~Copyable { @inlinable public func formIndex(after index: inout Index) { @@ -257,7 +257,7 @@ extension Container where Self: ~Copyable & ~Escapable, Element: ~Copyable { } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension Container where Self: ~Copyable & ~Escapable, Element: ~Copyable { @inlinable public func _defaultDistance(from start: Index, to end: Index) -> Int { @@ -387,7 +387,7 @@ extension Container where Self: ~Copyable & ~Escapable, Element: ~Copyable { } } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension Container where Self: ~Copyable & ~Escapable, Element: ~Copyable { @_transparent public var underestimatedCount: Int { count } diff --git a/Sources/ContainersPreview/Protocols/Container/ContainerIterator.swift b/Sources/ContainersPreview/Protocols/Container/ContainerIterator.swift index cfea4e07..381647e1 100644 --- a/Sources/ContainersPreview/Protocols/Container/ContainerIterator.swift +++ b/Sources/ContainersPreview/Protocols/Container/ContainerIterator.swift @@ -13,7 +13,7 @@ #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension Container where Self: ~Copyable /*FIXME: & ~Escapable*/, @@ -26,7 +26,7 @@ where } } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) public struct ContainerIterator< Base: Container & ~Copyable /*FIXME: & ~Escapable*/ >: ~Copyable, ~Escapable @@ -42,7 +42,7 @@ where Base.Element: ~Copyable } } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension ContainerIterator: BorrowingIteratorProtocol where Base: ~Copyable /*FIXME: & ~Escapable*/, diff --git a/Sources/ContainersPreview/Protocols/Container/DynamicContainer.swift b/Sources/ContainersPreview/Protocols/Container/DynamicContainer.swift index 2c091bca..16972776 100644 --- a/Sources/ContainersPreview/Protocols/Container/DynamicContainer.swift +++ b/Sources/ContainersPreview/Protocols/Container/DynamicContainer.swift @@ -13,7 +13,7 @@ #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) public protocol DynamicContainer: RangeReplaceableContainer, ~Copyable where Element: ~Copyable { @@ -25,7 +25,7 @@ where Element: ~Copyable var freeCapacity: Int { get } } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension DynamicContainer where Self: ~Copyable, Element: ~Copyable { @inlinable public init() { @@ -77,7 +77,7 @@ extension DynamicContainer where Self: ~Copyable, Element: ~Copyable { } } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension DynamicContainer where Self: ~Copyable, Element: Copyable { @inlinable public init(repeating repeatedValue: Element, count: Int) { diff --git a/Sources/ContainersPreview/Protocols/Container/MutableContainer.swift b/Sources/ContainersPreview/Protocols/Container/MutableContainer.swift index 92456fb2..e837683c 100644 --- a/Sources/ContainersPreview/Protocols/Container/MutableContainer.swift +++ b/Sources/ContainersPreview/Protocols/Container/MutableContainer.swift @@ -13,7 +13,7 @@ #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) public protocol MutableContainer: PermutableContainer, ~Copyable, ~Escapable where @@ -30,7 +30,7 @@ where // FIXME: What about previousMutableSpan? } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension MutableContainer where Self: ~Copyable & ~Escapable, Element: ~Copyable { diff --git a/Sources/ContainersPreview/Protocols/Container/PermutableContainer.swift b/Sources/ContainersPreview/Protocols/Container/PermutableContainer.swift index 2aaf5b90..ceaf3c0d 100644 --- a/Sources/ContainersPreview/Protocols/Container/PermutableContainer.swift +++ b/Sources/ContainersPreview/Protocols/Container/PermutableContainer.swift @@ -13,7 +13,7 @@ #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) public protocol PermutableContainer: Container, ~Copyable, ~Escapable where Element: ~Copyable { diff --git a/Sources/ContainersPreview/Protocols/Container/RandomAccessContainer.swift b/Sources/ContainersPreview/Protocols/Container/RandomAccessContainer.swift index 3eb70735..b0a80e6a 100644 --- a/Sources/ContainersPreview/Protocols/Container/RandomAccessContainer.swift +++ b/Sources/ContainersPreview/Protocols/Container/RandomAccessContainer.swift @@ -13,7 +13,7 @@ #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW -@available(SwiftStdlib 6.2, *) +@available(SwiftStdlib 6.4, *) public protocol RandomAccessContainer : BidirectionalContainer, ~Copyable, ~Escapable where Element: ~Copyable {} @@ -34,7 +34,7 @@ extension RandomAccessCollection { } } -@available(SwiftStdlib 6.2, *) +@available(SwiftStdlib 6.4, *) extension RandomAccessContainer where Self: ~Copyable & ~Escapable, Index: Strideable, Index.Stride == Int { @@ -91,7 +91,7 @@ where Self: ~Copyable & ~Escapable, Index: Strideable, Index.Stride == Int // Disambiguate parallel extensions on RandomAccessContainer and RandomAccessCollection -@available(SwiftStdlib 6.2, *) +@available(SwiftStdlib 6.4, *) extension RandomAccessCollection where Self: RandomAccessContainer, diff --git a/Sources/ContainersPreview/Protocols/Container/RangeExpression2.swift b/Sources/ContainersPreview/Protocols/Container/RangeExpression2.swift index 6baf1683..1e7b9715 100644 --- a/Sources/ContainersPreview/Protocols/Container/RangeExpression2.swift +++ b/Sources/ContainersPreview/Protocols/Container/RangeExpression2.swift @@ -15,7 +15,7 @@ // FIXME: Figure out if it would be possible to add the container-based // `relative(to:)` to the existing `RangeExpression`. -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) public protocol RangeExpression2 { associatedtype Bound: Comparable @@ -26,7 +26,7 @@ public protocol RangeExpression2 { func contains(_ element: Bound) -> Bool } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension Range: RangeExpression2 { @inlinable public func relative( @@ -36,7 +36,7 @@ extension Range: RangeExpression2 { } } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension ClosedRange: RangeExpression2 { @inlinable public func relative( @@ -47,7 +47,7 @@ extension ClosedRange: RangeExpression2 { } } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension PartialRangeFrom: RangeExpression2 { @inlinable public func relative( @@ -57,7 +57,7 @@ extension PartialRangeFrom: RangeExpression2 { } } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension PartialRangeUpTo: RangeExpression2 { @inlinable public func relative( @@ -67,7 +67,7 @@ extension PartialRangeUpTo: RangeExpression2 { } } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension PartialRangeThrough: RangeExpression2 { @inlinable public func relative( diff --git a/Sources/ContainersPreview/Protocols/Container/RangeReplaceableContainer.swift b/Sources/ContainersPreview/Protocols/Container/RangeReplaceableContainer.swift index 838475ce..236ff775 100644 --- a/Sources/ContainersPreview/Protocols/Container/RangeReplaceableContainer.swift +++ b/Sources/ContainersPreview/Protocols/Container/RangeReplaceableContainer.swift @@ -19,7 +19,7 @@ import InternalCollectionsUtilities //MARK: - Protocol Definition -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) public protocol RangeReplaceableContainer : Container, ~Copyable, ~Escapable where Element: ~Copyable @@ -64,7 +64,7 @@ where Element: ~Copyable //MARK: - Default Implementations -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension RangeReplaceableContainer where Self: ~Copyable & ~Escapable, Element: ~Copyable { @@ -137,7 +137,7 @@ where Self: ~Copyable & ~Escapable, Element: ~Copyable //MARK: - Standard Extensions -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension RangeReplaceableContainer where Self: ~Copyable & ~Escapable, Element: ~Copyable { @@ -206,7 +206,7 @@ where Self: ~Copyable & ~Escapable, Element: ~Copyable } } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension RangeReplaceableContainer where Self: ~Copyable & ~Escapable, Element: ~Copyable { @inlinable @@ -258,7 +258,7 @@ where Self: ~Copyable & ~Escapable, Element: ~Copyable { } } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension RangeReplaceableContainer where Self: BidirectionalContainer, @@ -278,7 +278,7 @@ where } } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension RangeReplaceableContainer where Self: ~Copyable & ~Escapable, Element: ~Copyable { @@ -297,7 +297,7 @@ where Self: ~Copyable & ~Escapable, Element: ~Copyable } } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension RangeReplaceableContainer where Self: ~Copyable & ~Escapable, Element: ~Copyable { @@ -334,7 +334,7 @@ where Self: ~Copyable & ~Escapable, Element: ~Copyable } } -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension RangeReplaceableContainer where Self: ~Copyable & ~Escapable, Element: ~Copyable { @inlinable @@ -367,7 +367,7 @@ where Self: ~Copyable & ~Escapable, Element: ~Copyable { //MARK: - Standard Extensions Requiring Copyability -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension RangeReplaceableContainer where Self: ~Copyable & ~Escapable, diff --git a/Sources/ContainersPreview/Protocols/Producer+Collect.swift b/Sources/ContainersPreview/Protocols/Producer+Collect.swift index 5bb1f05d..4ed2da77 100644 --- a/Sources/ContainersPreview/Protocols/Producer+Collect.swift +++ b/Sources/ContainersPreview/Protocols/Producer+Collect.swift @@ -13,7 +13,7 @@ #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) extension Producer where Self: ~Copyable & ~Escapable, Element: ~Copyable { @inlinable public consuming func collect< diff --git a/Sources/ContainersPreview/Protocols/BorrowingSequence+SpanIterator.swift b/Sources/ContainersPreview/Types/SpanIterator.swift similarity index 95% rename from Sources/ContainersPreview/Protocols/BorrowingSequence+SpanIterator.swift rename to Sources/ContainersPreview/Types/SpanIterator.swift index 0e7f2a30..06378069 100644 --- a/Sources/ContainersPreview/Protocols/BorrowingSequence+SpanIterator.swift +++ b/Sources/ContainersPreview/Types/SpanIterator.swift @@ -13,9 +13,11 @@ #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW +#if false // Use the stdlib's definition + /// A borrowing iterator that provides access to the elements of a single /// span through a `BorrowingIteratorProtocol` interface. -@available(SwiftStdlib 5.0, *) +@available(SwiftStdlib 6.4, *) public struct SpanIterator: BorrowingIteratorProtocol, ~Copyable, ~Escapable where Element: ~Copyable { @@ -59,3 +61,4 @@ public struct SpanIterator: BorrowingIteratorProtocol, ~Copyable, ~Esca } #endif +#endif diff --git a/Sources/DequeModule/RigidDeque/RigidDeque+Append.swift b/Sources/DequeModule/RigidDeque/RigidDeque+Append.swift index 8663a845..b1d85280 100644 --- a/Sources/DequeModule/RigidDeque/RigidDeque+Append.swift +++ b/Sources/DequeModule/RigidDeque/RigidDeque+Append.swift @@ -307,6 +307,7 @@ extension RigidDeque /*where Element: Copyable*/ { } #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient internal mutating func _append< S: BorrowingSequence & ~Copyable & ~Escapable @@ -329,6 +330,7 @@ extension RigidDeque /*where Element: Copyable*/ { /// - newElements: The new elements to copy into the deque. /// /// - Complexity: O(*m*), where *m* is the length of `newElements`. + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient public mutating func append & ~Copyable & ~Escapable>( copying newElements: borrowing S @@ -369,6 +371,7 @@ extension RigidDeque /*where Element: Copyable*/ { /// - items: The new elements to copy into the deque. /// /// - Complexity: O(*m*), where *m* is the length of `items`. + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient public mutating func append< S: BorrowingSequence & Sequence diff --git a/Sources/DequeModule/RigidDeque/RigidDeque+Equatable.swift b/Sources/DequeModule/RigidDeque/RigidDeque+Equatable.swift index d47b7dea..23b982d7 100644 --- a/Sources/DequeModule/RigidDeque/RigidDeque+Equatable.swift +++ b/Sources/DequeModule/RigidDeque/RigidDeque+Equatable.swift @@ -36,13 +36,14 @@ extension RigidDeque /*: Equatable */ where Element: Equatable /* & ~Copyable */ guard !left.isTriviallyIdentical(to: right) else { return true } #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW - return left._elementsEqual(right) -#else + if #available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, visionOS 9999, *) { // FIXME: SwiftStdlib 6.4 + return left._elementsEqual(right) + } +#endif for i in 0 ..< left.count { guard left[i] == right[i] else { return false } } return true -#endif } } diff --git a/Sources/DequeModule/RigidDeque/RigidDeque+Initializers.swift b/Sources/DequeModule/RigidDeque/RigidDeque+Initializers.swift index 5917378c..d654663f 100644 --- a/Sources/DequeModule/RigidDeque/RigidDeque+Initializers.swift +++ b/Sources/DequeModule/RigidDeque/RigidDeque+Initializers.swift @@ -127,6 +127,7 @@ extension RigidDeque /*where Element: Copyable*/ { /// - capacity: The storage capacity of the new deque. /// - contents: A sequence whose contents to copy into the new deque. /// The sequence must not contain more than `capacity` elements. + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient @inline(__always) public init< @@ -182,6 +183,7 @@ extension RigidDeque /*where Element: Copyable*/ { /// - capacity: The storage capacity of the new deque. /// - contents: A sequence whose contents to copy into the new deque. /// The sequence must not contain more than `capacity` elements. + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient @inline(__always) public init< @@ -203,6 +205,7 @@ extension RigidDeque /*where Element: Copyable*/ { /// than or equal to the count of the collection. /// - contents: A collection whose contents to copy into the new deque. /// The sequence must not contain more than `capacity` elements. + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient @inline(__always) public init< diff --git a/Sources/DequeModule/RigidDeque/RigidDeque+Insertions.swift b/Sources/DequeModule/RigidDeque/RigidDeque+Insertions.swift index 2c33da12..a08d4125 100644 --- a/Sources/DequeModule/RigidDeque/RigidDeque+Insertions.swift +++ b/Sources/DequeModule/RigidDeque/RigidDeque+Insertions.swift @@ -353,6 +353,7 @@ extension RigidDeque /* where Element: Copyable */ { } #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW + @available(SwiftStdlib 6.4, *) @inlinable internal mutating func _insertContainer< C: Container & ~Copyable & ~Escapable @@ -364,7 +365,7 @@ extension RigidDeque /* where Element: Copyable */ { let expectedCount = self.count + newCount var it = items.makeBorrowingIterator() insert(addingCount: newCount, at: index) { target in - it.copyContents(into: &target) + it._copyContents(into: &target) } precondition( it.nextSpan().isEmpty && self.count == expectedCount, @@ -415,6 +416,7 @@ extension RigidDeque /* where Element: Copyable */ { /// a valid index of the deque. /// /// - Complexity: O(`self.count` + `items.count`). + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient @inline(__always) public mutating func insert< @@ -477,6 +479,7 @@ extension RigidDeque /* where Element: Copyable */ { /// a valid index of the deque. /// /// - Complexity: O(`self.count` + `items.count`) + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient @inline(__always) public mutating func insert< diff --git a/Sources/DequeModule/RigidDeque/RigidDeque+Prepend.swift b/Sources/DequeModule/RigidDeque/RigidDeque+Prepend.swift index ba989140..9a2e6396 100644 --- a/Sources/DequeModule/RigidDeque/RigidDeque+Prepend.swift +++ b/Sources/DequeModule/RigidDeque/RigidDeque+Prepend.swift @@ -286,6 +286,7 @@ extension RigidDeque /*where Element: Copyable*/ { } #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW + @available(SwiftStdlib 6.4, *) @inlinable internal mutating func _prepend< S: BorrowingSequence & ~Copyable & ~Escapable @@ -302,6 +303,7 @@ extension RigidDeque /*where Element: Copyable*/ { _handle.rotate(toStartAtOffset: oldCount) } + @available(SwiftStdlib 6.4, *) @inlinable internal mutating func _prepend< S: BorrowingSequence & ~Copyable & ~Escapable @@ -330,6 +332,7 @@ extension RigidDeque /*where Element: Copyable*/ { /// - items: The new elements to copy into the deque. /// /// - Complexity: O(*m*), where *m* is the length of `items`. + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient public mutating func prepend & ~Copyable & ~Escapable>( copying items: borrowing S @@ -347,6 +350,7 @@ extension RigidDeque /*where Element: Copyable*/ { /// - items: The new elements to copy into the deque. /// /// - Complexity: O(`items.count`) + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient public mutating func prepend & ~Copyable & ~Escapable>( copying items: borrowing C @@ -434,6 +438,7 @@ extension RigidDeque /*where Element: Copyable*/ { /// - items: The new elements to copy into the deque. /// /// - Complexity: O(*m*), where *m* is the length of `items`. + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient public mutating func prepend & Sequence>( copying items: borrowing S @@ -450,6 +455,7 @@ extension RigidDeque /*where Element: Copyable*/ { /// - items: The new elements to copy into the deque. /// /// - Complexity: O(*m*), where *m* is the length of `items`. + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient public mutating func prepend & Collection>( copying items: borrowing S @@ -466,6 +472,7 @@ extension RigidDeque /*where Element: Copyable*/ { /// - items: The new elements to copy into the deque. /// /// - Complexity: O(*m*), where *m* is the length of `items`. + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient public mutating func prepend & Sequence>( copying items: borrowing C @@ -482,6 +489,7 @@ extension RigidDeque /*where Element: Copyable*/ { /// - items: The new elements to copy into the deque. /// /// - Complexity: O(*m*), where *m* is the length of `items`. + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient public mutating func prepend & Collection>( copying items: borrowing C diff --git a/Sources/DequeModule/RigidDeque/RigidDeque+Replacements.swift b/Sources/DequeModule/RigidDeque/RigidDeque+Replacements.swift index 2382b22c..0d4f4060 100644 --- a/Sources/DequeModule/RigidDeque/RigidDeque+Replacements.swift +++ b/Sources/DequeModule/RigidDeque/RigidDeque+Replacements.swift @@ -454,6 +454,7 @@ extension RigidDeque /* where Element: Copyable */ { } #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW + @available(SwiftStdlib 6.4, *) @inlinable internal mutating func _replace< C: Container & ~Copyable & ~Escapable @@ -466,7 +467,7 @@ extension RigidDeque /* where Element: Copyable */ { let expectedCount = self.count - subrange.count + newCount var it = items.makeBorrowingIterator() self.replace(removing: subrange, addingCount: newCount) { target in - it.copyContents(into: &target) + it._copyContents(into: &target) } precondition( it.nextSpan().isEmpty && count == expectedCount, @@ -524,6 +525,7 @@ extension RigidDeque /* where Element: Copyable */ { /// - items: The new elements to copy into the collection. /// /// - Complexity: O(`self.count` + `items.count`) + @available(SwiftStdlib 6.4, *) @inlinable @inline(__always) public mutating func replace< @@ -601,6 +603,7 @@ extension RigidDeque /* where Element: Copyable */ { /// /// - Complexity: O(*n* + *m*), where *n* is count of this deque and /// *m* is the count of `items`. + @available(SwiftStdlib 6.4, *) @inlinable @inline(__always) public mutating func replace< diff --git a/Sources/DequeModule/UniqueDeque/UniqueDeque+Append.swift b/Sources/DequeModule/UniqueDeque/UniqueDeque+Append.swift index ed70a1cc..ee0e2cb4 100644 --- a/Sources/DequeModule/UniqueDeque/UniqueDeque+Append.swift +++ b/Sources/DequeModule/UniqueDeque/UniqueDeque+Append.swift @@ -294,6 +294,7 @@ extension UniqueDeque /*where Element: Copyable*/ { } #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient internal mutating func _append< S: BorrowingSequence & ~Copyable & ~Escapable @@ -318,6 +319,7 @@ extension UniqueDeque /*where Element: Copyable*/ { /// /// - Complexity: O(*m*), where *m* is the length of `items`, when amortized /// over many similar invocations on the same deque + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient public mutating func append & ~Copyable & ~Escapable>( copying items: borrowing S @@ -368,6 +370,7 @@ extension UniqueDeque /*where Element: Copyable*/ { /// /// - Complexity: O(*m*), where *m* is the length of `items`, when /// amortized over many similar invocations over the same deque. + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient public mutating func append< S: BorrowingSequence & Sequence diff --git a/Sources/DequeModule/UniqueDeque/UniqueDeque+Initializers.swift b/Sources/DequeModule/UniqueDeque/UniqueDeque+Initializers.swift index 7f4a1310..f0bd5902 100644 --- a/Sources/DequeModule/UniqueDeque/UniqueDeque+Initializers.swift +++ b/Sources/DequeModule/UniqueDeque/UniqueDeque+Initializers.swift @@ -147,6 +147,7 @@ extension UniqueDeque /*where Element: Copyable*/ { /// - capacity: The storage capacity of the new deque, or nil to let the /// deque grow itself as needed to accomodate all items in `contents`. /// - contents: A sequence whose contents to copy into the new deque. + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient @inline(__always) public init< @@ -186,6 +187,7 @@ extension UniqueDeque /*where Element: Copyable*/ { /// deque grow itself as needed to accomodate all items in `contents`. /// - contents: A sequence whose contents to copy into the new deque. /// The sequence must not contain more than `capacity` elements. + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient @inline(__always) public init< @@ -205,6 +207,7 @@ extension UniqueDeque /*where Element: Copyable*/ { /// - capacity: The storage capacity of the new deque. /// - contents: A sequence whose contents to copy into the new deque. /// The sequence must not contain more than `capacity` elements. + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient @inline(__always) public init< diff --git a/Sources/DequeModule/UniqueDeque/UniqueDeque+Insertions.swift b/Sources/DequeModule/UniqueDeque/UniqueDeque+Insertions.swift index 8558d279..1d79cac8 100644 --- a/Sources/DequeModule/UniqueDeque/UniqueDeque+Insertions.swift +++ b/Sources/DequeModule/UniqueDeque/UniqueDeque+Insertions.swift @@ -371,6 +371,7 @@ extension UniqueDeque /* where Element: Copyable */ { } #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW + @available(SwiftStdlib 6.4, *) @inlinable internal mutating func _insertContainer< C: Container & ~Copyable & ~Escapable @@ -382,7 +383,7 @@ extension UniqueDeque /* where Element: Copyable */ { let expectedCount = self.count + newCount var it = items.makeBorrowingIterator() insert(addingCount: newCount, at: index) { target in - it.copyContents(into: &target) + it._copyContents(into: &target) } precondition( it.nextSpan().isEmpty && count == expectedCount, @@ -436,6 +437,7 @@ extension UniqueDeque /* where Element: Copyable */ { /// /// - Complexity: O(`self.count` + `items.count`) when amortized over many /// similar invocations on the same deque. + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient @inline(__always) public mutating func insert< @@ -502,6 +504,7 @@ extension UniqueDeque /* where Element: Copyable */ { /// /// - Complexity: O(`self.count` + `items.count`) when amortized over many /// similar invocations on the same deque. + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient @inline(__always) public mutating func insert< diff --git a/Sources/DequeModule/UniqueDeque/UniqueDeque+Prepend.swift b/Sources/DequeModule/UniqueDeque/UniqueDeque+Prepend.swift index 0b1c694b..f5ab9eb7 100644 --- a/Sources/DequeModule/UniqueDeque/UniqueDeque+Prepend.swift +++ b/Sources/DequeModule/UniqueDeque/UniqueDeque+Prepend.swift @@ -316,6 +316,7 @@ extension UniqueDeque /*where Element: Copyable*/ { } #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW + @available(SwiftStdlib 6.4, *) @inlinable internal mutating func _prepend< S: BorrowingSequence & ~Copyable & ~Escapable @@ -332,6 +333,7 @@ extension UniqueDeque /*where Element: Copyable*/ { _storage._handle.rotate(toStartAtOffset: oldCount) } + @available(SwiftStdlib 6.4, *) @inlinable internal mutating func _prepend< S: BorrowingSequence & ~Copyable & ~Escapable @@ -361,6 +363,7 @@ extension UniqueDeque /*where Element: Copyable*/ { /// /// - Complexity: O(*m*), where *m* is the length of `items`, as amortized /// over many similar invocations on the same deque. + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient public mutating func prepend< S: BorrowingSequence & ~Copyable & ~Escapable @@ -381,6 +384,7 @@ extension UniqueDeque /*where Element: Copyable*/ { /// /// - Complexity: O(`items.count`) when amortized over many similar /// invocations on the same deque. + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient public mutating func prepend & ~Copyable & ~Escapable>( copying items: borrowing C @@ -471,6 +475,7 @@ extension UniqueDeque /*where Element: Copyable*/ { /// /// - Complexity: O(*m*), where *m* is the length of `items`, as amortized /// over many similar invocations on the same deque. + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient public mutating func prepend< S: BorrowingSequence & Sequence @@ -490,6 +495,7 @@ extension UniqueDeque /*where Element: Copyable*/ { /// /// - Complexity: O(*m*), where *m* is the length of `items` when amortized /// over many similar invocations on the same deque. + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient public mutating func prepend< S: BorrowingSequence & Collection @@ -509,6 +515,7 @@ extension UniqueDeque /*where Element: Copyable*/ { /// /// - Complexity: O(*m*), where *m* is the length of `items` when amortized /// over many similar invocations on the same deque. + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient public mutating func prepend & Sequence>( copying items: borrowing C @@ -526,6 +533,7 @@ extension UniqueDeque /*where Element: Copyable*/ { /// /// - Complexity: O(*m*), where *m* is the length of `items` when amortized /// over many similar invocations on the same deque. + @available(SwiftStdlib 6.4, *) @_alwaysEmitIntoClient public mutating func prepend & Collection>( copying items: C diff --git a/Sources/DequeModule/UniqueDeque/UniqueDeque+Replacements.swift b/Sources/DequeModule/UniqueDeque/UniqueDeque+Replacements.swift index 55ee6d71..9cea87e6 100644 --- a/Sources/DequeModule/UniqueDeque/UniqueDeque+Replacements.swift +++ b/Sources/DequeModule/UniqueDeque/UniqueDeque+Replacements.swift @@ -463,6 +463,7 @@ extension UniqueDeque /* where Element: Copyable */ { } #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW + @available(SwiftStdlib 6.4, *) @inlinable internal mutating func _replace< C: Container & ~Copyable & ~Escapable @@ -475,7 +476,7 @@ extension UniqueDeque /* where Element: Copyable */ { let expectedCount = self.count - subrange.count + newCount var it = items.makeBorrowingIterator() self.replace(removing: subrange, addingCount: newCount) { target in - it.copyContents(into: &target) + it._copyContents(into: &target) } precondition( it.nextSpan().isEmpty && count == expectedCount, @@ -534,6 +535,7 @@ extension UniqueDeque /* where Element: Copyable */ { /// - items: The new elements to copy into the collection. /// /// - Complexity: O(`self.count` + `items.count`) + @available(SwiftStdlib 6.4, *) @inlinable @inline(__always) public mutating func replace< @@ -613,6 +615,7 @@ extension UniqueDeque /* where Element: Copyable */ { /// /// - Complexity: O(*n* + *m*), where *n* is count of this deque and /// *m* is the count of `items`. + @available(SwiftStdlib 6.4, *) @inlinable @inline(__always) public mutating func replace< diff --git a/Xcode/Collections.xcodeproj/project.pbxproj b/Xcode/Collections.xcodeproj/project.pbxproj index dfba8923..317d7986 100644 --- a/Xcode/Collections.xcodeproj/project.pbxproj +++ b/Xcode/Collections.xcodeproj/project.pbxproj @@ -153,7 +153,6 @@ 7D72468E2F3D9DDB00112FD0 /* _HTable+Bitmap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D72467B2F3D9DDB00112FD0 /* _HTable+Bitmap.swift */; }; 7D7246902F3D9DDB00112FD0 /* _HTable+Sizing.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D72467D2F3D9DDB00112FD0 /* _HTable+Sizing.swift */; }; 7D7246922F3D9E6800112FD0 /* RigidSetTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D7246912F3D9E6800112FD0 /* RigidSetTests.swift */; }; - 7D72F5952F75DA62004AB792 /* BorrowingSequence+SpanIterator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D72F5942F75DA62004AB792 /* BorrowingSequence+SpanIterator.swift */; }; 7D72F5962F75DA62004AB792 /* BorrowingSequence+Algorithms.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D72F5932F75DA62004AB792 /* BorrowingSequence+Algorithms.swift */; }; 7D72F5982F75E5E6004AB792 /* BorrowingSequenceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D72F5972F75E5E6004AB792 /* BorrowingSequenceTests.swift */; }; 7D9748D42E9748930098631A /* BigString+Chunk+UTF16.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D9748D32E9748930098631A /* BigString+Chunk+UTF16.swift */; }; @@ -186,6 +185,7 @@ 7DA23F582F32C66300E4C03A /* RigidArray+Equatable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DA23F572F32C65900E4C03A /* RigidArray+Equatable.swift */; }; 7DA23F5A2F32C68300E4C03A /* RigidArray+Hashable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DA23F592F32C67D00E4C03A /* RigidArray+Hashable.swift */; }; 7DA23F5C2F32C69100E4C03A /* RigidArray+Descriptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DA23F5B2F32C68B00E4C03A /* RigidArray+Descriptions.swift */; }; + 7DACFA122F75FBF100291F2E /* SpanIterator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DACFA112F75FBF100291F2E /* SpanIterator.swift */; }; 7DAD899E2E8B09C300DD5786 /* UInt+first and last set bit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DAD899C2E8B09C300DD5786 /* UInt+first and last set bit.swift */; }; 7DAD899F2E8B09C300DD5786 /* UInt+reversed.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DAD899D2E8B09C300DD5786 /* UInt+reversed.swift */; }; 7DAD89A02E8B09C300DD5786 /* FixedWidthInteger+roundUpToPowerOfTwo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DAD899A2E8B09C300DD5786 /* FixedWidthInteger+roundUpToPowerOfTwo.swift */; }; @@ -753,7 +753,6 @@ 7D7246852F3D9DDB00112FD0 /* RigidSet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RigidSet.swift; sourceTree = ""; }; 7D7246912F3D9E6800112FD0 /* RigidSetTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RigidSetTests.swift; sourceTree = ""; }; 7D72F5932F75DA62004AB792 /* BorrowingSequence+Algorithms.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "BorrowingSequence+Algorithms.swift"; sourceTree = ""; }; - 7D72F5942F75DA62004AB792 /* BorrowingSequence+SpanIterator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "BorrowingSequence+SpanIterator.swift"; sourceTree = ""; }; 7D72F5972F75E5E6004AB792 /* BorrowingSequenceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BorrowingSequenceTests.swift; sourceTree = ""; }; 7D9748CF2E9748930098631A /* BigString+Chunk+Character.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "BigString+Chunk+Character.swift"; sourceTree = ""; }; 7D9748D02E9748930098631A /* BigString+Chunk+Index.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "BigString+Chunk+Index.swift"; sourceTree = ""; }; @@ -786,6 +785,7 @@ 7DA23F572F32C65900E4C03A /* RigidArray+Equatable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "RigidArray+Equatable.swift"; sourceTree = ""; }; 7DA23F592F32C67D00E4C03A /* RigidArray+Hashable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "RigidArray+Hashable.swift"; sourceTree = ""; }; 7DA23F5B2F32C68B00E4C03A /* RigidArray+Descriptions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "RigidArray+Descriptions.swift"; sourceTree = ""; }; + 7DACFA112F75FBF100291F2E /* SpanIterator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpanIterator.swift; sourceTree = ""; }; 7DAD899A2E8B09C300DD5786 /* FixedWidthInteger+roundUpToPowerOfTwo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "FixedWidthInteger+roundUpToPowerOfTwo.swift"; sourceTree = ""; }; 7DAD899B2E8B09C300DD5786 /* Integer rank.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Integer rank.swift"; sourceTree = ""; }; 7DAD899C2E8B09C300DD5786 /* UInt+first and last set bit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UInt+first and last set bit.swift"; sourceTree = ""; }; @@ -1262,7 +1262,6 @@ 7D57EDC42F647DB10029D5E3 /* BorrowingIteratorProtocol+SpanwiseZip.swift */, 7D2A772B2F27F1E4005780C7 /* BorrowingSequence.swift */, 7D72F5932F75DA62004AB792 /* BorrowingSequence+Algorithms.swift */, - 7D72F5942F75DA62004AB792 /* BorrowingSequence+SpanIterator.swift */, 7D2A772C2F27F1E4005780C7 /* BorrowingSequence+Standard Conformances.swift */, 7D2A772D2F27F1E4005780C7 /* BorrowingSequence+Utilities.swift */, 7D57EDCE2F647DB10029D5E3 /* Container */, @@ -1286,6 +1285,7 @@ 7D2A77342F27F1E4005780C7 /* Inout.swift */, 7D2A77352F27F1E4005780C7 /* InputSpan.swift */, 7D2A77362F27F1E4005780C7 /* Shared.swift */, + 7DACFA112F75FBF100291F2E /* SpanIterator.swift */, ); path = Types; sourceTree = ""; @@ -2684,6 +2684,7 @@ 7DE9209A29CA70F4004483EB /* Rope+Append.swift in Sources */, 7DE9203F29CA70F3004483EB /* OrderedSet+Partial SetAlgebra isDisjoint.swift in Sources */, 7DC85F8D2F3FDC91004A4E3D /* String+Padding.swift in Sources */, + 7DACFA122F75FBF100291F2E /* SpanIterator.swift in Sources */, 7DE9208629CA70F4004483EB /* BigString+LosslessStringConvertible.swift in Sources */, 7DE9204329CA70F3004483EB /* _HashTable+Bucket.swift in Sources */, 7DE9216A29CA70F4004483EB /* TreeDictionary.swift in Sources */, @@ -2991,7 +2992,6 @@ 7DE9217129CA70F4004483EB /* TreeDictionary+Values.swift in Sources */, 7D2A77262F27F1D1005780C7 /* Span+Extras.swift in Sources */, 7DE920D029CA70F4004483EB /* BitSet+SetAlgebra isSubset.swift in Sources */, - 7D72F5952F75DA62004AB792 /* BorrowingSequence+SpanIterator.swift in Sources */, 7D72F5962F75DA62004AB792 /* BorrowingSequence+Algorithms.swift in Sources */, 7D479CD92F47CBBA00A8CB59 /* RigidDictionary+Initializers.swift in Sources */, 7DE920C829CA70F4004483EB /* BitSet+SetAlgebra isEqualSet.swift in Sources */, diff --git a/Xcode/Shared.xcconfig b/Xcode/Shared.xcconfig index b86ccc4b..1d85f8c0 100644 --- a/Xcode/Shared.xcconfig +++ b/Xcode/Shared.xcconfig @@ -19,9 +19,10 @@ OTHER_SWIFT_FLAGS = $(inherited) \ -enable-experimental-feature BuiltinModule \ -enable-experimental-feature Lifetimes \ -enable-experimental-feature InoutLifetimeDependence \ - -enable-experimental-feature SuppressedAssociatedTypesWithDefaults \ -enable-experimental-feature AddressableParameters \ -enable-experimental-feature AddressableTypes \ + -enable-experimental-feature SuppressedAssociatedTypesWithDefaults \ + -enable-experimental-feature BorrowingSequence \ -enable-experimental-feature "AvailabilityMacro=SwiftStdlib 5.0: macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2" \ -enable-experimental-feature "AvailabilityMacro=SwiftStdlib 5.1: macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0" \ -enable-experimental-feature "AvailabilityMacro=SwiftStdlib 5.6: macOS 12.3, iOS 15.4, watchOS 8.5, tvOS 15.4" \ @@ -32,7 +33,8 @@ OTHER_SWIFT_FLAGS = $(inherited) \ -enable-experimental-feature "AvailabilityMacro=SwiftStdlib 6.0: macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0" \ -enable-experimental-feature "AvailabilityMacro=SwiftStdlib 6.1: macOS 15.4, iOS 18.4, watchOS 11.4, tvOS 18.4, visionOS 2.4" \ -enable-experimental-feature "AvailabilityMacro=SwiftStdlib 6.2: macOS 26.0, iOS 26.0, watchOS 26.0, tvOS 26.0, visionOS 26.0" \ - -enable-experimental-feature "AvailabilityMacro=SwiftStdlib 6.3: macOS 26.4, iOS 26.4, watchOS 26.4, tvOS 26.4, visionOS 26.4" + -enable-experimental-feature "AvailabilityMacro=SwiftStdlib 6.3: macOS 26.4, iOS 26.4, watchOS 26.4, tvOS 26.4, visionOS 26.4" \ + -enable-experimental-feature "AvailabilityMacro=SwiftStdlib 6.4: macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, visionOS 9999" ONLY_ACTIVE_ARCH[config=Debug] = YES