runtimeverification / runtimeverification/mir-semantics
Remove mutability tracking from MIR semantics
@Stevengre is already working on this.
Since Feb 26, 2026.
- Dominant language
- Python
- Stars
- 52
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
Motivation
PR #948 removed the mutabilityOf(...) ==K mutabilityMut guard from #setLocalValue, because MIR's LocalDecl::mutability is a source-level annotation (let x vs let mut x), not an assignment constraint. The Rust compiler's borrow checker validates assignment legality before emitting MIR, so all assignments in well-formed MIR are valid regardless of the mutability field.
After #948, #forceSetLocal is functionally identical to #setLocalValue — both write without checking mutability.
Proposal
Remove mutability tracking from the MIR semantics definition entirely:
- Remove
mutabilityMut/mutabilityNotfromtypedValueand related data structures - Unify
#forceSetLocalinto#setLocalValue(or remove#forceSetLocal) - Clean up any remaining mutability checks or propagation throughout the codebase
References
- PR #948:
fix(rt): remove mutability guard on local variable assignment LocalDecl::mutabilitydocs: "Whether this is a mutable binding (i.e.,let xorlet mut x). Temporaries and the return place are always mutable."
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.