@@ -331,8 +331,7 @@ public protocol Sequence<Element> /* : ~Copyable, ~Escapable */ {
331331 associatedtype Iterator : IteratorProtocol < Element >
332332
333333 @available ( SwiftStdlib 6 . 3 , * )
334- associatedtype BorrowingIterator : BorrowingIteratorProtocol & ~ Copyable & ~ Escapable /* where BorrowingIterator.Element == Element */
335- = BorrowingIteratorAdapter < Self >
334+ associatedtype BorrowingIterator : BorrowingIteratorProtocol < Element > & ~ Copyable & ~ Escapable = BorrowingIteratorAdapter < Self >
336335
337336 // FIXME: <rdar://problem/34142121>
338337 // This typealias should be removed as it predates the source compatibility
@@ -465,7 +464,9 @@ public struct BorrowingIteratorAdapter<S: Sequence>: /* & ~Copyable & ~Escapable
465464{
466465 var iterator : S . Iterator
467466 var curValue : S . Element ?
468-
467+
468+ public typealias Element = S . Element
469+
469470 @lifetime ( & self )
470471 public mutating func nextSpan( maximumCount: Int ) -> Span < S . Element > {
471472 curValue = iterator. next ( )
@@ -480,7 +481,7 @@ public enum NeverIterator<Element: ~Copyable> {}
480481extension NeverIterator : IteratorProtocol { /* where Element: ~Copyable */
481482 public typealias Element = Element
482483 public func next( ) -> Element ? {
483- fatalError ( )
484+ Builtin . unreachable ( )
484485 }
485486}
486487
@@ -491,6 +492,13 @@ extension Sequence where BorrowingIterator == BorrowingIteratorAdapter<Self> {
491492 }
492493}
493494
495+ @available ( SwiftStdlib 6 . 3 , * )
496+ extension Sequence where Iterator == NeverIterator < Element > {
497+ public func makeIterator( ) -> Iterator {
498+ fatalError ( " Attempt to iterate using a NeverIterator " )
499+ }
500+ }
501+
494502// Provides a default associated type witness for Iterator when the
495503// Self type is both a Sequence and an Iterator.
496504extension Sequence where Self: IteratorProtocol {
0 commit comments