Skip to content

Concurrency: Make _Concurrency module interface parseable by older compilers #65599

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 1 commit into from
May 3, 2023

Conversation

tshortli
Copy link
Contributor

@tshortli tshortli commented May 2, 2023

Revert a few unnecessary changes have been made to the _Concurrency module recently that make its swiftinterface un-parseable by older compilers that we need to support.

  • The consume keyword is not understood by older compilers, so including it in inlinable code is a problem. It has no actual effect on lifetimes where it was used, so just omit it.
  • Don't build the _Concurrency module with -enable-experimental-feature MoveOnly. The MoveOnly feature is now enabled by default in recent compilers, so the flag is superfluous when building the dylib. When emitting the interface, having the feature enabled explicitly exposes code guarded by $MoveOnly to older compilers that do not accept all of the code.

Resolves rdar://108793606

…pilers.

Revert a few unnecessary changes have been made to the _Concurrency module
recently that make its swiftinterface un-parseable by older compilers that we
need to support.

- The `consume` keyword is not understood by older compilers, so including it
  in inlinable code is a problem. It has no actual effect on lifetimes where it
  was used, so just omit it.
- Don't build the _Concurrency module with -enable-experimental-feature
  MoveOnly. The MoveOnly feature is now enabled by default in recent compilers,
  so the flag is superfluous when building the dylib. When emitting the
  interface, having the feature enabled explicitly exposes code guarded by
  `$MoveOnly` to older compilers that do not accept all of the code.

Resolves rdar://108793606
@tshortli tshortli requested review from nate-chandler, kavon and ktoso May 2, 2023 22:34
@tshortli
Copy link
Contributor Author

tshortli commented May 2, 2023

@swift-ci please test

@nate-chandler
Copy link
Contributor

Thanks! For clarity,

It has no actual effect on lifetimes where it was used, so just omit it.

This just happens to be true because lexical lifetimes aren't enabled in this module, so luckily we're able to omit the keyword to avoid the condfail. It does correctly communicate the intended behavior and should be restored when the oldest compilers we need to support are able to understand it.

@tshortli tshortli changed the title Concurrency: Make _Concurrency module interface parsable by older compilers Concurrency: Make _Concurrency module interface parseable by older compilers May 2, 2023
@tshortli tshortli merged commit f0848d7 into swiftlang:main May 3, 2023
@tshortli tshortli deleted the concurrency-module-condfails branch May 3, 2023 04:25
tshortli added a commit to tshortli/swift that referenced this pull request Aug 15, 2023
…n:).

It is no longer necessary to avoid using the `consume` keyword in inlinable
function bodies in the standard library in order to support older compilers.

Partially reverts swiftlang#65599.

Resolves rdar://109165937.
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.

3 participants