blob: efd56ea2dd5423ff6cf8aaa9ee803f80f89f9eea [file] [log] [blame]
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`.