-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[5.9][borrowing][consuming] Make borrowing and consuming no implicit copy parameters #66388
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
[5.9][borrowing][consuming] Make borrowing and consuming no implicit copy parameters #66388
Conversation
@swift-ci test |
I think I messed up the merge conflicts when I cherry-picked. |
… functions. (cherry picked from commit cbb9e15)
…() instead of getASTType() to prevent us from looking through no implicit copy types while serializing. This change makes sense since, in general, when serializing we do not want to look through no implicit copy types since we are trying to 1-1 preserve the SIL. (cherry picked from commit f88fa66)
…h the AST serialization machinery. This looks like a thinko from the early part of the implementation. Without this, the machinery doesn't recognize the layout and just asserts. (cherry picked from commit 508866a)
…uming/Borrowing. I also added a static_assert to make sure that we always catch this in the future. (cherry picked from commit 76374f8)
…e_addr. The reason why I am using a different instruction for addresses and objects here is that the object checker doesnt have to deal with things like initialization. (cherry picked from commit 43f42e2) Conflicts: lib/SIL/Verifier/SILVerifier.cpp lib/Serialization/ModuleFormat.h test/SIL/Parser/basic2.sil
…lywrapper_addr. Just the $*T -> $*@moveOnly T variant for addresses. Unlike the object version this acts like a cast rather than something that provides semantics from the frontend to the optimizer. (cherry picked from commit 611e676)
…r_to_copyable_addr. (cherry picked from commit 68fd68b)
(cherry picked from commit 65a9ba4)
I am going to use this to unwrap ${ @moveOnly T } so that I can pass it to partial_apply that expect a ${ T } (cherry picked from commit 70ab38d) Conflicts: lib/SIL/IR/SILType.cpp lib/Serialization/ModuleFormat.h test/SIL/Parser/basic2.sil
We were not properly propagating along cleanups in SILGenProlog. I went through SILGenProlog and fixed this. rdar://109287977 (cherry picked from commit 42b4b9a)
Found the problem. I was missing a commit from main and I also messed up one of the merge conflicts. |
…a noimplicitcopy type. rdar://108383660 (cherry picked from commit 59c8cff)
57f4b0e
to
72cd7c5
Compare
@swift-ci test |
…ith -sil-verify-all by default.
…pes. This was not caught on main since I wasn't the tests with -sil-verify-all enabled... but it seems that it was caught by the verifier on 5.9. I have since enabled sil-verify-all by default on both of those tests (noimplicitcopy_consuming_parameter.swift and noimplicitcopy_borrowing_parameter.swift).
@swift-ci test |
@swift-ci test macOS platform |
the macOS test failure was due to the infamous cxxinterop Darwin bug. |
@swift-ci clean test macOS platform |
Just hit the Darwin error again... |
@swift-ci clean test macOS platform |
I don't know why the clean test isn't working... |
@swift-ci test macOS platform |
@swift-ci smoke test macOS platform |
I think the little trick I just did got my macOS full test on a different machine. Hopefully it works now and does a clean build. |
All commits but 617fd26
• Description: [borrowing/consuming] Make borrowing and consuming parameters no implicit copy types.
• Risk: Low risk. Only affects code which uses borrowing/consuming parameters (which is only new code).
• Original PR: #66381
• Reviewed By: @jckarter
• Testing: I added lots of tests for both diagnostics/code generation/and an interpreter test for code measure.
• Resolves: rdar://108383660
Commit 617fd26
• Description: [move-only] Fix class setters of address only move only types.
• Risk: Low risk. Only affects code using noncopyable types.
• Original PR: #66255
• Reviewed By: @jckarter
• Testing: I added a diagnostic test that showed we didn't error and also a SILGen test
• Resolves: rdar://109287977
Commit 98cbeec
• Description: [borrowing/consuming] Be sure to visit boxes with trivial moveonly types.
• Risk: Low risk. Only affects code using noncopyable types.
• Original PR: #66402
• Reviewed By: @atrick
• Testing: I added sil-verify-all to the test that exposed this and validated that we no longer crashed.
• Resolves: rdar://110364874