Allow partially moved values in match#103208
Conversation
|
This PR changes MIR cc @oli-obk, @RalfJung, @JakobDegen, @davidtwco, @celinval, @vakaras |
|
r? @eholk (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
26bd3da to
1573932
Compare
|
Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri Some changes occurred in src/tools/clippy cc @rust-lang/clippy Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 |
1573932 to
3872a79
Compare
|
On the What happens there when it's more than just an ascription because it's a coercion site? For example, I guess that the coercion becomes an explicit statement in MIR, so that would still be rejected even though the |
|
I'm probably not the best person to review this, so I'll re-roll. r? @rust-lang/compiler |
|
☔ The latest upstream changes (presumably #103787) made this pull request unmergeable. Please resolve the merge conflicts. |
3872a79 to
1156aff
Compare
|
☔ The latest upstream changes (presumably #103138) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Triage: This is still waiting on #102256 |
1156aff to
79f4692
Compare
|
The Miri subtree was changed cc @rust-lang/miri |
5954b58 to
3ec03f5
Compare
|
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
|
The Miri tests LGTM. @oli-obk wrote
but that was in May. Oli if you could briefly skim this again to make sure it still looks good to you that would be great. :) |
|
Did another review of the impl and mir opt test changes. Nothing in mir or mir building has changed that would affect these changes, and they look good to me (I don't remember them from the last review, so this was a review from scratch 😅) @bors r=oli-obk,RalfJung |
|
☀️ Test successful - checks-actions |
|
Finished benchmarking commit (59bb950): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 635.347s -> 636.148s (0.13%) |
|
It took more than a year, but it's finally done. :) Thanks a lot @cjgillot for seeing this through to the end! |
|
Should we add
relnotes
|
|
Sure, why not. |
This PR attempts to unify the behaviour between
let _ = PLACE,let _: TY = PLACE;andmatch PLACE { _ => {} }.The logical conclusion is that the
matchversion should not check for uninitialised places nor check that borrows are still live.The
match PLACE {}case is handled by keeping aFakeReadin the unreachable fallback case to verify thatPLACEhas a legal value.Schematically,
match PLACE { arms }in surface rust becomes in MIR:match *borrow { _ => {} }continues to check that*borrowis live, but does not read the value.match *borrow {}both checks that*borrowis live, and fake-reads the value.Continuation of
#102256#104844Fixes #99180 #53114