]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/return_from_loop.stderr
Rollup merge of #105216 - GuillaumeGomez:rm-unused-gui-test, r=notriddle
[rust.git] / src / test / ui / nll / return_from_loop.stderr
1 error[E0499]: cannot borrow `my_struct.field` as mutable more than once at a time
2   --> $DIR/return_from_loop.rs:20:9
3    |
4 LL |     let value = &mut my_struct.field;
5    |                 -------------------- first mutable borrow occurs here
6 LL |     loop {
7 LL |         my_struct.field.push_str("Hello, world!");
8    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
9 LL |
10 LL |         value.len();
11    |         ----------- first borrow later used here
12
13 error: aborting due to previous error
14
15 For more information about this error, try `rustc --explain E0499`.