Skip to content

Enable moveonly / noncopyable types by default #64106

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 9 commits into from
Mar 15, 2023

Conversation

kavon
Copy link
Member

@kavon kavon commented Mar 4, 2023

This PR brings move-only types (still via @_moveOnly) out from behind the -enable-experimental-move-only flag. We still hold back features like @_noImplicitCopy and _borrow.

resolves rdar://106669967&106314333

@kavon
Copy link
Member Author

kavon commented Mar 5, 2023

@swift-ci please test macos platform

@kavon kavon force-pushed the enable-moveonly-by-default branch 4 times, most recently from 084b639 to 195a219 Compare March 6, 2023 01:20
@kavon
Copy link
Member Author

kavon commented Mar 6, 2023

@swift-ci please smoke test

Copy link
Contributor

@gottesmm gottesmm left a comment

Choose a reason for hiding this comment

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

Found some little issues

@kavon kavon force-pushed the enable-moveonly-by-default branch from 195a219 to 746ab48 Compare March 6, 2023 04:40
@swiftlang swiftlang deleted a comment Mar 6, 2023
@swiftlang swiftlang deleted a comment Mar 6, 2023
@kavon
Copy link
Member Author

kavon commented Mar 6, 2023

@swift-ci please smoke test

@kavon
Copy link
Member Author

kavon commented Mar 10, 2023

@swift-ci smoke test

@kavon kavon force-pushed the enable-moveonly-by-default branch from a223dac to 924064e Compare March 11, 2023 01:19
@kavon
Copy link
Member Author

kavon commented Mar 11, 2023

@swift-ci please test

@kavon
Copy link
Member Author

kavon commented Mar 13, 2023

@swift-ci smoke test

@kavon kavon force-pushed the enable-moveonly-by-default branch from 924064e to 7a8ee06 Compare March 14, 2023 05:06
kavon added 6 commits March 13, 2023 22:39
this pulls just the move checking passes out from
behind the experimental flag.
Also removes some redundant checks in SILGen for
the flag in order to process `_move` and `_borrow`
that are already checked for in Sema. We will keep
those behind the feature flag for now.
Since these types depend on lexical borrow scopes (a SIL
option), we're now making that the requirement whenever
such types appear.
The move checker was converting some kinds of copies
into their `explicit_copy_*` versions, despite the
type of the copy being a copyable type. This was
causing random crashes in some narrow circumstances.

resolves rdar://106669967
These are just basic restrictions for now to help avoid
mistakes. The restrictions are inferred based on how the
move checker uses these instructions.
@kavon kavon force-pushed the enable-moveonly-by-default branch from 7a8ee06 to ac60815 Compare March 14, 2023 05:51
@kavon
Copy link
Member Author

kavon commented Mar 14, 2023

@swift-ci please test

@kavon
Copy link
Member Author

kavon commented Mar 14, 2023

@swift-ci Please Test Source Compatibility

@kavon kavon force-pushed the enable-moveonly-by-default branch 2 times, most recently from a4d0116 to 22472a8 Compare March 15, 2023 01:09
@kavon kavon marked this pull request as ready for review March 15, 2023 01:11
@kavon kavon requested review from gottesmm and jckarter March 15, 2023 01:11
@kavon
Copy link
Member Author

kavon commented Mar 15, 2023

@swift-ci please test

kavon added 2 commits March 14, 2023 18:35
doesn't seem to be a need to skip destroy hoisting
anymore.
the main things still left behind the experimental flag(s) are
- move-only classes (guarded by MoveOnlyClasses feature)
- noimplicitcopy
- the _borrow operator
@kavon kavon force-pushed the enable-moveonly-by-default branch from 22472a8 to 2c7d9a5 Compare March 15, 2023 01:35
@kavon
Copy link
Member Author

kavon commented Mar 15, 2023

@swift-ci please test

@kavon
Copy link
Member Author

kavon commented Mar 15, 2023

@swift-ci Please Test Source Compatibility

@ktoso
Copy link
Contributor

ktoso commented Mar 15, 2023

Wohoo, almost there! 🎉 🎉 🎉

@kavon
Copy link
Member Author

kavon commented Mar 15, 2023

Debug source compat failure is with swift-cluster-membership and doesn't appear to be specific to this PR.

@kavon kavon merged commit a8a44eb into swiftlang:main Mar 15, 2023
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