Package traits already pass defines with their trait name when building. Instead of adding our own conditional defines based on the traits we can use the trait provided defines directly. I observed that various tooling behaves better with the trait provided defines.
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.
Adds trailing underscores to the BorrowingSequence protocols and
requirements, in order to allow both parallel conformances and
the ability to evolve the requirements in this package.
“Work” in this case means that they can be enabled without breaking the build — not necessarily that all features are available.
Swift 6.2 is highly prone to runtime crashes in `swift_getTypeByMangledName` in generic code that uses ownership features. Swift 6.3 will resolve that.
This is getting into dangerous territory, as RRC allows fixed-capacity conformers, where appending a producer must be done extremely carefully. We should be using bulk append operations, but never ask the container to reserve any more slots than the producer is able to actually generate. (When the fixed-capacity RRC was carefully sized to precisely fit the generator’s contents, asking it to provide space for even a single item more would lead to a runtime trap.)
Additionally, the algorithm should work (and be reasonably efficient) even if the RRC happens to be a dynamically sizing container type.
It would be nice if we had a Producer protocol flavor with an exact count; failing that, we can still do this with a bit of acrobatics, as implemented here. (The `DynamicContainer.append(from:)` algorithm was already implemented this way in a previous commit, with an eye towards this case.)