error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Ast) --> $DIR/get_default.rs:33:17 | 28 | match map.get() { | --- immutable borrow occurs here ... 33 | map.set(String::new()); // Just AST errors here | ^^^ mutable borrow occurs here ... 38 | } | - immutable borrow ends here error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Ast) --> $DIR/get_default.rs:44:17 | 42 | match map.get() { | --- immutable borrow occurs here 43 | Some(v) => { 44 | map.set(String::new()); // Both AST and MIR error here | ^^^ mutable borrow occurs here ... 55 | } | - immutable borrow ends here error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Ast) --> $DIR/get_default.rs:50:17 | 42 | match map.get() { | --- immutable borrow occurs here ... 50 | map.set(String::new()); // Just AST errors here | ^^^ mutable borrow occurs here ... 55 | } | - immutable borrow ends here error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Mir) --> $DIR/get_default.rs:44:17 | 42 | match map.get() { | --- immutable borrow occurs here 43 | Some(v) => { 44 | map.set(String::new()); // Both AST and MIR error here | ^^^ mutable borrow occurs here ... 47 | return v; | - borrow later used here error: aborting due to 4 previous errors