Skip to content

[stdlib] make _overrideLifetime() functions public #81224

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

glessard
Copy link
Contributor

These functions are discussed in the lifetime annotations pitch: swiftlang/swift-evolution#2750
They are necessary to implement functions returning non-escapable values, such as Data.bytes.

Addresses rdar://150400414

@glessard glessard requested review from eeckstein and a team as code owners April 30, 2025 23:35
@glessard
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Contributor

@meg-gupta meg-gupta left a comment

Choose a reason for hiding this comment

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

lgtm

@glessard glessard enabled auto-merge May 1, 2025 00:06
Copy link
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.

Thanks! This is super helpful.

@atrick
Copy link
Contributor

atrick commented May 1, 2025

@glessard you can remove these TODOs now:

  // TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence
  // should be expressed by a builtin that is hidden within the function body.

They were originally to discourage people from using @_unsafeNonescapableResult in more places, but we won't be able to remove that annotation any time soon and the TODO is unhelpful for anyone not working on the compiler.

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