First attempt at removing DropAndReplace#104488
Closed
zeegomo wants to merge 13 commits intorust-lang:masterfrom
Closed
First attempt at removing DropAndReplace#104488zeegomo wants to merge 13 commits intorust-lang:masterfrom
zeegomo wants to merge 13 commits intorust-lang:masterfrom
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First attempt at removing the
DropAndReplaceterminator which complicates things a bit in some cases.Based on zulip/drop-to-drop-if
Eventually, I re-introduced a flag in the
Dropterminator to indicate whether this drop is from a drop and replace operation. This is used mainly for better diagnostic and to check some invariants.Failing UI Tests
Diagnostic underline whole assignment instead of just the left value
ex:
[ui] src/test/ui/borrowck/borrowck-field-sensitivity.rs
[ui] src/test/ui/borrowck/borrowck-issue-48962.rs
[ui] src/test/ui/borrowck/borrowck-loan-of-static-data-issue-27616.rs
[ui] src/test/ui/borrowck/borrowck-partial-reinit-1.rs
[ui] src/test/ui/borrowck/borrowck-partial-reinit-2.rs
[ui] src/test/ui/borrowck/borrowck-partial-reinit-4.rs
[ui] src/test/ui/borrowck/borrowck-vec-pattern-nesting.rs
[ui] src/test/ui/borrowck/index-mut-help.rs
[ui] src/test/ui/borrowck/issue-45199.rs
[ui] src/test/ui/c-variadic/variadic-ffi-4.rs
[ui] src/test/ui/closures/2229_closure_analysis/diagnostics/box.rs
[ui] src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.rs
[ui] src/test/ui/nll/issue-27868.rs
[ui] src/test/ui/object-lifetime/object-lifetime-default-from-box-error.rs
[ui] src/test/ui/regions/regions-infer-paramd-indirect.rs
[ui] src/test/ui/unboxed-closures/unboxed-closures-failed-recursive-fn-1.rs
Replace kills loans on previous value
destructured assignment from drop and replace now kills loans. I don't think it's too big of an issue as the assignment should already trigger the borrowck, but the compiler now reports fewer errors in some cases
[ui] src/test/ui/borrowck/issue-58776-borrowck-scans-children.rs
Also fixes #70919 but I didn't add any regression tests for it, might borrow them from #102078 in a separate PR once this lands