From d4946c5dcbea7340289e0f3841322e9733af2361 Mon Sep 17 00:00:00 2001 From: Karoy Lorentey Date: Tue, 20 May 2025 14:50:06 -0700 Subject: [PATCH 1/4] Remove obsolete language checks --- .../SortedDictionary/SortedDictionary+Keys.swift | 4 ---- .../SortedDictionary/SortedDictionary+Sendable.swift | 2 -- .../SortedDictionary/SortedDictionary+Sequence.swift | 2 -- .../SortedDictionary/SortedDictionary+SubSequence.swift | 4 ---- .../SortedDictionary/SortedDictionary+Values.swift | 4 ---- .../SortedDictionary/SortedDictionary.Index.swift | 2 -- Sources/SortedCollections/SortedSet/SortedSet+Sendable.swift | 2 -- Sources/SortedCollections/SortedSet/SortedSet+Sequence.swift | 2 -- .../SortedCollections/SortedSet/SortedSet+SubSequence.swift | 4 ---- Sources/SortedCollections/SortedSet/SortedSet.Index.swift | 2 -- 10 files changed, 28 deletions(-) diff --git a/Sources/SortedCollections/SortedDictionary/SortedDictionary+Keys.swift b/Sources/SortedCollections/SortedDictionary/SortedDictionary+Keys.swift index ed63cc68..a1270da8 100644 --- a/Sources/SortedCollections/SortedDictionary/SortedDictionary+Keys.swift +++ b/Sources/SortedCollections/SortedDictionary/SortedDictionary+Keys.swift @@ -23,10 +23,8 @@ extension SortedDictionary { } } -#if swift(>=5.5) extension SortedDictionary.Keys: Sendable where Key: Sendable, Value: Sendable {} -#endif extension SortedDictionary.Keys: Sequence { /// The element type of the collection. @@ -57,10 +55,8 @@ extension SortedDictionary.Keys: Sequence { } } -#if swift(>=5.5) extension SortedDictionary.Keys.Iterator: Sendable where Key: Sendable, Value: Sendable {} -#endif extension SortedDictionary.Keys: BidirectionalCollection { /// The index type for a dictionary's keys view. diff --git a/Sources/SortedCollections/SortedDictionary/SortedDictionary+Sendable.swift b/Sources/SortedCollections/SortedDictionary/SortedDictionary+Sendable.swift index b73f0906..4eeedc16 100644 --- a/Sources/SortedCollections/SortedDictionary/SortedDictionary+Sendable.swift +++ b/Sources/SortedCollections/SortedDictionary/SortedDictionary+Sendable.swift @@ -9,7 +9,5 @@ // //===----------------------------------------------------------------------===// -#if swift(>=5.5) extension SortedDictionary: @unchecked Sendable where Key: Sendable, Value: Sendable {} -#endif diff --git a/Sources/SortedCollections/SortedDictionary/SortedDictionary+Sequence.swift b/Sources/SortedCollections/SortedDictionary/SortedDictionary+Sequence.swift index da61b317..41c8ad83 100644 --- a/Sources/SortedCollections/SortedDictionary/SortedDictionary+Sequence.swift +++ b/Sources/SortedCollections/SortedDictionary/SortedDictionary+Sequence.swift @@ -46,7 +46,5 @@ extension SortedDictionary: Sequence { } } -#if swift(>=5.5) extension SortedDictionary.Iterator: @unchecked Sendable where Key: Sendable, Value: Sendable {} -#endif diff --git a/Sources/SortedCollections/SortedDictionary/SortedDictionary+SubSequence.swift b/Sources/SortedCollections/SortedDictionary/SortedDictionary+SubSequence.swift index 503a1fb3..4b23f2dd 100644 --- a/Sources/SortedCollections/SortedDictionary/SortedDictionary+SubSequence.swift +++ b/Sources/SortedCollections/SortedDictionary/SortedDictionary+SubSequence.swift @@ -30,10 +30,8 @@ extension SortedDictionary { } } -#if swift(>=5.5) extension SortedDictionary.SubSequence: @unchecked Sendable where Key: Sendable, Value: Sendable {} -#endif extension SortedDictionary.SubSequence: Sequence { public typealias Element = SortedDictionary.Element @@ -71,10 +69,8 @@ extension SortedDictionary.SubSequence: Sequence { } } -#if swift(>=5.5) extension SortedDictionary.SubSequence.Iterator: @unchecked Sendable where Key: Sendable, Value: Sendable {} -#endif extension SortedDictionary.SubSequence: BidirectionalCollection { public typealias Index = SortedDictionary.Index diff --git a/Sources/SortedCollections/SortedDictionary/SortedDictionary+Values.swift b/Sources/SortedCollections/SortedDictionary/SortedDictionary+Values.swift index b137bfc7..356a9df6 100644 --- a/Sources/SortedCollections/SortedDictionary/SortedDictionary+Values.swift +++ b/Sources/SortedCollections/SortedDictionary/SortedDictionary+Values.swift @@ -23,10 +23,8 @@ extension SortedDictionary { } } -#if swift(>=5.5) extension SortedDictionary.Values: Sendable where Key: Sendable, Value: Sendable {} -#endif extension SortedDictionary.Values: Sequence { /// The element type of the collection. @@ -57,10 +55,8 @@ extension SortedDictionary.Values: Sequence { } } -#if swift(>=5.5) extension SortedDictionary.Values.Iterator: Sendable where Key: Sendable, Value: Sendable {} -#endif extension SortedDictionary.Values: BidirectionalCollection { /// The index type for a dictionary's values view. diff --git a/Sources/SortedCollections/SortedDictionary/SortedDictionary.Index.swift b/Sources/SortedCollections/SortedDictionary/SortedDictionary.Index.swift index 99737b6e..95cc9d48 100644 --- a/Sources/SortedCollections/SortedDictionary/SortedDictionary.Index.swift +++ b/Sources/SortedCollections/SortedDictionary/SortedDictionary.Index.swift @@ -34,10 +34,8 @@ extension SortedDictionary { } } -#if swift(>=5.5) extension SortedDictionary.Index: @unchecked Sendable where Key: Sendable, Value: Sendable {} -#endif // MARK: Equatable extension SortedDictionary.Index: Equatable { diff --git a/Sources/SortedCollections/SortedSet/SortedSet+Sendable.swift b/Sources/SortedCollections/SortedSet/SortedSet+Sendable.swift index 26d215ea..c080c760 100644 --- a/Sources/SortedCollections/SortedSet/SortedSet+Sendable.swift +++ b/Sources/SortedCollections/SortedSet/SortedSet+Sendable.swift @@ -9,6 +9,4 @@ // //===----------------------------------------------------------------------===// -#if swift(>=5.5) extension SortedSet: @unchecked Sendable where Element: Sendable {} -#endif diff --git a/Sources/SortedCollections/SortedSet/SortedSet+Sequence.swift b/Sources/SortedCollections/SortedSet/SortedSet+Sequence.swift index 2b75aeac..676d00bb 100644 --- a/Sources/SortedCollections/SortedSet/SortedSet+Sequence.swift +++ b/Sources/SortedCollections/SortedSet/SortedSet+Sequence.swift @@ -50,7 +50,5 @@ extension SortedSet: Sequence { } } -#if swift(>=5.5) extension SortedSet.Iterator: @unchecked Sendable where Element: Sendable {} -#endif diff --git a/Sources/SortedCollections/SortedSet/SortedSet+SubSequence.swift b/Sources/SortedCollections/SortedSet/SortedSet+SubSequence.swift index f7793016..bd718ae0 100644 --- a/Sources/SortedCollections/SortedSet/SortedSet+SubSequence.swift +++ b/Sources/SortedCollections/SortedSet/SortedSet+SubSequence.swift @@ -30,10 +30,8 @@ extension SortedSet { } } -#if swift(>=5.5) extension SortedSet.SubSequence: @unchecked Sendable where Element: Sendable {} -#endif extension SortedSet.SubSequence: Sequence { public typealias Element = SortedSet.Element @@ -71,10 +69,8 @@ extension SortedSet.SubSequence: Sequence { } } -#if swift(>=5.5) extension SortedSet.SubSequence.Iterator: @unchecked Sendable where Element: Sendable {} -#endif extension SortedSet.SubSequence: BidirectionalCollection { public typealias Index = SortedSet.Index diff --git a/Sources/SortedCollections/SortedSet/SortedSet.Index.swift b/Sources/SortedCollections/SortedSet/SortedSet.Index.swift index 1910e0be..24bceb73 100644 --- a/Sources/SortedCollections/SortedSet/SortedSet.Index.swift +++ b/Sources/SortedCollections/SortedSet/SortedSet.Index.swift @@ -34,10 +34,8 @@ extension SortedSet { } } -#if swift(>=5.5) extension SortedSet.Index: @unchecked Sendable where Element: Sendable {} -#endif // MARK: Equatable extension SortedSet.Index: Equatable { From 0b9f4064b3d224782db64df014d81ef3ce3f517c Mon Sep 17 00:00:00 2001 From: Karoy Lorentey Date: Tue, 20 May 2025 14:46:12 -0700 Subject: [PATCH 2/4] Disable SortedCollections module The sorted collection types are not yet ready for production use. Remove them from the package manifest. Keep the code in place for now, although it will likely make more sense to track their development in a separate feature branch of this package. --- Package.swift | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Package.swift b/Package.swift index 5062bd7c..61688d6b 100644 --- a/Package.swift +++ b/Package.swift @@ -265,15 +265,16 @@ let targets: [CustomTarget] = [ name: "RopeModuleTests", dependencies: ["_RopeModule", "_CollectionsTestSupport"]), - .target( - kind: .exported, - name: "SortedCollections", - dependencies: ["InternalCollectionsUtilities"], - directory: "SortedCollections"), - .target( - kind: .test, - name: "SortedCollectionsTests", - dependencies: ["SortedCollections", "_CollectionsTestSupport"]), + // These aren't ready for production use yet. +// .target( +// kind: .exported, +// name: "SortedCollections", +// dependencies: ["InternalCollectionsUtilities"], +// directory: "SortedCollections"), +// .target( +// kind: .test, +// name: "SortedCollectionsTests", +// dependencies: ["SortedCollections", "_CollectionsTestSupport"]), .target( kind: .exported, @@ -285,7 +286,7 @@ let targets: [CustomTarget] = [ "HeapModule", "OrderedCollections", "_RopeModule", - "SortedCollections", + //"SortedCollections", ], exclude: ["CMakeLists.txt"]) ] From ecf44620d29cb953d4e7eb968679edd02fe6695f Mon Sep 17 00:00:00 2001 From: Karoy Lorentey Date: Tue, 20 May 2025 15:23:02 -0700 Subject: [PATCH 3/4] Also disable SortedCollections benchmarks --- Benchmarks/Sources/Benchmarks/SortedDictionaryBenchmarks.swift | 2 ++ Benchmarks/Sources/Benchmarks/SortedSetBenchmarks.swift | 2 ++ Benchmarks/Sources/benchmark-tool/main.swift | 2 ++ 3 files changed, 6 insertions(+) diff --git a/Benchmarks/Sources/Benchmarks/SortedDictionaryBenchmarks.swift b/Benchmarks/Sources/Benchmarks/SortedDictionaryBenchmarks.swift index 5af4c381..de4f30d7 100644 --- a/Benchmarks/Sources/Benchmarks/SortedDictionaryBenchmarks.swift +++ b/Benchmarks/Sources/Benchmarks/SortedDictionaryBenchmarks.swift @@ -9,6 +9,7 @@ // //===----------------------------------------------------------------------===// +#if false // SortedCollections is not a thing yet import CollectionsBenchmark import SortedCollections @@ -301,3 +302,4 @@ extension Benchmark { } } } +#endif diff --git a/Benchmarks/Sources/Benchmarks/SortedSetBenchmarks.swift b/Benchmarks/Sources/Benchmarks/SortedSetBenchmarks.swift index be4555d4..b827210f 100644 --- a/Benchmarks/Sources/Benchmarks/SortedSetBenchmarks.swift +++ b/Benchmarks/Sources/Benchmarks/SortedSetBenchmarks.swift @@ -9,6 +9,7 @@ // //===----------------------------------------------------------------------===// +#if false // SortedCollections is not a thing yet import CollectionsBenchmark import SortedCollections @@ -205,3 +206,4 @@ extension Benchmark { } } +#endif diff --git a/Benchmarks/Sources/benchmark-tool/main.swift b/Benchmarks/Sources/benchmark-tool/main.swift index 7060ec8c..1a9f7ab2 100644 --- a/Benchmarks/Sources/benchmark-tool/main.swift +++ b/Benchmarks/Sources/benchmark-tool/main.swift @@ -33,8 +33,10 @@ benchmark.addTreeDictionaryBenchmarks() benchmark.addDequeBenchmarks() benchmark.addOrderedSetBenchmarks() benchmark.addOrderedDictionaryBenchmarks() +#if false benchmark.addSortedSetBenchmarks() benchmark.addSortedDictionaryBenchmarks() +#endif benchmark.addHeapBenchmarks() benchmark.addBitSetBenchmarks() benchmark.addTreeSetBenchmarks() From e337c2b936320f538fc8b9e8b66d51bff56646e4 Mon Sep 17 00:00:00 2001 From: Karoy Lorentey Date: Tue, 20 May 2025 15:37:27 -0700 Subject: [PATCH 4/4] Remove SortedCollections scheme --- .../xcschemes/SortedCollections.xcscheme | 101 ------------------ 1 file changed, 101 deletions(-) delete mode 100644 Utils/swift-collections.xcworkspace/xcshareddata/xcschemes/SortedCollections.xcscheme diff --git a/Utils/swift-collections.xcworkspace/xcshareddata/xcschemes/SortedCollections.xcscheme b/Utils/swift-collections.xcworkspace/xcshareddata/xcschemes/SortedCollections.xcscheme deleted file mode 100644 index 69a79d8b..00000000 --- a/Utils/swift-collections.xcworkspace/xcshareddata/xcschemes/SortedCollections.xcscheme +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -