error[E0499]: cannot borrow `my_struct.field` as mutable more than once at a time | |
--> $DIR/return_from_loop.rs:20:9 | |
| | |
LL | let value = &mut my_struct.field; | |
| -------------------- first mutable borrow occurs here | |
LL | loop { | |
LL | my_struct.field.push_str("Hello, world!"); | |
| ^^^^^^^^^^^^^^^ second mutable borrow occurs here | |
LL | | |
LL | value.len(); | |
| ----- first borrow later used here | |
error: aborting due to previous error | |
For more information about this error, try `rustc --explain E0499`. |