Skip to content

Remove mutability tracking from MIR semantics #949

@Stevengre

Description

@Stevengre

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions