Skip to content

[region-isolation] Perform checking of non-Sendable results using rbi rather than Sema. #77900

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 6 commits into from
Dec 4, 2024

Conversation

gottesmm
Copy link
Contributor

@gottesmm gottesmm commented Dec 2, 2024

[region-isolation] Perform checking of non-Sendable results using rbi rather than Sema.

In terms of the test suite the only difference is that we allow for non-Sendable
types to be returned from nonisolated functions. This is safe due to the rules
of rbi. We do still error when we return non-Sendable functions across isolation
boundaries though.

The reason that I am doing this now is that I am implementing a prototype that
allows for nonisolated functions to inherit isolation from their caller. This
would have required me to implement support both in Sema for results and
arguments in SIL. Rather than implement results in Sema, I just finished the
work of transitioning the result checking out of Sema and into SIL. The actual
prototype will land in a subsequent change.

rdar://127477211


I did the test updates in a separate commit to make it a little easier to review.

@gottesmm
Copy link
Contributor Author

gottesmm commented Dec 2, 2024

@swift-ci smoke test

1 similar comment
@gottesmm
Copy link
Contributor Author

gottesmm commented Dec 2, 2024

@swift-ci smoke test

… rather than Sema.

In terms of the test suite the only difference is that we allow for non-Sendable
types to be returned from nonisolated functions. This is safe due to the rules
of rbi. We do still error when we return non-Sendable functions across isolation
boundaries though.

The reason that I am doing this now is that I am implementing a prototype that
allows for nonisolated functions to inherit isolation from their caller. This
would have required me to implement support both in Sema for results and
arguments in SIL. Rather than implement results in Sema, I just finished the
work of transitioning the result checking out of Sema and into SIL. The actual
prototype will land in a subsequent change.

rdar://127477211
Importantly since this test had a typechecker error within it, we do not get
return value diagnostics anymore since that occurs now at SIL time.
@gottesmm
Copy link
Contributor Author

gottesmm commented Dec 2, 2024

@swift-ci smoke test

1 similar comment
@gottesmm
Copy link
Contributor Author

gottesmm commented Dec 3, 2024

@swift-ci smoke test

I tried to port this behavior to another test that validated the behavior using
RBI. When I tried to do so I ran into the issue that the behavior in this test
only reproduces in targeted mode not in complete mode which is required for rbi
to run.
@gottesmm
Copy link
Contributor Author

gottesmm commented Dec 3, 2024

@swift-ci smoke test

@gottesmm
Copy link
Contributor Author

gottesmm commented Dec 3, 2024

:sigh: lost my MSVC fix when doing force pushes... repushed it.

@gottesmm
Copy link
Contributor Author

gottesmm commented Dec 3, 2024

@swift-ci smoke test

@gottesmm gottesmm merged commit 87495c6 into swiftlang:main Dec 4, 2024
3 checks passed
@gottesmm gottesmm deleted the rdar127477211 branch December 4, 2024 06:08
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.

1 participant