runtimeverification / runtimeverification/mir-semantics

Remove mutability tracking from MIR semantics

Open
#949 1 comment 0 reactions 1 assignee View on GitHub

@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 / mutabilityNot from typedValue and related data structures
  • Unify #forceSetLocal into #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::mutability docs: "Whether this is a mutable binding (i.e., let x or let mut x). Temporaries and the return place are always mutable."

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.