Skip to content

[stdlib] Enable Span<~Escapable>#89213

Open
natecook1000 wants to merge 8 commits into
swiftlang:mainfrom
natecook1000:nonescapable-span-elements
Open

[stdlib] Enable Span<~Escapable>#89213
natecook1000 wants to merge 8 commits into
swiftlang:mainfrom
natecook1000:nonescapable-span-elements

Conversation

@natecook1000
Copy link
Copy Markdown
Member

Allows Span of ~Escapable types, dependent on the new PreInverseGenericsExcept feature flag to maintain ABI stability.

atrick and others added 7 commits May 15, 2026 13:40
Support for non-Escapable Span elements.

UnsafePointer-based APIs are not supported.
We can only use the new version of the @_preInverseGenerics attribute
when gated behind a feature check. This includes the RawSpan methods
that take a Span<~E> parameter.
@natecook1000
Copy link
Copy Markdown
Member Author

@swift-ci Please smoke test

@natecook1000
Copy link
Copy Markdown
Member Author

@swift-ci Please smoke test

@atrick
Copy link
Copy Markdown
Contributor

atrick commented May 19, 2026

@swift-ci apple silicon benchmark

Copy link
Copy Markdown
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

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

Thank you! This is great! Sorry it had to be such a horrible conditionalized mess. I am curious why we need an experimental feature flag for PreInverseGenericsExcept instead of a normal language feature that only requires a new enough compiler

Comment thread stdlib/public/core/Span/Span.swift
@natecook1000
Copy link
Copy Markdown
Member Author

@swift-ci Please build toolchain macOS platform

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.

4 participants