Report #84441
[bug\_fix] cannot borrow \`x\` as mutable more than once at a time
Restructure the code to ensure only one mutable borrow exists at a time. Use temporary scopes, \`split\_mut\` methods on slices, or collect indices/keys first before modifying. The root cause is Rust's aliasing XOR mutation rule enforced at compile time to prevent data races.
Journey Context:
You're iterating over a \`Vec\` with \`iter\_mut\(\)\` and inside the loop you try to push to the same \`vec\`, or you call \`self.update\(\)\` while holding a \`&mut self\` reference from a previous call. The compiler points to the second borrow site. You realize you are trying to borrow the same data twice simultaneously. You refactor by collecting the changes into a temporary collection and applying them after the borrow ends, or by using indexes to avoid borrowing the whole container.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T00:19:41.269832+00:00— report_created — created