Skip to content

Commit b2a5ebe

Browse files
committed
Always emit AsyncIteratorProtocol._nextElement into the client
... this allows us to use the entrypoint when back-deploying code that uses the async for..in loop.
1 parent bb7a563 commit b2a5ebe

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

stdlib/public/Concurrency/AsyncIteratorProtocol.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public protocol AsyncIteratorProtocol<Element, Failure> {
112112
extension AsyncIteratorProtocol {
113113
/// Default implementation of `_nextElement()` in terms of `next()`, which is
114114
/// required to maintain backward compatibility with existing async iterators.
115-
@available(SwiftStdlib 5.11, *)
115+
@_alwaysEmitIntoClient
116116
public mutating func _nextElement() async throws(Failure) -> Element? {
117117
do {
118118
return try await next()

test/api-digester/stability-concurrency-abi.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ Protocol AsyncSequence has generic signature change from <Self.AsyncIterator : _
6565
Struct CheckedContinuation has removed conformance to UnsafeSendable
6666
Protocol AsyncIteratorProtocol is now without @rethrows
6767
Protocol AsyncSequence is now without @rethrows
68+
Func AsyncIteratorProtocol._nextElement() has been added as a protocol requirement
6869

6970
// SerialExecutor gained `enqueue(_: __owned Job)`, protocol requirements got default implementations
7071
Func SerialExecutor.enqueue(_:) has been added as a protocol requirement

0 commit comments

Comments
 (0)