You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: kmir/src/kmir/kdist/mir-semantics/rt/data.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -177,21 +177,23 @@ In contrast to regular write operations, the value does not have to be _mutable_
177
177
### Setting Local Variables
178
178
179
179
The `#setLocalValue` operation writes a `Value` value to a given `Place` within the `List` of local variables currently on top of the stack.
180
-
This may fail because a local may not be accessible or not mutable.
181
180
If we are setting a value at a `Place` which has `Projection`s in it, then we must first traverse the projections before setting the value.
182
181
A variant `#forceSetLocal` is provided for setting the local value without checking the mutability of the location.
183
182
183
+
**Note on mutability:** The Rust compiler validates assignment legality and may reuse immutable locals in MIR (e.g., loop variables), so `#setLocalValue` does not guard on mutability.
184
+
185
+
TODO: `#forceSetLocal` is now functionally identical to `#setLocalValue` and may be removed.
0 commit comments