Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Summary
interior-mut-fail.rsshould pass under rustc, but KMIR failed on the secondRefCell::borrow_mut()by reachingpanic_already_borrowed(noBody).The root cause was not
RefCellwriteback. It was that KMIR still treated MIRDropterminators as no-ops, and the pre-proof SMIR reduction also discardeddrop_in_place::<...>bodies becauseDropwas not modeled as a reachability edge.This PR fixes that in two steps:
Drop-based edges tocall_edgesDropterminators through the normal call path using reachabledrop_in_place::<T>bodiesAfter that, the temporary
RefMutguard from the firstborrow_mut()is actually dropped, the borrow flag is released, andinterior-mutpasses.Commit guide
fix(kmir): execute drop glue for drop terminatorsThis adds the semantic fix and renames
interior-mut-fail.rstointerior-mut.rs, with an intermediate show output proving the case now reaches#EndProgram.test(kmir): drop redundant interior-mut show outputThis removes that temporary show output once it no longer carries diagnostic value.
Validation
make builduv run pytest src/tests/integration/test_integration.py -v --timeout=600 -k 'interior-mut or interior-mut3-fail'interior-mut.mainpassesinterior-mut3-fail.mainstill fails with the existing misaligned-pointer issueNotes
I also attempted a local
make test-integrationrun after wiringdeps/stable-mir-jsoninto the worktree. It started cleanly, but I did not wait for the full suite to complete locally.