Skip to content

[no-implicit-copy] A few small patches to simplify a larger patch. #60003

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

Conversation

gottesmm
Copy link
Contributor

I am preparing a last patch that implements the +0 support for no-implicit-copy as I discussed with @jckarter. To make that final PR easier to review, I am trying to slice off some parts of it into earlier self contained commits.

gottesmm added 9 commits July 11, 2022 12:28
I already fixed SILMoveOnlyType -> SILMoveOnlyWrappedType in a previous commit
and just forgot to hit the canonical type wrapper.
I keep on needing to use this in various internal APIs to the compiler that I
don't want to have to make a public forward declared internal API.
…getASTType().

The reason why this makes sense is that this method is attempting to return the
current SILType but with a different category. So using getASTType() here and by
mistake removing move only would break semantics. Additionally, not making this
change breaks the expectation that this API would be idempotent.
Basically the if/else statement of this section of code are unrelated by have
the same condition (albeit inverted). Rather than keep them together and make
them seem as related semantic checks, move the no implicit copy diagnostic into
its own section.

I am doing this as a separate commit partially to slim down the next series of
commits.
…rapper and MarkMustCheck.

Just slimming down a larger commit.
…e in a generic way.

Just so that people do not have to touch operand numbers and potentially make a
mistake.
… take a MoveOnlyWrapped value.

In the future, we may not have this requirement, but for now it is a really
convenient way to track down places in SILGen where I have missed converting
from copyable to moveonlywrapped types.
… copyable_to_moveonlywrapped.

The reason why this is necessary is that the trivial input value doesn't have a
cleanup associated with it, but the result of the instruction is owned. So
otherwise we will not have a cleanup for the result, resulting in an OSSA error.
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@gottesmm gottesmm merged commit 09ed0f1 into swiftlang:main Jul 11, 2022
@gottesmm gottesmm deleted the pr-fce4cec67c5827dcedf3ac25ff0f92b24f6ae193 branch July 11, 2022 22:09
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