fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.7 KiB48 linesraw
1error[E0506]: cannot assign to `e.0.0.m.x` because it is borrowed
2  --> $DIR/box.rs:21:5
3   |
4LL |     let mut c = || {
5   |                 -- `e.0.0.m.x` is borrowed here
6LL |         e.0.0.m.x = format!("not-x");
7   |         --------- borrow occurs due to use in closure
8...
9LL |     e.0.0.m.x = format!("not-x");
10   |     ^^^^^^^^^ `e.0.0.m.x` is assigned to here but it was already borrowed
11LL |
12LL |     c();
13   |     - borrow later used here
14
15error[E0502]: cannot borrow `e.0.0.m.x` as immutable because it is also borrowed as mutable
16  --> $DIR/box.rs:38:20
17   |
18LL |     let mut c = || {
19   |                 -- mutable borrow occurs here
20LL |         e.0.0.m.x = format!("not-x");
21   |         --------- first borrow occurs due to use of `e.0.0.m.x` in closure
22...
23LL |     println!("{}", e.0.0.m.x);
24   |                    ^^^^^^^^^ immutable borrow occurs here
25LL |
26LL |     c();
27   |     - mutable borrow later used here
28   |
29   = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
30
31error[E0506]: cannot assign to `e.0.0.m.x` because it is borrowed
32  --> $DIR/box.rs:55:5
33   |
34LL |     let c = || {
35   |             -- `e.0.0.m.x` is borrowed here
36LL |         println!("{}", e.0.0.m.x);
37   |                        --------- borrow occurs due to use in closure
38...
39LL |     e.0.0.m.x = format!("not-x");
40   |     ^^^^^^^^^ `e.0.0.m.x` is assigned to here but it was already borrowed
41LL |
42LL |     c();
43   |     - borrow later used here
44
45error: aborting due to 3 previous errors
46
47Some errors have detailed explanations: E0502, E0506.
48For more information about an error, try `rustc --explain E0502`.