Rellum Rellum

S0132: cannot borrow as mutable because value is already mutably borrowed

Generated from rellum-diagnostics/src/db.rs.

Explanation

Only one mutable borrow of a place may be live at a time. Two &mut references to the same value would give two writers exclusive access simultaneously.

Common causes

Canonical fixes

Before:

a = &mut buf
b = &mut buf
use_two(a, b)

After:

a = &mut buf
normalize(a)
b = &mut buf

Code example

a = &mut buf
b = &mut buf
use_two(a, b)