Skip to content

AST/Frontend/stdlib: Fix condfails for NoncopyableGenerics and IsolatedAny #72608

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 28, 2024

Conversation

tshortli
Copy link
Contributor

@tshortli tshortli commented Mar 27, 2024

The .swiftinterface of the standard library must remain compatible with some older compilers. Unfortunately, some of those older compilers do not allow the experimental features NoncopyableGenerics and IsolatedAny to be enabled in production. To allow the stdlib to build with these features enabled and still have the older compilers consume its interface, we have to use new experimental feature identifiers that they do not know about.

Additionally, some adjustments to feature suppression were needed for these features.

Partially resolves rdar://125138945

@tshortli tshortli force-pushed the non-copyable-generics-2 branch from cd1ca40 to 4ac9932 Compare March 27, 2024 05:15
@tshortli tshortli force-pushed the non-copyable-generics-2 branch 3 times, most recently from 04c4309 to 10e48cb Compare March 27, 2024 23:48
@tshortli
Copy link
Contributor Author

@swift-ci please smoke test

… feature.

The `.swiftinterface` of the standard library must remain compatible with some
older compilers. Unfortunately, some of those older compilers do not allow the
experimental feature `NoncopyableGenerics` to be enabled in production. To
allow the stdlib to build with non-copyable generics enabled and still have the
older compilers consume its interface, we have to use a new experimental
feature identifier that they do not know about.

Partially resolves rdar://125138945
…sed.

When printing declarations with `NoncopyableGenerics2` suppressed we must avoid
printing the `@_preInverseGenerics` attribute and any `borrowing` or
`consuming` parameter ownership modifiers.
This prevents some re-declaration errors when building the standard library
from its `.swiftinterface` with older compilers.
To preserve compatibility with older compilers that do not allow `IsolatedAny`
to be enabled in production compilers, use an alias experimental feature when
building the stdlib (`IsolatedAny2`).

Also, add `@_allowFeatureSuppression(IsolatedAny)` in a couple spots it was
forgotten.

Partially resolves rdar://125138945
@tshortli tshortli force-pushed the non-copyable-generics-2 branch from 10e48cb to 590d335 Compare March 28, 2024 05:32
@tshortli tshortli requested a review from ktoso as a code owner March 28, 2024 05:32
@tshortli tshortli changed the title AST/stdlib: Introduce and adopt experimental feature NoncopyableGenerics2 AST/Frontend/stdlib: Fix condfails for NoncopyableGenerics and IsolatedAny Mar 28, 2024
@tshortli
Copy link
Contributor Author

@swift-ci please smoke test

@tshortli tshortli merged commit 05a5bc4 into swiftlang:main Mar 28, 2024
@tshortli tshortli deleted the non-copyable-generics-2 branch March 28, 2024 15:23
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.

1 participant