fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

1.40.0
589 B15 linesraw
1error[E0502]: cannot borrow `my_struct.field` as mutable because it is also borrowed as immutable
2  --> $DIR/region-ends-after-if-condition.rs:26:9
3   |
4LL |     let value = &my_struct.field;
5   |                 ---------------- immutable borrow occurs here
6LL |     if value.is_empty() {
7LL |         my_struct.field.push_str("Hello, world!");
8   |         ^^^^^^^^^^^^^^^ mutable borrow occurs here
9...
10LL |     drop(value);
11   |          ----- immutable borrow later used here
12
13error: aborting due to previous error
14
15For more information about this error, try `rustc --explain E0502`.