Skip to content

[MoveOnly] Call borrowing methods on existentials. #73857

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 3 commits into from
May 24, 2024

Conversation

nate-chandler
Copy link
Contributor

@nate-chandler nate-chandler commented May 23, 2024

Teach FSPL to look through open_existential_addr and teach the ExistentialSpecializer not to specialize non-copyable existentials which aren't consumed (doing so would require a copy, which is illegal).

Not fixed here:

  • a mangling failure when -g is passed
  • consuming methods on existentials

rdar://125864434

It's a pass-through for FSPL's purposes.
Bail on non-consuming existential values which are move-only.
Existential specialization requires creating a copy in such cases and
that's illegal for move-only values.
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler nate-chandler requested review from kavon and atrick May 23, 2024 19:35
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.

Rubber stamp!

@nate-chandler nate-chandler merged commit 5b02713 into swiftlang:main May 24, 2024
5 checks passed
@nate-chandler nate-chandler deleted the rdar125864434 branch May 24, 2024 19:14
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