-
Notifications
You must be signed in to change notification settings - Fork 5
Open
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 fix(rt): remove mutability guard on local variable assignment #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."
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels