]> git.proxmox.com Git - rustc.git/blob - src/test/ui/closures/2229_closure_analysis/diagnostics/box.stderr
New upstream version 1.55.0+dfsg1
[rustc.git] / src / test / ui / closures / 2229_closure_analysis / diagnostics / box.stderr
1 error[E0506]: cannot assign to `e.0.0.m.x` because it is borrowed
2 --> $DIR/box.rs:21:5
3 |
4 LL | let mut c = || {
5 | -- borrow of `e.0.0.m.x` occurs here
6 LL | e.0.0.m.x = format!("not-x");
7 | --------- borrow occurs due to use in closure
8 ...
9 LL | e.0.0.m.x = format!("not-x");
10 | ^^^^^^^^^ assignment to borrowed `e.0.0.m.x` occurs here
11 LL |
12 LL | c();
13 | - borrow later used here
14
15 error[E0502]: cannot borrow `e.0.0.m.x` as immutable because it is also borrowed as mutable
16 --> $DIR/box.rs:38:20
17 |
18 LL | let mut c = || {
19 | -- mutable borrow occurs here
20 LL | e.0.0.m.x = format!("not-x");
21 | --------- first borrow occurs due to use of `e.0.0.m.x` in closure
22 ...
23 LL | println!("{}", e.0.0.m.x);
24 | ^^^^^^^^^ immutable borrow occurs here
25 LL |
26 LL | c();
27 | - mutable borrow later used here
28
29 error[E0506]: cannot assign to `e.0.0.m.x` because it is borrowed
30 --> $DIR/box.rs:55:5
31 |
32 LL | let c = || {
33 | -- borrow of `e.0.0.m.x` occurs here
34 LL | println!("{}", e.0.0.m.x);
35 | --------- borrow occurs due to use in closure
36 ...
37 LL | e.0.0.m.x = format!("not-x");
38 | ^^^^^^^^^ assignment to borrowed `e.0.0.m.x` occurs here
39 LL |
40 LL | c();
41 | - borrow later used here
42
43 error: aborting due to 3 previous errors
44
45 Some errors have detailed explanations: E0502, E0506.
46 For more information about an error, try `rustc --explain E0502`.