1 error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Ast)
2 --> $DIR/get_default.rs:33:17
5 | --- immutable borrow occurs here
7 LL | map.set(String::new()); // Ideally, this would not error.
8 | ^^^ mutable borrow occurs here
11 | - immutable borrow ends here
13 error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Ast)
14 --> $DIR/get_default.rs:45:17
16 LL | match map.get() {
17 | --- immutable borrow occurs here
19 LL | map.set(String::new()); // Both AST and MIR error here
20 | ^^^ mutable borrow occurs here
23 | - immutable borrow ends here
25 error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Ast)
26 --> $DIR/get_default.rs:51:17
28 LL | match map.get() {
29 | --- immutable borrow occurs here
31 LL | map.set(String::new()); // Ideally, just AST would error here
32 | ^^^ mutable borrow occurs here
35 | - immutable borrow ends here
37 error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Mir)
38 --> $DIR/get_default.rs:33:17
40 LL | match map.get() {
41 | --- immutable borrow occurs here
43 LL | map.set(String::new()); // Ideally, this would not error.
44 | ^^^ mutable borrow occurs here
46 note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 26:1...
47 --> $DIR/get_default.rs:26:1
49 LL | / fn ok(map: &mut Map) -> &String {
51 LL | | match map.get() {
58 error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Mir)
59 --> $DIR/get_default.rs:45:17
61 LL | match map.get() {
62 | --- immutable borrow occurs here
64 LL | map.set(String::new()); // Both AST and MIR error here
65 | ^^^ mutable borrow occurs here
68 | - borrow later used here
70 error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Mir)
71 --> $DIR/get_default.rs:51:17
73 LL | match map.get() {
74 | --- immutable borrow occurs here
76 LL | map.set(String::new()); // Ideally, just AST would error here
77 | ^^^ mutable borrow occurs here
79 note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 41:1...
80 --> $DIR/get_default.rs:41:1
82 LL | / fn err(map: &mut Map) -> &String {
84 LL | | match map.get() {
91 error: aborting due to 6 previous errors
93 For more information about this error, try `rustc --explain E0502`.