Skip to content

Fix LifetimeDependenceScopeFixup: read access can depend on 'inout' #81004

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 2 commits into from
Apr 23, 2025

Conversation

atrick
Copy link
Contributor

@atrick atrick commented Apr 22, 2025

Allow a dependency on a local [read] access scope to be transfered to the caller's [modify] access.

Fixes rdar://149560133 (Invalid lifetime dependence error when trying to return Span from an inout argument)

atrick added 2 commits April 21, 2025 22:33
Add support for returnValue phis (e.g. to return an Optional .some or .none).

Fixes rdar://149397018 (Wrapping non escapable in an Optional
(or any copy lifetime wrapper) is an escape)
Allow a dependency on a local [read] access scope to be transfered to the
caller's [modify] access.

Fixes rdar://149560133 (Invalid lifetime dependence error when
trying to return Span from an inout argument)
@atrick atrick requested a review from eeckstein as a code owner April 22, 2025 19:03
@atrick atrick requested a review from meg-gupta April 22, 2025 19:04
@atrick
Copy link
Contributor Author

atrick commented Apr 22, 2025

@swift-ci 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

@atrick
Copy link
Contributor Author

atrick commented Apr 22, 2025

@swift-ci smoke test linux

@atrick
Copy link
Contributor Author

atrick commented Apr 22, 2025

@swift-ci smoke test windows

@atrick atrick enabled auto-merge April 23, 2025 04:24
@atrick atrick merged commit af17772 into swiftlang:main Apr 23, 2025
4 of 5 checks passed
@atrick atrick deleted the nested-modify-read branch April 23, 2025 05:18
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