Skip to content

[6.0][region-isolation] Add 'inout sending' diagnostics. #74924

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
Jul 5, 2024

Conversation

gottesmm
Copy link
Contributor

@gottesmm gottesmm commented Jul 3, 2024

Explanation: This PR adds support for 'inout sending' diagnostics. Specifically:

  1. We error now if one transfers an 'inout sending' parameter and does not
    reinitialize it before the end of the function.

  2. We error now if one merges an 'inout sending' parameter into an actor
    isolated region and do not reinitialize it with a non-actor isolated value
    before the end of the function.

Radars:

  • rdar://126303739

Original PRs:

Risk: Low. This just adds 2 additional diagnostics to close a hole in the model.
Testing: Added/Ran tests
Reviewer: N/A

gottesmm added 3 commits July 2, 2024 20:49
…so we can attach a Kind and propagate it.

The reason why I am doing this is that I am adding support for failing to
reinitialize an inout sending parameter that was transferred. To make it really
easy to do I am just going to explicitly represent this on the RequireInst and
let the decision on what diagnostic to be done to be represented in the
pseudo-IR instead of trying to just infer it straight from the type of require
inst. This keeps all of the logic in the same place and attempts to keep the
diagnostic emitter not use logic and instead just emit.

This is NFC so I can make sure that things work before adding the additional code.

(cherry picked from commit 5d4b93f)
Specifically:

1. We error now if one transfers an 'inout sending' parameter and does not
reinitialize it before the end of the function.

2. We error now if one merges an 'inout sending' parameter into an actor
isolated region and do not reinitialize it with a non-actor isolated value
before the end of the function.

rdar://126303739
(cherry picked from commit 6fe7496)
@gottesmm gottesmm requested a review from a team as a code owner July 3, 2024 03:50
@gottesmm
Copy link
Contributor Author

gottesmm commented Jul 3, 2024

@swift-ci test

I was working on c20abe5 and
03bfade at the same time and I forgot to update
to use the new API in 03bfade before I commited
c20abe5. Sorry!
@gottesmm
Copy link
Contributor Author

gottesmm commented Jul 3, 2024

@swift-ci test

1 similar comment
@gottesmm
Copy link
Contributor Author

gottesmm commented Jul 3, 2024

@swift-ci test

@gottesmm gottesmm merged commit 39d86a3 into swiftlang:release/6.0 Jul 5, 2024
5 checks passed
@gottesmm gottesmm deleted the release/6.0-rdar126303739 branch July 5, 2024 20:19
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