Skip to content

[6.0][sending] Replace sending with __owned when suppressing sending from arguments in swiftinterface files. #75153

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

Conversation

gottesmm
Copy link
Contributor

Explanation: Previously we would just not print sending. This causes problems since sending
implies a +1 parameter and by removing it we convert the parameter to a +0
parameter, breaking ABI. In this commit, I make it so that when we suppress
sending from argument parameters, we just replace it with __owned so that we
preserve ABI even for callers who do not support sending.

Radars:

  • rdar://131066640

Original PRs:

Risk: Low. This is a really simple change that just tweaks the code that stops printing sending to instead print __owned. On the face of it, it is a safe patch.
Testing: Updated exhaustive tests that show that we now produce __owned instead of nothing.
Reviewer: @tshortli

gottesmm added 2 commits July 10, 2024 16:48
…m arguments in swiftinterface files.

Previously we would just not print sending. This causes problems since sending
implies a +1 parameter and by removing it we convert the parameter to a +0
parameter, breaking ABI. In this commit, I make it so that when we suppress
sending from argument parameters, we just replace it with consuming so that we
preserve ABI even for callers who do not support sending.

rdar://131066640
(cherry picked from commit fdd435a)
The reason why I am doing this is that consuming could cause no implicit
copy errors. Instead __owned will just potentially cause an error if
someone assigns into sending.

rdar://131066640
(cherry picked from commit 63146bc)
@gottesmm gottesmm requested a review from a team as a code owner July 10, 2024 23:51
@gottesmm gottesmm requested a review from tshortli July 10, 2024 23:51
@gottesmm
Copy link
Contributor Author

@swift-ci test

@gottesmm gottesmm enabled auto-merge July 10, 2024 23:51
Copy link
Contributor

@ktoso ktoso left a comment

Choose a reason for hiding this comment

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

Nice, thank you

@gottesmm gottesmm merged commit 6741653 into swiftlang:release/6.0 Jul 11, 2024
5 checks passed
@gottesmm gottesmm deleted the release/6.0-rdar131066640 branch July 16, 2024 17:17
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