summaryrefslogtreecommitdiffstats
path: root/src/test/ui/nll/return_from_loop.stderr
blob: bd2b8b158598ab559c846c4ac13c88800dec28bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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`.