100 Commits
Author SHA1 Message Date
Karoy Lorentey f17980c2c5 Stop using @_addressableForDependencies 2026-11-05 16:29:46 -08:00
Karoy Lorentey 891f7b6b8d Package: Stop enabling obsolete BorrowingSequence feature
Also, don’t enable SuppressedAssociatedTypesWithDefaults below Swift 6.4.
2026-10-12 12:24:56 -07:00
Karoy Lorentey 13f71ad927 Enable strict memory safety 2026-09-30 20:40:09 -07:00
Karoy Lorentey 1be474f795 Xcode, CMake: Spin off ContainersPreview into its own target 2026-09-29 15:41:03 -07:00
Karoy Lorentey 935af54791 [Xcode] Remove obsolete file references 2026-09-25 16:01:42 -07:00
Karoy Lorentey 842f125c47 Invert dependencies to ContainersPreview, moving all container APIs there
- Move `InputSpan` into its own module, `SpanPreview`. Add dependencies to it.
- Invert dependencies to `ContainersPreview`, so that no production target imports it, but it now depends on its previous dependents.
- Move all generic APIs and conformances using `Producer`/`Drain`/`Container` to the `ContainersPreview` module.
- Remove `UnstableContainersPreview` conditions around `Iterable` APIs

In summary, importing `BasicContainers` and `DequeModule` continue to get us the basic definitions for `RigidArray`, `UniqueSet`, `RigidDeque` etc., without most of their unstable APIs. (With the exception of core APIs that require `InputSpan`.)

To get any API that uses an unstable protocol like `Container` or `Drain`, we’ll now need to import `ContainersPreview` in addition to the type-defining module.

This will provide a slightly less horrible migration path when (if) the container/producer protocol family gets adopted/adapted into the stdlib.
2026-08-25 18:29:58 -07:00
Karoy Lorentey 633e46d3b4 [Xcode] Convert groups into folders
This will hopefully remove the need to update the project every time we add/remove/rename a source file.
2026-08-25 14:10:06 -07:00
Karoy Lorentey fbe36a7af5 Rearrange Sources/ContainersPreview/Protocols/* 2026-07-28 19:43:06 -07:00
Karoy Lorentey 669eb09cea Use Iterable from the Standard Library, replacing the local definition 2026-07-27 13:32:46 -07:00
Karoy Lorentey ea581e47e1 Add UnfoldProducer 2026-07-15 15:10:58 -07:00
Karoy Lorentey 70dc238938 [BasicContainers] RigidDictionary, UniqueDictionary: Add keys property
This replaces `withKeys`, which is now deprecated.
2026-07-07 16:52:33 -07:00
Karoy Lorentey ff695132ed Bump availability of Iterable_ and Container protocols to SwiftStdlib 6.4
This is preparing for switching over to the stdlib’s definition of `protocol Iterable`, assuming it will land with macOS 27/iOS 27 etc availability; `Container` is refining `Iterable`, so it needs matching availability.

If `Iterable` won’t ship in Swift 6.4, then we’ll need to bump this again.
2026-07-07 14:22:45 -07:00
Karoy Lorentey bb0dc189ef maximumCount → maxCount
While we’re here, adjust `RigidSet.insert(maximumCount:initializingWith:)` and similar APIs to be consistent with RangeReplaceableContainer’s methods.
2026-07-07 14:21:53 -07:00
Karoy Lorentey 72c0dd258d IterableIteratorProtocol_ → BorrowingIteratorProtocol_ 2026-07-07 14:20:26 -07:00
Karoy Lorentey 3ba8d70ec3 Review and update container protocols and conformances
- @inlinable → @_alwaysEmitIntoClient for now, to avoid temporary ABI issues
- Review RangeReplaceableContainer algorithms; add missing ones:
    - New requirements: `removeFirst()`, `removeFirst(_:)`, `_customRemoveLast()`, `_customRemoveLast(_:) (with default implementations)
    - `func removeAll()`
    - `func removeLast()`, `func removeLast(_:)`, `func popLast()` when self is also bidirectional
- Review RigidArray, UniqueArray algorithms; remove ones needlessly duplicating functionality already provided by RRC. Try not to break source compatibility.
2026-07-07 14:18:09 -07:00
Karoy Lorentey e8b09ade25 Add subscript requirements to [Mutable]Container with borrow/mutate accessors 2026-06-22 20:10:22 -07:00
Karoy Lorentey 1fc82e2bc9 [Xcode] Clean up supported platforms & deployment configurations 2026-06-18 14:38:52 -07:00
Karoy Lorentey 5df2bf9ec3 [Xcode] Clean up supported platforms & deployment configurations 2026-06-18 14:27:04 -07:00
Karoy Lorentey 130d235b28 Resolve issues after rebase 2026-06-18 13:29:52 -07:00
Karoy Lorentey eabf5141d1 [ContainersPreview] Add CountedProducer protocol 2026-06-18 13:22:16 -07:00
Karoy Lorentey f5b320c29f Merge pull request #657 from natecook1000/iterable 2026-06-17 19:08:16 -07:00
Karoy Lorentey 3d68fc1107 Clean up the UniqueBox/Ref/MutableRef situation
- UniqueBox is public API, so we cannot remove it in favor of the stdlib’s
- Remove Ref and MutableRef. Keep an internal _MutableRef to work around stdlib limitations.
2026-06-17 18:29:41 -07:00
Karoy Lorentey 7c853751c6 Add IterableIteratorProtocol.mapError 2026-06-17 18:24:03 -07:00
Karoy Lorentey f37fe8e662 Define SwiftStdlib 6.4 with actual version numbers 2026-06-17 14:57:06 -07:00
Karoy Lorentey 816b887369 Update CMake and Xcode build configurations 2026-06-17 14:40:07 -07:00
Karoy Lorentey e31c04143e Update CMake & Xcode build configurations 2026-06-05 18:45:56 -07:00
Karoy Lorentey c3ba833517 Add basic tests for Collections module 2026-05-15 16:57:22 -07:00
Karoy Lorentey 8ecf8c711c [Xcode] Don’t enable traits by default 2026-05-07 16:25:00 -07:00
Karoy Lorentey f196269e7f Define placeholder availability macro for SwiftStdlib 6.5 2026-05-07 16:16:34 -07:00
Karoy Lorentey f83bd74aea Move FormatterFixtures into a nested package 2026-05-07 16:15:02 -07:00
Karoy Lorentey 40c730869d [ContainersPreview] Add more detailed tests for MutableRef’s API surface 2026-05-06 18:34:57 -07:00
Karoy Lorentey 16d6b8e1fe [ContainersPreview] Inout ⟹ MutableRef 2026-05-06 18:28:07 -07:00
Karoy Lorentey a6fd64697a [ContainersPreview] Borrow ⟹ Ref
Also update the type’s public API surface to reflect SE-0519, leaving deprecated aliases for the old names.
2026-05-06 18:00:13 -07:00
Karoy Lorentey 146056a641 [ContainersPreview] Box ⟹ UniqueBox
Also update the type’s public API surface to reflect SE-0517, leaving deprecated aliases for the old names.
2026-05-05 17:31:05 -07:00
Karoy Lorentey 022795168a [BasicContainers] Enable APIs scheduled to ship in 1.5.0
- `RigidArray.nextMutableSpan(after:maximumCount:)`
- `UniqueArray.nextMutableSpan(after:maximumCount:)`
- `RigidDeque.nextMutableSpan(after:maximumCount:)`
- `UniqueDeque.nextMutableSpan(after:maximumCount:)`
- `UniqueArray.init(minimumCapacity:)` (replacing `.init(capacity:)`)
- `UniqueDeque.init(minimumCapacity:)` (replacing `.init(capacity:)`)
- `RigidDeque.index(before:)`
- `UniqueDeque.index(before:)`
- `RigidDeque.formIndex(before:)`
- `UniqueDeque.formIndex(before:)`
2026-05-05 16:01:31 -07:00
Karoy Lorentey 1c95e19aeb [ContainersPreview] Don’t require Container.Index to conform to Comparable
This slows down the default implementations of `distance(from:to:)` and `index(_:offsetBy:limitedBy:)`, but it allows linked lists to conform to `Container`. The trade off seems fair.

While we’re here, flesh out the `BidirectionalContainer` refinements a little, and add `Container.isEmpty` and `._custom[Last]IndexOfEquatableElement(_:)`.

This code is still untested.
2026-04-16 18:04:37 -07:00
Nate Cook efdc1bbd96 Remove BorrowingSequence experimental feature flag
This prevents accidental usage of the experimental stdlib feature,
where the library's implementation is intended instead.
2026-03-27 10:56:44 -05:00
Karoy Lorentey 419e2f7df2 [ContainersPreview] Exhibit A in the case against prototyping things in the stdlib 😞 2026-03-26 17:14:45 -07:00
Karoy Lorentey 1a8db43736 [ContainersPreview] Link BorrowingSequenceTests to xcodeproj; fix its imports 2026-03-26 16:06:49 -07:00
Karoy Lorentey e2b980a4cc SuppressedAssociatedTypes ⟹ SuppressedAssociatedTypesWithDefaults 2026-03-26 14:51:37 -07:00
Karoy Lorentey 70a25f1f69 [ContainersPreview] Bump required toolchain to 6.4 for new protocols 2026-03-26 14:51:08 -07:00
Karoy Lorentey 2364daa6bf [ContainersPreview] Update CMake & Xcode build files 2026-03-17 13:32:12 -07:00
Karoy Lorentey 2e277a949b [ContainersPreview] Add a BorrowingIteratorProtocol.copy() algorithm to turn borrowing iterators into producers 2026-03-17 13:32:11 -07:00
Karoy Lorentey 121462fe19 [ContainersPreview] Add some implementations of .filter 2026-03-16 15:04:30 -07:00
Karoy Lorentey ea00086c7a [ContainersPreview] Update CMake/Xcode build configurations 2026-03-13 10:41:06 -07:00
Karoy Lorentey d9b09ecde8 Update copyright dates 2026-03-05 19:39:20 -08:00
Karoy Lorentey b29e7861b2 Update build configurations 2026-03-05 15:33:27 -08:00
Karoy Lorentey 4160bcb98d [BasicContainers] RigidDictionary, UniqueDictionary: Add debugging methods 2026-03-05 15:33:25 -08:00
Karoy Lorentey ffdc48e67e [BasicContainers] Finalize requirements for hashed containers
- UnstableNoncopyableKeys → UnstableHashedContainers
- Delete the GeneralizedEquatable and GeneralizedHashable protocols, replacing them with the standard generalizations in the 6.4 stdlib
- Require Swift 6.4 for {Rigid,Unique}{Set,Dictionary}.
2026-03-03 16:01:45 -08:00
Karoy Lorentey 978ebeda02 [BasicContainers] Fix spelling of a source file
Renaming `_Htable+Debugging.swift` to `_HTable+Debugging.swift` did not stick — rename the file to `_HTable+Debug.swift` to get rid of the lowercase t for good.
2026-03-02 16:14:20 -08:00