diff --git a/Package.swift b/Package.swift index 13d3f242..93e3430c 100644 --- a/Package.swift +++ b/Package.swift @@ -47,6 +47,11 @@ var defines: [String] = [ // Enable modules that aren't source stable yet, and aren't ready for general use. // "COLLECTIONS_ENABLE_UNSTABLE_MODULES", + + // Enable this to allow building the sources as a single, large module. + // Note: this setting isn't a supported package configuration, but it's listed + // here for completeness. +// "COLLECTIONS_SINGLE_MODULE", ] var _modules: [String] = [] diff --git a/Sources/BitCollections/BitArray/BitArray+ChunkedBitsIterators.swift b/Sources/BitCollections/BitArray/BitArray+ChunkedBitsIterators.swift index 2f50b921..8017b676 100644 --- a/Sources/BitCollections/BitArray/BitArray+ChunkedBitsIterators.swift +++ b/Sources/BitCollections/BitArray/BitArray+ChunkedBitsIterators.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif internal struct _ChunkedBitsForwardIterator { internal typealias _BitPosition = _UnsafeBitSet.Index diff --git a/Sources/BitCollections/BitArray/BitArray+Copy.swift b/Sources/BitCollections/BitArray/BitArray+Copy.swift index 1f339c33..50858e3e 100644 --- a/Sources/BitCollections/BitArray/BitArray+Copy.swift +++ b/Sources/BitCollections/BitArray/BitArray+Copy.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension BitArray { internal mutating func _copy( diff --git a/Sources/BitCollections/BitArray/BitArray+Invariants.swift b/Sources/BitCollections/BitArray/BitArray+Invariants.swift index d194ea0b..00de5625 100644 --- a/Sources/BitCollections/BitArray/BitArray+Invariants.swift +++ b/Sources/BitCollections/BitArray/BitArray+Invariants.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension BitArray { /// True if consistency checking is enabled in the implementation of this diff --git a/Sources/BitCollections/BitArray/BitArray._UnsafeHandle.swift b/Sources/BitCollections/BitArray/BitArray._UnsafeHandle.swift index ba69f1e7..9b716b55 100644 --- a/Sources/BitCollections/BitArray/BitArray._UnsafeHandle.swift +++ b/Sources/BitCollections/BitArray/BitArray._UnsafeHandle.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension BitArray { /// An unsafe-unowned bitarray view over `UInt` storage, providing bit array diff --git a/Sources/BitCollections/BitArray/BitArray.swift b/Sources/BitCollections/BitArray/BitArray.swift index e40cc0e2..6b15f924 100644 --- a/Sources/BitCollections/BitArray/BitArray.swift +++ b/Sources/BitCollections/BitArray/BitArray.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif /// An ordered, random-access collection of `Bool` values, implemented as an /// uncompressed bitmap of as many bits as the count of the array. diff --git a/Sources/BitCollections/BitSet/BitSet+Extras.swift b/Sources/BitCollections/BitSet/BitSet+Extras.swift index 5a6ba9d7..67503b40 100644 --- a/Sources/BitCollections/BitSet/BitSet+Extras.swift +++ b/Sources/BitCollections/BitSet/BitSet+Extras.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension BitSet: _UniqueCollection {} diff --git a/Sources/BitCollections/BitSet/BitSet+Initializers.swift b/Sources/BitCollections/BitSet/BitSet+Initializers.swift index 4508d40f..cf8b9987 100644 --- a/Sources/BitCollections/BitSet/BitSet+Initializers.swift +++ b/Sources/BitCollections/BitSet/BitSet+Initializers.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension BitSet { /// Initializes a new, empty bit set. diff --git a/Sources/BitCollections/BitSet/BitSet+Invariants.swift b/Sources/BitCollections/BitSet/BitSet+Invariants.swift index c11ecf2b..1d9811c6 100644 --- a/Sources/BitCollections/BitSet/BitSet+Invariants.swift +++ b/Sources/BitCollections/BitSet/BitSet+Invariants.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension BitSet { /// True if consistency checking is enabled in the implementation of this diff --git a/Sources/BitCollections/BitSet/BitSet+SetAlgebra isEqualSet.swift b/Sources/BitCollections/BitSet/BitSet+SetAlgebra isEqualSet.swift index 3c85b2c2..e0f4e2bc 100644 --- a/Sources/BitCollections/BitSet/BitSet+SetAlgebra isEqualSet.swift +++ b/Sources/BitCollections/BitSet/BitSet+SetAlgebra isEqualSet.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif // FIXME: These are non-standard extensions generalizing ==. extension BitSet { diff --git a/Sources/BitCollections/BitSet/BitSet+SetAlgebra isStrictSubset.swift b/Sources/BitCollections/BitSet/BitSet+SetAlgebra isStrictSubset.swift index 4fb251a9..fdfa7db9 100644 --- a/Sources/BitCollections/BitSet/BitSet+SetAlgebra isStrictSubset.swift +++ b/Sources/BitCollections/BitSet/BitSet+SetAlgebra isStrictSubset.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension BitSet { /// Returns a Boolean value that indicates whether this bit set is a strict diff --git a/Sources/BitCollections/BitSet/BitSet+SetAlgebra isStrictSuperset.swift b/Sources/BitCollections/BitSet/BitSet+SetAlgebra isStrictSuperset.swift index 936dc8d9..c84f8f18 100644 --- a/Sources/BitCollections/BitSet/BitSet+SetAlgebra isStrictSuperset.swift +++ b/Sources/BitCollections/BitSet/BitSet+SetAlgebra isStrictSuperset.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension BitSet { /// Returns a Boolean value that indicates whether this set is a strict diff --git a/Sources/BitCollections/BitSet/BitSet+Sorted Collection APIs.swift b/Sources/BitCollections/BitSet/BitSet+Sorted Collection APIs.swift index 191afcf7..4b3720fd 100644 --- a/Sources/BitCollections/BitSet/BitSet+Sorted Collection APIs.swift +++ b/Sources/BitCollections/BitSet/BitSet+Sorted Collection APIs.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension BitSet: _SortedCollection { /// Returns the current set (already sorted). diff --git a/Sources/BitCollections/BitSet/BitSet.Counted.swift b/Sources/BitCollections/BitSet/BitSet.Counted.swift index 061e0e95..9acfc731 100644 --- a/Sources/BitCollections/BitSet/BitSet.Counted.swift +++ b/Sources/BitCollections/BitSet/BitSet.Counted.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension BitSet { public struct Counted { diff --git a/Sources/BitCollections/BitSet/BitSet.Index.swift b/Sources/BitCollections/BitSet/BitSet.Index.swift index 5c06411c..a0518d30 100644 --- a/Sources/BitCollections/BitSet/BitSet.Index.swift +++ b/Sources/BitCollections/BitSet/BitSet.Index.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension BitSet { /// An opaque type that represents a position in a bit set. diff --git a/Sources/BitCollections/BitSet/BitSet._UnsafeHandle.swift b/Sources/BitCollections/BitSet/BitSet._UnsafeHandle.swift index 545c8fe8..06d48e0e 100644 --- a/Sources/BitCollections/BitSet/BitSet._UnsafeHandle.swift +++ b/Sources/BitCollections/BitSet/BitSet._UnsafeHandle.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension BitSet { @usableFromInline diff --git a/Sources/BitCollections/BitSet/BitSet.swift b/Sources/BitCollections/BitSet/BitSet.swift index 9c16064d..26cf01b0 100644 --- a/Sources/BitCollections/BitSet/BitSet.swift +++ b/Sources/BitCollections/BitSet/BitSet.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif /// A sorted collection of small nonnegative integers, implemented as an /// uncompressed bitmap of as many bits as the value of the largest member. diff --git a/Sources/BitCollections/Shared/UInt+Tricks.swift b/Sources/BitCollections/Shared/UInt+Tricks.swift index 5ef5fc72..09a46b98 100644 --- a/Sources/BitCollections/Shared/UInt+Tricks.swift +++ b/Sources/BitCollections/Shared/UInt+Tricks.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension UInt { /// Returns the position of the `n`th set bit in `self`. diff --git a/Sources/BitCollections/Shared/_Word.swift b/Sources/BitCollections/Shared/_Word.swift index 9b856c07..82d731ef 100644 --- a/Sources/BitCollections/Shared/_Word.swift +++ b/Sources/BitCollections/Shared/_Word.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif @usableFromInline internal typealias _Word = _UnsafeBitSet._Word diff --git a/Sources/DequeModule/Deque+Collection.swift b/Sources/DequeModule/Deque+Collection.swift index bb4c29f7..8212a293 100644 --- a/Sources/DequeModule/Deque+Collection.swift +++ b/Sources/DequeModule/Deque+Collection.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension Deque: Sequence { // Implementation note: we could also use the default `IndexingIterator` here. diff --git a/Sources/DequeModule/Deque+Descriptions.swift b/Sources/DequeModule/Deque+Descriptions.swift index 532d5912..9e27a2f6 100644 --- a/Sources/DequeModule/Deque+Descriptions.swift +++ b/Sources/DequeModule/Deque+Descriptions.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension Deque: CustomStringConvertible { /// A textual representation of this instance. diff --git a/Sources/DequeModule/Deque+Extras.swift b/Sources/DequeModule/Deque+Extras.swift index 93d64cc4..8467f8a3 100644 --- a/Sources/DequeModule/Deque+Extras.swift +++ b/Sources/DequeModule/Deque+Extras.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension Deque { /// Creates a deque with the specified capacity, then calls the given diff --git a/Sources/DequeModule/Deque+Testing.swift b/Sources/DequeModule/Deque+Testing.swift index bbc1fbf9..7575472c 100644 --- a/Sources/DequeModule/Deque+Testing.swift +++ b/Sources/DequeModule/Deque+Testing.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif // This file contains exported but non-public entry points to support clear box // testing. diff --git a/Sources/DequeModule/_UnsafeWrappedBuffer.swift b/Sources/DequeModule/_UnsafeWrappedBuffer.swift index cf86b293..a798642b 100644 --- a/Sources/DequeModule/_UnsafeWrappedBuffer.swift +++ b/Sources/DequeModule/_UnsafeWrappedBuffer.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif @frozen @usableFromInline diff --git a/Sources/HashTreeCollections/HashNode/_Bitmap.swift b/Sources/HashTreeCollections/HashNode/_Bitmap.swift index 3f366e5c..9b789178 100644 --- a/Sources/HashTreeCollections/HashNode/_Bitmap.swift +++ b/Sources/HashTreeCollections/HashNode/_Bitmap.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif /// A set of `_Bucket` values, represented by a 32-bit wide bitset. @usableFromInline diff --git a/Sources/HashTreeCollections/HashNode/_HashNode+Debugging.swift b/Sources/HashTreeCollections/HashNode/_HashNode+Debugging.swift index 75d7c1bf..3bbf6efc 100644 --- a/Sources/HashTreeCollections/HashNode/_HashNode+Debugging.swift +++ b/Sources/HashTreeCollections/HashNode/_HashNode+Debugging.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension _HashNode { @usableFromInline diff --git a/Sources/HashTreeCollections/HashNode/_HashNode+Initializers.swift b/Sources/HashTreeCollections/HashNode/_HashNode+Initializers.swift index f01a3bd2..6dc9663e 100644 --- a/Sources/HashTreeCollections/HashNode/_HashNode+Initializers.swift +++ b/Sources/HashTreeCollections/HashNode/_HashNode+Initializers.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension _HashNode { @inlinable @inline(__always) diff --git a/Sources/HashTreeCollections/HashNode/_HashNode+Storage.swift b/Sources/HashTreeCollections/HashNode/_HashNode+Storage.swift index 00299cd0..82d9646a 100644 --- a/Sources/HashTreeCollections/HashNode/_HashNode+Storage.swift +++ b/Sources/HashTreeCollections/HashNode/_HashNode+Storage.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif /// A base representation of a hash tree node, capturing functionality /// independent of the `Key` and `Value` types. diff --git a/Sources/HashTreeCollections/HashNode/_HashNode+Structural mapValues.swift b/Sources/HashTreeCollections/HashNode/_HashNode+Structural mapValues.swift index d4a6b727..9c82114c 100644 --- a/Sources/HashTreeCollections/HashNode/_HashNode+Structural mapValues.swift +++ b/Sources/HashTreeCollections/HashNode/_HashNode+Structural mapValues.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension _HashNode { @inlinable diff --git a/Sources/HashTreeCollections/HashNode/_HashNode+Subtree Insertions.swift b/Sources/HashTreeCollections/HashNode/_HashNode+Subtree Insertions.swift index a3457f19..915ed6d9 100644 --- a/Sources/HashTreeCollections/HashNode/_HashNode+Subtree Insertions.swift +++ b/Sources/HashTreeCollections/HashNode/_HashNode+Subtree Insertions.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension _HashNode { @inlinable diff --git a/Sources/HashTreeCollections/HashNode/_UnmanagedHashNode.swift b/Sources/HashTreeCollections/HashNode/_UnmanagedHashNode.swift index e007ad18..31d22346 100644 --- a/Sources/HashTreeCollections/HashNode/_UnmanagedHashNode.swift +++ b/Sources/HashTreeCollections/HashNode/_UnmanagedHashNode.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif /// An unsafe, unowned, type-erased reference to a hash tree node; essentially /// just a lightweight wrapper around `Unmanaged<_RawHashStorage>`. diff --git a/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Debugging.swift b/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Debugging.swift index 51ec6531..eeb26b00 100644 --- a/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Debugging.swift +++ b/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Debugging.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension TreeDictionary { /// True if consistency checking is enabled in the implementation of this diff --git a/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Descriptions.swift b/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Descriptions.swift index e0c1eca6..d0e8f6aa 100644 --- a/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Descriptions.swift +++ b/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Descriptions.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension TreeDictionary: CustomStringConvertible { // A textual representation of this instance. diff --git a/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Keys.swift b/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Keys.swift index d714afaa..039e1947 100644 --- a/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Keys.swift +++ b/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Keys.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension TreeDictionary { /// A view of a persistent dictionary’s keys, as a standalone collection. diff --git a/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Values.swift b/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Values.swift index 67d80fb5..8d01aa49 100644 --- a/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Values.swift +++ b/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Values.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension TreeDictionary { /// A view of a dictionary’s values. diff --git a/Sources/HashTreeCollections/TreeSet/TreeSet+Debugging.swift b/Sources/HashTreeCollections/TreeSet/TreeSet+Debugging.swift index 27467db0..22567864 100644 --- a/Sources/HashTreeCollections/TreeSet/TreeSet+Debugging.swift +++ b/Sources/HashTreeCollections/TreeSet/TreeSet+Debugging.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension TreeSet { /// True if consistency checking is enabled in the implementation of this diff --git a/Sources/HashTreeCollections/TreeSet/TreeSet+Descriptions.swift b/Sources/HashTreeCollections/TreeSet/TreeSet+Descriptions.swift index f32127f1..13d7b419 100644 --- a/Sources/HashTreeCollections/TreeSet/TreeSet+Descriptions.swift +++ b/Sources/HashTreeCollections/TreeSet/TreeSet+Descriptions.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension TreeSet: CustomStringConvertible { /// A textual representation of this instance. diff --git a/Sources/HashTreeCollections/TreeSet/TreeSet+Equatable.swift b/Sources/HashTreeCollections/TreeSet/TreeSet+Equatable.swift index 9e238299..70130a20 100644 --- a/Sources/HashTreeCollections/TreeSet/TreeSet+Equatable.swift +++ b/Sources/HashTreeCollections/TreeSet/TreeSet+Equatable.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension TreeSet: Equatable { /// Returns a Boolean value indicating whether two values are equal. diff --git a/Sources/HashTreeCollections/TreeSet/TreeSet+Extras.swift b/Sources/HashTreeCollections/TreeSet/TreeSet+Extras.swift index 788187ef..70ac8c69 100644 --- a/Sources/HashTreeCollections/TreeSet/TreeSet+Extras.swift +++ b/Sources/HashTreeCollections/TreeSet/TreeSet+Extras.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension TreeSet: _UniqueCollection {} diff --git a/Sources/HashTreeCollections/TreeSet/TreeSet+SetAlgebra basics.swift b/Sources/HashTreeCollections/TreeSet/TreeSet+SetAlgebra basics.swift index da97d142..e6e58204 100644 --- a/Sources/HashTreeCollections/TreeSet/TreeSet+SetAlgebra basics.swift +++ b/Sources/HashTreeCollections/TreeSet/TreeSet+SetAlgebra basics.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension TreeSet: SetAlgebra { /// Returns a Boolean value that indicates whether the given element exists diff --git a/Sources/HashTreeCollections/TreeSet/TreeSet+SetAlgebra isEqualSet.swift b/Sources/HashTreeCollections/TreeSet/TreeSet+SetAlgebra isEqualSet.swift index 61066ac8..0cf2ba8c 100644 --- a/Sources/HashTreeCollections/TreeSet/TreeSet+SetAlgebra isEqualSet.swift +++ b/Sources/HashTreeCollections/TreeSet/TreeSet+SetAlgebra isEqualSet.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif // FIXME: These are non-standard extensions generalizing ==. extension TreeSet { diff --git a/Sources/HashTreeCollections/TreeSet/TreeSet+SetAlgebra isStrictSubset.swift b/Sources/HashTreeCollections/TreeSet/TreeSet+SetAlgebra isStrictSubset.swift index eddd4319..7badeb90 100644 --- a/Sources/HashTreeCollections/TreeSet/TreeSet+SetAlgebra isStrictSubset.swift +++ b/Sources/HashTreeCollections/TreeSet/TreeSet+SetAlgebra isStrictSubset.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension TreeSet { /// Returns a Boolean value that indicates whether the set is a strict subset diff --git a/Sources/HashTreeCollections/TreeSet/TreeSet+SetAlgebra isStrictSuperset.swift b/Sources/HashTreeCollections/TreeSet/TreeSet+SetAlgebra isStrictSuperset.swift index 551e2c44..97578bcd 100644 --- a/Sources/HashTreeCollections/TreeSet/TreeSet+SetAlgebra isStrictSuperset.swift +++ b/Sources/HashTreeCollections/TreeSet/TreeSet+SetAlgebra isStrictSuperset.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension TreeSet { /// Returns a Boolean value that indicates whether the set is a strict diff --git a/Sources/HashTreeCollections/TreeSet/TreeSet+SetAlgebra isSubset.swift b/Sources/HashTreeCollections/TreeSet/TreeSet+SetAlgebra isSubset.swift index 345a53e4..2314c355 100644 --- a/Sources/HashTreeCollections/TreeSet/TreeSet+SetAlgebra isSubset.swift +++ b/Sources/HashTreeCollections/TreeSet/TreeSet+SetAlgebra isSubset.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension TreeSet { /// Returns a Boolean value that indicates whether this set is a subset of diff --git a/Sources/HashTreeCollections/TreeSet/TreeSet+SetAlgebra symmetricDifference.swift b/Sources/HashTreeCollections/TreeSet/TreeSet+SetAlgebra symmetricDifference.swift index 9d68d781..e00bbe24 100644 --- a/Sources/HashTreeCollections/TreeSet/TreeSet+SetAlgebra symmetricDifference.swift +++ b/Sources/HashTreeCollections/TreeSet/TreeSet+SetAlgebra symmetricDifference.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension TreeSet { /// Returns a new set with the elements that are either in this set or in diff --git a/Sources/HeapModule/Heap+Invariants.swift b/Sources/HeapModule/Heap+Invariants.swift index a78b4dc9..50f01583 100644 --- a/Sources/HeapModule/Heap+Invariants.swift +++ b/Sources/HeapModule/Heap+Invariants.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension Heap { /// True if consistency checking is enabled in the implementation of this diff --git a/Sources/OrderedCollections/HashTable/_HashTable+UnsafeHandle.swift b/Sources/OrderedCollections/HashTable/_HashTable+UnsafeHandle.swift index 699a5ec8..205a2af5 100644 --- a/Sources/OrderedCollections/HashTable/_HashTable+UnsafeHandle.swift +++ b/Sources/OrderedCollections/HashTable/_HashTable+UnsafeHandle.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif @usableFromInline internal typealias _UnsafeHashTable = _HashTable.UnsafeHandle diff --git a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Descriptions.swift b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Descriptions.swift index fede81ec..9188f615 100644 --- a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Descriptions.swift +++ b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Descriptions.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension OrderedDictionary: CustomStringConvertible { /// A textual representation of this instance. diff --git a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Elements.SubSequence.swift b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Elements.SubSequence.swift index 64313fea..5f3b7b71 100644 --- a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Elements.SubSequence.swift +++ b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Elements.SubSequence.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension OrderedDictionary.Elements { /// A collection that represents a contiguous slice of an ordered dictionary. diff --git a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Elements.swift b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Elements.swift index 39c4fb1d..403d01b2 100644 --- a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Elements.swift +++ b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Elements.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension OrderedDictionary { /// A view of the contents of an ordered dictionary as a random-access diff --git a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Invariants.swift b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Invariants.swift index 58964d22..ae383038 100644 --- a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Invariants.swift +++ b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Invariants.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension OrderedDictionary { /// True if consistency checking is enabled in the implementation of this diff --git a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Values.swift b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Values.swift index 013badd9..1bafecee 100644 --- a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Values.swift +++ b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Values.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension OrderedDictionary { /// A view of an ordered dictionary's values as a standalone collection. diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+Descriptions.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+Descriptions.swift index 3e405668..fa023ffc 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+Descriptions.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+Descriptions.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension OrderedSet: CustomStringConvertible { /// A textual representation of this instance. diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+Initializers.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+Initializers.swift index ab24de09..12d6fc47 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+Initializers.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+Initializers.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension OrderedSet { /// Creates a set with the contents of the given sequence, which diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+Invariants.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+Invariants.swift index 53de455e..467a4377 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+Invariants.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+Invariants.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension OrderedSet { /// True if consistency checking is enabled in the implementation of this diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial MutableCollection.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial MutableCollection.swift index bbc139bb..b917e04c 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial MutableCollection.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial MutableCollection.swift @@ -11,7 +11,9 @@ // The parts of MutableCollection that OrderedSet is able to implement. +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension OrderedSet { /// Exchanges the values at the specified indices of the set. diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra intersection.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra intersection.swift index 7535c14b..c71061a1 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra intersection.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra intersection.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif // `OrderedSet` does not directly conform to `SetAlgebra` because its definition // of equality conflicts with `SetAlgebra` requirements. However, it still diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isDisjoint.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isDisjoint.swift index 8c2f1340..60ed2b96 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isDisjoint.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isDisjoint.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif // `OrderedSet` does not directly conform to `SetAlgebra` because its definition // of equality conflicts with `SetAlgebra` requirements. However, it still diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isEqualSet.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isEqualSet.swift index bb77e59d..2f69d658 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isEqualSet.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isEqualSet.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension OrderedSet { /// Returns a Boolean value indicating whether two set values contain the diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isStrictSubset.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isStrictSubset.swift index 827b07f9..fcdbb951 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isStrictSubset.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isStrictSubset.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif // `OrderedSet` does not directly conform to `SetAlgebra` because its definition // of equality conflicts with `SetAlgebra` requirements. However, it still diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isStrictSuperset.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isStrictSuperset.swift index 02fbb67d..61b70850 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isStrictSuperset.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isStrictSuperset.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif // `OrderedSet` does not directly conform to `SetAlgebra` because its definition // of equality conflicts with `SetAlgebra` requirements. However, it still diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isSubset.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isSubset.swift index 9d35c0fc..0b1c64f8 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isSubset.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra isSubset.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif // `OrderedSet` does not directly conform to `SetAlgebra` because its definition // of equality conflicts with `SetAlgebra` requirements. However, it still diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra subtracting.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra subtracting.swift index ce4daf88..f5e54d52 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra subtracting.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra subtracting.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif // `OrderedSet` does not directly conform to `SetAlgebra` because its definition // of equality conflicts with `SetAlgebra` requirements. However, it still diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra symmetricDifference.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra symmetricDifference.swift index d693c5a0..327d8096 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra symmetricDifference.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+Partial SetAlgebra symmetricDifference.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif // `OrderedSet` does not directly conform to `SetAlgebra` because its definition // of equality conflicts with `SetAlgebra` requirements. However, it still diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+RandomAccessCollection.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+RandomAccessCollection.swift index c8b5dc8b..d8d19444 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+RandomAccessCollection.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+RandomAccessCollection.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension OrderedSet: Sequence { /// The type that allows iteration over an ordered set's elements. diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+SubSequence.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+SubSequence.swift index b21262d2..51079bfb 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+SubSequence.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+SubSequence.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension OrderedSet { /// A collection that represents a contiguous slice of an ordered set. diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+Testing.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+Testing.swift index 84443339..96f81271 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+Testing.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+Testing.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension OrderedSet._UnstableInternals { @_spi(Testing) public var capacity: Int { base._capacity } diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+UnorderedView.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+UnorderedView.swift index 0611718d..783840f3 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+UnorderedView.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+UnorderedView.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif extension OrderedSet { /// An unordered view into an ordered set, providing `SetAlgebra` diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet.swift index 761b7d11..0b733a27 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif /// An ordered collection of unique elements. /// diff --git a/Sources/OrderedCollections/Utilities/_UnsafeBitset.swift b/Sources/OrderedCollections/Utilities/_UnsafeBitset.swift index 5fe05fcd..10a8aee5 100644 --- a/Sources/OrderedCollections/Utilities/_UnsafeBitset.swift +++ b/Sources/OrderedCollections/Utilities/_UnsafeBitset.swift @@ -9,8 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities @usableFromInline internal typealias _UnsafeBitSet = _CollectionsUtilities._UnsafeBitSet - +#endif diff --git a/Sources/RopeModule/Rope/Basics/Rope+Debugging.swift b/Sources/RopeModule/Rope/Basics/Rope+Debugging.swift index 2e69c780..7149f66e 100644 --- a/Sources/RopeModule/Rope/Basics/Rope+Debugging.swift +++ b/Sources/RopeModule/Rope/Basics/Rope+Debugging.swift @@ -9,18 +9,9 @@ // //===----------------------------------------------------------------------===// -private func _addressString(for pointer: UnsafeRawPointer) -> String { - let address = UInt(bitPattern: pointer) - return "0x\(String(address, radix: 16))" -} - -private func _addressString(for object: AnyObject) -> String { - _addressString(for: Unmanaged.passUnretained(object).toOpaque()) -} - -private func _addressString(for object: Unmanaged) -> String { - _addressString(for: object.toOpaque()) -} +#if !COLLECTIONS_SINGLE_MODULE +import _CollectionsUtilities +#endif extension Rope._UnmanagedLeaf: CustomStringConvertible { var description: String { diff --git a/Sources/RopeModule/Rope/Basics/Rope+_Node.swift b/Sources/RopeModule/Rope/Basics/Rope+_Node.swift index 3da01fab..c2748e25 100644 --- a/Sources/RopeModule/Rope/Basics/Rope+_Node.swift +++ b/Sources/RopeModule/Rope/Basics/Rope+_Node.swift @@ -9,7 +9,7 @@ // //===----------------------------------------------------------------------===// -#if swift(<5.8) +#if swift(<5.8) && !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities // for 5.8 polyfills #endif diff --git a/Sources/RopeModule/Utilities/_CharacterRecognizer.swift b/Sources/RopeModule/Utilities/_CharacterRecognizer.swift index 6da6fead..447f686c 100644 --- a/Sources/RopeModule/Utilities/_CharacterRecognizer.swift +++ b/Sources/RopeModule/Utilities/_CharacterRecognizer.swift @@ -17,7 +17,6 @@ internal typealias _CharacterRecognizer = Unicode._CharacterRecognizer @available(macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4, *) extension _CharacterRecognizer { internal func _isKnownEqual(to other: Self) -> Bool { -#if SWIFT_PACKAGE // FIXME: Enable when Swift 5.9 ships. // #if swift(>=5.9) // if #available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *) { // SwiftStdlib 5.9 @@ -25,9 +24,6 @@ extension _CharacterRecognizer { // } // #endif return false -#else // !SWIFT_PACKAGE - return self == other -#endif } } diff --git a/Sources/_CollectionsTestSupport/Utilities/SortedCollectionAPIChecker.swift b/Sources/_CollectionsTestSupport/Utilities/SortedCollectionAPIChecker.swift index 97cd75a4..07c223a5 100644 --- a/Sources/_CollectionsTestSupport/Utilities/SortedCollectionAPIChecker.swift +++ b/Sources/_CollectionsTestSupport/Utilities/SortedCollectionAPIChecker.swift @@ -9,7 +9,9 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsUtilities +#endif /// This protocol simply lists Collection/Sequence extensions that ought to be /// customized for sorted collections. diff --git a/Tests/BitCollectionsTests/BitArrayTests.swift b/Tests/BitCollectionsTests/BitArrayTests.swift index 303ec8b4..4fb29798 100644 --- a/Tests/BitCollectionsTests/BitArrayTests.swift +++ b/Tests/BitCollectionsTests/BitArrayTests.swift @@ -10,8 +10,12 @@ //===----------------------------------------------------------------------===// import XCTest +#if COLLECTIONS_SINGLE_MODULE +@_spi(Testing) import Collections +#else import _CollectionsTestSupport @_spi(Testing) import BitCollections +#endif extension BitArray { static func _fromSequence( diff --git a/Tests/BitCollectionsTests/BitSet.Counted Tests.swift b/Tests/BitCollectionsTests/BitSet.Counted Tests.swift index bb7d86d7..f07d8000 100644 --- a/Tests/BitCollectionsTests/BitSet.Counted Tests.swift +++ b/Tests/BitCollectionsTests/BitSet.Counted Tests.swift @@ -10,9 +10,13 @@ //===----------------------------------------------------------------------===// import XCTest +#if COLLECTIONS_SINGLE_MODULE +import Collections +#else import _CollectionsTestSupport import BitCollections import OrderedCollections +#endif extension BitSet.Counted: SetAPIExtras { public mutating func update(_ member: Int, at index: Index) -> Int { diff --git a/Tests/BitCollectionsTests/BitSetTests.swift b/Tests/BitCollectionsTests/BitSetTests.swift index 5a9becf2..0851a368 100644 --- a/Tests/BitCollectionsTests/BitSetTests.swift +++ b/Tests/BitCollectionsTests/BitSetTests.swift @@ -10,9 +10,13 @@ //===----------------------------------------------------------------------===// import XCTest +#if COLLECTIONS_SINGLE_MODULE +import Collections +#else import _CollectionsTestSupport import BitCollections import OrderedCollections +#endif extension BitSet: SetAPIExtras { public mutating func update(_ member: Int, at index: Index) -> Int { diff --git a/Tests/CollectionsTestSupportTests/CombinatoricsChecks.swift b/Tests/CollectionsTestSupportTests/CombinatoricsChecks.swift index 3309fa0a..dca5da2b 100644 --- a/Tests/CollectionsTestSupportTests/CombinatoricsChecks.swift +++ b/Tests/CollectionsTestSupportTests/CombinatoricsChecks.swift @@ -10,7 +10,9 @@ //===----------------------------------------------------------------------===// import XCTest +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsTestSupport +#endif class CombinatoricsTests: CollectionTestCase { func testEverySubset_smoke() { diff --git a/Tests/CollectionsTestSupportTests/IndexRangeCollectionTests.swift b/Tests/CollectionsTestSupportTests/IndexRangeCollectionTests.swift index 339f6db8..f3bac6e0 100644 --- a/Tests/CollectionsTestSupportTests/IndexRangeCollectionTests.swift +++ b/Tests/CollectionsTestSupportTests/IndexRangeCollectionTests.swift @@ -10,7 +10,9 @@ //===----------------------------------------------------------------------===// import XCTest +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsTestSupport +#endif final class IndexRangeCollectionTests: CollectionTestCase { func testCollection() { diff --git a/Tests/CollectionsTestSupportTests/MinimalTypeConformances.swift b/Tests/CollectionsTestSupportTests/MinimalTypeConformances.swift index 394e3817..d74b1198 100644 --- a/Tests/CollectionsTestSupportTests/MinimalTypeConformances.swift +++ b/Tests/CollectionsTestSupportTests/MinimalTypeConformances.swift @@ -10,7 +10,9 @@ //===----------------------------------------------------------------------===// import XCTest +#if !COLLECTIONS_SINGLE_MODULE import _CollectionsTestSupport +#endif final class MinimalTypeTests: CollectionTestCase { func testMinimalSequence() { diff --git a/Tests/DequeTests/DequeInternals.swift b/Tests/DequeTests/DequeInternals.swift index 1f4e165e..cc533e0d 100644 --- a/Tests/DequeTests/DequeInternals.swift +++ b/Tests/DequeTests/DequeInternals.swift @@ -9,8 +9,12 @@ // //===----------------------------------------------------------------------===// +#if COLLECTIONS_SINGLE_MODULE +@_spi(Testing) import Collections +#else import _CollectionsTestSupport @_spi(Testing) import DequeModule +#endif internal struct DequeLayout: CustomStringConvertible { let capacity: Int diff --git a/Tests/DequeTests/DequeTests.swift b/Tests/DequeTests/DequeTests.swift index 22227a6f..7c191e4d 100644 --- a/Tests/DequeTests/DequeTests.swift +++ b/Tests/DequeTests/DequeTests.swift @@ -10,8 +10,12 @@ //===----------------------------------------------------------------------===// import XCTest +#if COLLECTIONS_SINGLE_MODULE +@_spi(Testing) import Collections +#else import _CollectionsTestSupport @_spi(Testing) import DequeModule +#endif final class DequeTests: CollectionTestCase { func test_testingSPIs() { diff --git a/Tests/DequeTests/MutableCollectionTests.swift b/Tests/DequeTests/MutableCollectionTests.swift index 1d5ea85d..330d7c2a 100644 --- a/Tests/DequeTests/MutableCollectionTests.swift +++ b/Tests/DequeTests/MutableCollectionTests.swift @@ -10,8 +10,12 @@ //===----------------------------------------------------------------------===// import XCTest +#if COLLECTIONS_SINGLE_MODULE +import Collections +#else import _CollectionsTestSupport @_spi(Testing) import DequeModule +#endif final class MutableCollectiontests: CollectionTestCase { // Note: Most of the test below are exhaustively testing the behavior diff --git a/Tests/DequeTests/RangeReplaceableCollectionTests.swift b/Tests/DequeTests/RangeReplaceableCollectionTests.swift index e6271019..6731d75e 100644 --- a/Tests/DequeTests/RangeReplaceableCollectionTests.swift +++ b/Tests/DequeTests/RangeReplaceableCollectionTests.swift @@ -10,8 +10,12 @@ //===----------------------------------------------------------------------===// import XCTest +#if COLLECTIONS_SINGLE_MODULE +@_spi(Testing) import Collections +#else import _CollectionsTestSupport @_spi(Testing) import DequeModule +#endif /// Exhaustive tests for `Deque`'s implementations for `RangeReplaceableCollection` /// requirements. diff --git a/Tests/HashTreeCollectionsTests/TreeDictionary Smoke Tests.swift b/Tests/HashTreeCollectionsTests/TreeDictionary Smoke Tests.swift index ed6e32a4..f9981d81 100644 --- a/Tests/HashTreeCollectionsTests/TreeDictionary Smoke Tests.swift +++ b/Tests/HashTreeCollectionsTests/TreeDictionary Smoke Tests.swift @@ -9,8 +9,12 @@ // //===----------------------------------------------------------------------===// +#if COLLECTIONS_SINGLE_MODULE +import Collections +#else import _CollectionsTestSupport import HashTreeCollections +#endif extension TreeDictionary { fileprivate func contains(_ key: Key) -> Bool { diff --git a/Tests/HashTreeCollectionsTests/TreeDictionary Tests.swift b/Tests/HashTreeCollectionsTests/TreeDictionary Tests.swift index 8674350f..aae5e315 100644 --- a/Tests/HashTreeCollectionsTests/TreeDictionary Tests.swift +++ b/Tests/HashTreeCollectionsTests/TreeDictionary Tests.swift @@ -9,8 +9,12 @@ // //===----------------------------------------------------------------------===// +#if COLLECTIONS_SINGLE_MODULE +import Collections +#else import _CollectionsTestSupport import HashTreeCollections +#endif extension TreeDictionary: DictionaryAPIExtras {} diff --git a/Tests/HashTreeCollectionsTests/TreeDictionary.Keys Tests.swift b/Tests/HashTreeCollectionsTests/TreeDictionary.Keys Tests.swift index c714b187..9dc06a27 100644 --- a/Tests/HashTreeCollectionsTests/TreeDictionary.Keys Tests.swift +++ b/Tests/HashTreeCollectionsTests/TreeDictionary.Keys Tests.swift @@ -10,8 +10,12 @@ //===----------------------------------------------------------------------===// import XCTest +#if COLLECTIONS_SINGLE_MODULE +import Collections +#else import _CollectionsTestSupport import HashTreeCollections +#endif class TreeDictionaryKeysTests: CollectionTestCase { func test_BidirectionalCollection_fixtures() { diff --git a/Tests/HashTreeCollectionsTests/TreeDictionary.Values Tests.swift b/Tests/HashTreeCollectionsTests/TreeDictionary.Values Tests.swift index b64f8ef4..8547ccaa 100644 --- a/Tests/HashTreeCollectionsTests/TreeDictionary.Values Tests.swift +++ b/Tests/HashTreeCollectionsTests/TreeDictionary.Values Tests.swift @@ -10,8 +10,12 @@ //===----------------------------------------------------------------------===// import XCTest +#if COLLECTIONS_SINGLE_MODULE +import Collections +#else import _CollectionsTestSupport import HashTreeCollections +#endif class TreeDictionaryValuesTests: CollectionTestCase { func test_BidirectionalCollection_fixtures() { diff --git a/Tests/HashTreeCollectionsTests/TreeHashedCollections Fixtures.swift b/Tests/HashTreeCollectionsTests/TreeHashedCollections Fixtures.swift index 5b792306..58333c84 100644 --- a/Tests/HashTreeCollectionsTests/TreeHashedCollections Fixtures.swift +++ b/Tests/HashTreeCollectionsTests/TreeHashedCollections Fixtures.swift @@ -9,8 +9,12 @@ // //===----------------------------------------------------------------------===// +#if COLLECTIONS_SINGLE_MODULE +import Collections +#else import _CollectionsTestSupport import HashTreeCollections +#endif /// A set of items whose subsets will produce a bunch of interesting test /// cases. diff --git a/Tests/HashTreeCollectionsTests/TreeSet Tests.swift b/Tests/HashTreeCollectionsTests/TreeSet Tests.swift index 9ea87177..5ce7cc88 100644 --- a/Tests/HashTreeCollectionsTests/TreeSet Tests.swift +++ b/Tests/HashTreeCollectionsTests/TreeSet Tests.swift @@ -9,8 +9,12 @@ // //===----------------------------------------------------------------------===// +#if COLLECTIONS_SINGLE_MODULE +import Collections +#else import _CollectionsTestSupport import HashTreeCollections +#endif extension TreeSet: SetAPIExtras {} diff --git a/Tests/HashTreeCollectionsTests/Utilities.swift b/Tests/HashTreeCollectionsTests/Utilities.swift index bb13dcc7..216b4fcd 100644 --- a/Tests/HashTreeCollectionsTests/Utilities.swift +++ b/Tests/HashTreeCollectionsTests/Utilities.swift @@ -9,8 +9,12 @@ // //===----------------------------------------------------------------------===// +#if COLLECTIONS_SINGLE_MODULE +import Collections +#else import _CollectionsTestSupport import HashTreeCollections +#endif extension LifetimeTracker { func shareableDictionary( diff --git a/Tests/HeapTests/HeapTests.swift b/Tests/HeapTests/HeapTests.swift index 85d1f762..af580364 100644 --- a/Tests/HeapTests/HeapTests.swift +++ b/Tests/HeapTests/HeapTests.swift @@ -10,8 +10,12 @@ //===----------------------------------------------------------------------===// import XCTest +#if COLLECTIONS_SINGLE_MODULE +import Collections +#else import _CollectionsTestSupport import HeapModule +#endif extension Heap { func itemsInAscendingOrder() -> [Element] { diff --git a/Tests/OrderedCollectionsTests/OrderedDictionary/OrderedDictionary Tests.swift b/Tests/OrderedCollectionsTests/OrderedDictionary/OrderedDictionary Tests.swift index d4d34293..57c7516e 100644 --- a/Tests/OrderedCollectionsTests/OrderedDictionary/OrderedDictionary Tests.swift +++ b/Tests/OrderedCollectionsTests/OrderedDictionary/OrderedDictionary Tests.swift @@ -10,9 +10,12 @@ //===----------------------------------------------------------------------===// import XCTest +#if COLLECTIONS_SINGLE_MODULE +@_spi(Testing) import Collections +#else @_spi(Testing) import OrderedCollections - import _CollectionsTestSupport +#endif extension OrderedDictionary: DictionaryAPIExtras {} diff --git a/Tests/OrderedCollectionsTests/OrderedDictionary/OrderedDictionary Utils.swift b/Tests/OrderedCollectionsTests/OrderedDictionary/OrderedDictionary Utils.swift index a79c993b..5e1ae1a8 100644 --- a/Tests/OrderedCollectionsTests/OrderedDictionary/OrderedDictionary Utils.swift +++ b/Tests/OrderedCollectionsTests/OrderedDictionary/OrderedDictionary Utils.swift @@ -9,8 +9,12 @@ // //===----------------------------------------------------------------------===// +#if COLLECTIONS_SINGLE_MODULE +import Collections +#else import _CollectionsTestSupport import OrderedCollections +#endif extension LifetimeTracker { func orderedDictionary( diff --git a/Tests/OrderedCollectionsTests/OrderedDictionary/OrderedDictionary+Elements Tests.swift b/Tests/OrderedCollectionsTests/OrderedDictionary/OrderedDictionary+Elements Tests.swift index 8ac1c4b1..0ea74f77 100644 --- a/Tests/OrderedCollectionsTests/OrderedDictionary/OrderedDictionary+Elements Tests.swift +++ b/Tests/OrderedCollectionsTests/OrderedDictionary/OrderedDictionary+Elements Tests.swift @@ -10,9 +10,12 @@ //===----------------------------------------------------------------------===// import XCTest +#if COLLECTIONS_SINGLE_MODULE +@_spi(Testing) import Collections +#else @_spi(Testing) import OrderedCollections - import _CollectionsTestSupport +#endif class OrderedDictionaryElementsTests: CollectionTestCase { func test_elements_getter() { diff --git a/Tests/OrderedCollectionsTests/OrderedDictionary/OrderedDictionary+Values Tests.swift b/Tests/OrderedCollectionsTests/OrderedDictionary/OrderedDictionary+Values Tests.swift index d45e8059..ea2a739f 100644 --- a/Tests/OrderedCollectionsTests/OrderedDictionary/OrderedDictionary+Values Tests.swift +++ b/Tests/OrderedCollectionsTests/OrderedDictionary/OrderedDictionary+Values Tests.swift @@ -10,9 +10,12 @@ //===----------------------------------------------------------------------===// import XCTest +#if COLLECTIONS_SINGLE_MODULE +import Collections +#else @_spi(Testing) import OrderedCollections - import _CollectionsTestSupport +#endif class OrderedDictionaryValueTests: CollectionTestCase { func test_values_getter() { diff --git a/Tests/OrderedCollectionsTests/OrderedSet/OrderedSet Diffing Tests.swift b/Tests/OrderedCollectionsTests/OrderedSet/OrderedSet Diffing Tests.swift index 1f06a148..9d79968f 100644 --- a/Tests/OrderedCollectionsTests/OrderedSet/OrderedSet Diffing Tests.swift +++ b/Tests/OrderedCollectionsTests/OrderedSet/OrderedSet Diffing Tests.swift @@ -10,8 +10,12 @@ //===----------------------------------------------------------------------===// import XCTest +#if COLLECTIONS_SINGLE_MODULE +import Collections +#else import OrderedCollections import _CollectionsTestSupport +#endif class MeasuringHashable: Hashable { static var equalityChecks = 0 diff --git a/Tests/OrderedCollectionsTests/OrderedSet/OrderedSet.UnorderedView Tests.swift b/Tests/OrderedCollectionsTests/OrderedSet/OrderedSet.UnorderedView Tests.swift index 4d166253..bf8aa88f 100644 --- a/Tests/OrderedCollectionsTests/OrderedSet/OrderedSet.UnorderedView Tests.swift +++ b/Tests/OrderedCollectionsTests/OrderedSet/OrderedSet.UnorderedView Tests.swift @@ -10,8 +10,12 @@ //===----------------------------------------------------------------------===// import XCTest +#if COLLECTIONS_SINGLE_MODULE +import Collections +#else @_spi(Testing) import OrderedCollections import _CollectionsTestSupport +#endif // Note: This cannot really work unless `UnorderedView` becomes a Collection. // extension OrderedSet.UnorderedView: SetAPIChecker {} diff --git a/Tests/OrderedCollectionsTests/OrderedSet/OrderedSetInternals.swift b/Tests/OrderedCollectionsTests/OrderedSet/OrderedSetInternals.swift index 397db56d..b0279c40 100644 --- a/Tests/OrderedCollectionsTests/OrderedSet/OrderedSetInternals.swift +++ b/Tests/OrderedCollectionsTests/OrderedSet/OrderedSetInternals.swift @@ -9,8 +9,12 @@ // //===----------------------------------------------------------------------===// +#if COLLECTIONS_SINGLE_MODULE +@_spi(Testing) import Collections +#else import _CollectionsTestSupport @_spi(Testing) import OrderedCollections +#endif struct OrderedSetLayout: Hashable, CustomStringConvertible { let scale: Int diff --git a/Tests/OrderedCollectionsTests/OrderedSet/OrderedSetTests.swift b/Tests/OrderedCollectionsTests/OrderedSet/OrderedSetTests.swift index 361078c1..c745ea79 100644 --- a/Tests/OrderedCollectionsTests/OrderedSet/OrderedSetTests.swift +++ b/Tests/OrderedCollectionsTests/OrderedSet/OrderedSetTests.swift @@ -10,8 +10,12 @@ //===----------------------------------------------------------------------===// import XCTest +#if COLLECTIONS_SINGLE_MODULE +@_spi(Testing) import Collections +#else @_spi(Testing) import OrderedCollections import _CollectionsTestSupport +#endif extension OrderedSet: SetAPIExtras {} diff --git a/Tests/RopeModuleTests/SampleStrings.swift b/Tests/RopeModuleTests/SampleStrings.swift index 92965b03..1f93619d 100644 --- a/Tests/RopeModuleTests/SampleStrings.swift +++ b/Tests/RopeModuleTests/SampleStrings.swift @@ -9,6 +9,24 @@ // //===----------------------------------------------------------------------===// +#if !COLLECTIONS_SINGLE_MODULE +import _CollectionsTestSupport +#endif + +func randomStride( + from start: Int, + to end: Int, + by maxStep: Int, + seed: Int +) -> UnfoldSequence { + var rng = RepeatableRandomNumberGenerator(seed: seed) + return sequence(state: start, next: { + $0 += Int.random(in: 1 ... maxStep, using: &rng) + guard $0 < end else { return nil } + return $0 + }) +} + let sampleString = #""" The powerful programming language that is also easy to learn. Swift is a powerful and intuitive programming language for iOS, iPadOS, macOS, \# @@ -57,21 +75,6 @@ let shortSample = #""" Swift 👨‍👨‍👧‍👧 简洁 c̴̭̈͘ǫ̷̯͋̊d̸͖̩̈̈́ḛ̴́ 🇺🇸🇨🇦🇺🇸 코드 """# -func randomStride( - from start: Int, - to end: Int, - by maxStep: Int, - seed: Int -) -> UnfoldSequence { - var rng = RepeatableRandomNumberGenerator(seed: seed) - return sequence(state: start, next: { - $0 += Int.random(in: 1 ... maxStep, using: &rng) - guard $0 < end else { return nil } - return $0 - }) -} - - let sampleString2 = #""" The powerful programming language that is also easy to learn. diff --git a/Tests/RopeModuleTests/TestBigString.swift b/Tests/RopeModuleTests/TestBigString.swift index c7bc5b94..1b10622b 100644 --- a/Tests/RopeModuleTests/TestBigString.swift +++ b/Tests/RopeModuleTests/TestBigString.swift @@ -10,9 +10,13 @@ //===----------------------------------------------------------------------===// #if swift(>=5.8) +import XCTest +#if COLLECTIONS_SINGLE_MODULE +import Collections +#else import _CollectionsTestSupport import _RopeModule -import XCTest +#endif @available(macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4, *) class TestBigString: CollectionTestCase { diff --git a/Tests/RopeModuleTests/TestRope.swift b/Tests/RopeModuleTests/TestRope.swift index 0c3f40e3..d0b429b9 100644 --- a/Tests/RopeModuleTests/TestRope.swift +++ b/Tests/RopeModuleTests/TestRope.swift @@ -9,8 +9,13 @@ // //===----------------------------------------------------------------------===// -import _RopeModule import XCTest +#if COLLECTIONS_SINGLE_MODULE +import Collections +#else +import _RopeModule +import _CollectionsTestSupport +#endif struct Chunk: RopeElement, Equatable, CustomStringConvertible { var length: Int