1 error[E0502]: cannot borrow `my_struct.field` as mutable because it is also borrowed as immutable (Ast)
2 --> $DIR/region-ends-after-if-condition.rs:29:9
4 LL | let value = &my_struct.field;
5 | --------------- immutable borrow occurs here
6 LL | if value.is_empty() {
7 LL | my_struct.field.push_str("Hello, world!");
8 | ^^^^^^^^^^^^^^^ mutable borrow occurs here
11 | - immutable borrow ends here
13 error[E0502]: cannot borrow `my_struct.field` as mutable because it is also borrowed as immutable (Ast)
14 --> $DIR/region-ends-after-if-condition.rs:39:9
16 LL | let value = &my_struct.field;
17 | --------------- immutable borrow occurs here
18 LL | if value.is_empty() {
19 LL | my_struct.field.push_str("Hello, world!");
20 | ^^^^^^^^^^^^^^^ mutable borrow occurs here
23 | - immutable borrow ends here
25 error[E0502]: cannot borrow `my_struct.field` as mutable because it is also borrowed as immutable (Mir)
26 --> $DIR/region-ends-after-if-condition.rs:39:9
28 LL | let value = &my_struct.field;
29 | ---------------- immutable borrow occurs here
30 LL | if value.is_empty() {
31 LL | my_struct.field.push_str("Hello, world!");
32 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here
35 | ----- borrow later used here
37 error: aborting due to 3 previous errors
39 For more information about this error, try `rustc --explain E0502`.