]> git.proxmox.com Git - rustc.git/blob - src/test/ui/nll/return_from_loop.stderr
Update upstream source from tag 'upstream/1.31.0_beta.4+dfsg1'
[rustc.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 (Ast)
2 --> $DIR/return_from_loop.rs:32: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 ...
10 LL | }
11 | - first borrow ends here
12
13 error[E0499]: cannot borrow `my_struct.field` as mutable more than once at a time (Ast)
14 --> $DIR/return_from_loop.rs:45:9
15 |
16 LL | let value = &mut my_struct.field;
17 | --------------- first mutable borrow occurs here
18 LL | loop {
19 LL | my_struct.field.push_str("Hello, world!");
20 | ^^^^^^^^^^^^^^^ second mutable borrow occurs here
21 ...
22 LL | }
23 | - first borrow ends here
24
25 error[E0499]: cannot borrow `my_struct.field` as mutable more than once at a time (Mir)
26 --> $DIR/return_from_loop.rs:32:9
27 |
28 LL | let value = &mut my_struct.field;
29 | -------------------- first mutable borrow occurs here
30 LL | loop {
31 LL | my_struct.field.push_str("Hello, world!");
32 | ^^^^^^^^^^^^^^^ second mutable borrow occurs here
33 ...
34 LL | value.len();
35 | ----- first borrow later used here
36
37 error: aborting due to 3 previous errors
38
39 For more information about this error, try `rustc --explain E0499`.