Skip to content

[6.2] Update spelling for representing lifetime dependencies to @_lifetime #82146

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 4 commits into from
Jun 12, 2025

Conversation

meg-gupta
Copy link
Contributor

@meg-gupta meg-gupta commented Jun 10, 2025

Explanation: LifetimeDependence is a supported experimental feature for which we have to maintain source compatibility. During language evolution if we decide to update its semantics or syntax under @lifetime attribute, it can introduce significant confusion and maintenance problems to both early adopters and compiler developers.

To mitigate this, this PR introduces an underscore, effectively making the annotation @_lifetime, to provide a clear distinction and avoid potential conflicts during future development. Standard library will continue to use @lifetime in the near term.

@_lifetime is implemented as a suppressible language feature and @lifetime is printed in the suppressed path since the oldest compilers we have to support with a new sdk have support for @lifetime. This will ensure when the standard library migrates to @_lifetime we will continue to support older compilers.

Issue: rdar://151901744

Scope: Affects early adopters of lifetime dependencies

Risk: Medium. Along with the source changes being large, this change can cause a warning with @Lifetime uses outside the stdlib.

Main PR: #82067

Reviewers: @atrick @tshortli

Testing: swift CI testing.

@meg-gupta
Copy link
Contributor Author

@swift-ci test

@meg-gupta meg-gupta force-pushed the cpunderscore branch 2 times, most recently from ac5367b to e43fb42 Compare June 10, 2025 17:18
@meg-gupta
Copy link
Contributor Author

@swift-ci test

@meg-gupta meg-gupta marked this pull request as ready for review June 10, 2025 17:21
@meg-gupta meg-gupta requested a review from a team as a code owner June 10, 2025 17:21
@meg-gupta meg-gupta requested a review from tbkka June 10, 2025 17:21
@meg-gupta
Copy link
Contributor Author

@swift-ci test

@meg-gupta meg-gupta enabled auto-merge June 11, 2025 01:32
@meg-gupta
Copy link
Contributor Author

@swift-ci test

@meg-gupta meg-gupta force-pushed the cpunderscore branch 2 times, most recently from c22d664 to cd07359 Compare June 11, 2025 15:15
@meg-gupta
Copy link
Contributor Author

@swift-ci test

@meg-gupta
Copy link
Contributor Author

@swift-ci test

@meg-gupta
Copy link
Contributor Author

@swift-ci test

@meg-gupta
Copy link
Contributor Author

@swift-ci test macOS platform

@meg-gupta meg-gupta merged commit 1b34cbe into swiftlang:release/6.2 Jun 12, 2025
5 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