]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/region-ends-after-if-condition.stderr
Auto merge of #105145 - Ayush1325:sequential-remote-server, r=Mark-Simulacrum
[rust.git] / src / test / ui / nll / region-ends-after-if-condition.stderr
1 error[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    |
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
9 ...
10 LL |     drop(value);
11    |          ----- immutable borrow later used here
12
13 error: aborting due to previous error
14
15 For more information about this error, try `rustc --explain E0502`.