1 This error indicates that you are trying to borrow a variable as mutable when it
2 has already been borrowed as immutable.
4 Erroneous code example:
9 let ref y = a; // a is borrowed as immutable.
10 bar(a); // error: cannot borrow `*a` as mutable because `a` is also borrowed
16 To fix this error, ensure that you don't have any other references to the
17 variable before trying to access it mutably:
20 fn bar(x: &mut i32) {}
28 For more information on the rust ownership system, take a look at
29 https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html.