Skip to content

Fix a few new region isolation errors in nightly-main#419

Merged
FranzBusch merged 2 commits into
apple:mainfrom
FranzBusch:fb-fix-6.5-compiler-errors
May 14, 2026
Merged

Fix a few new region isolation errors in nightly-main#419
FranzBusch merged 2 commits into
apple:mainfrom
FranzBusch:fb-fix-6.5-compiler-errors

Conversation

@FranzBusch
Copy link
Copy Markdown
Member

Region isolation got smarter and started diagnosing more potential data races. This PR addresses the new errors. Importantly I had to introduce one @unchecked Sendable conformance since we can't yet use UniqueDeque

…tainer` buffers

Replace `InputSpan`/`OutputSpan` with generic `Buffer` associated types constrained to `RangeReplaceableContainer` across all four streaming protocols. This sidesteps the limitation that `OutputSpan` (and other `~Escapable` types) cannot be used in async contexts today, while still allowing conforming types to choose a buffer representation optimized for their use case (e.g. `UniqueArray` for heap-backed storage, or a future stack-allocated container for embedded).

Switch callee-owned protocols from `consuming` to `inout` closure semantics, rename `forEachChunk` to `forEachBuffer`, and move `forEach`/`collect` to future directions in the proposal.

Adds test coverage for `AsyncWriter`, `CallerAsyncReader`, and `EitherError`. Updates all documentation to reflect the new API surface.
Copy link
Copy Markdown
Member

@phausler phausler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a bug tracking the compiler regression breaking existing code?
The changes look fine here.

@FranzBusch
Copy link
Copy Markdown
Member Author

I filed swiftlang/swift#89141 but it these new errors are real data races and for some of our @usableFromInline types we were just missing an explicit Sendable conformance.

Region isolation got smarter and started diagnosing more potential data races. This PR addresses the new errors. Importantly I had to introduce one `@unchecked Sendable` conformance since we can't yet use `UniqueDeque`
@FranzBusch FranzBusch force-pushed the fb-fix-6.5-compiler-errors branch from 1f0f62a to cf488f1 Compare May 14, 2026 21:01
@FranzBusch FranzBusch merged commit 6a92272 into apple:main May 14, 2026
30 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants