fork/rust

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

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

master
860 B21 linesraw
1error[E0502]: cannot borrow `p` as immutable because it is also borrowed as mutable
2  --> $DIR/simple-struct-min-capture.rs:22:22
3   |
4LL |     let mut c = || {
5   |                 -- mutable borrow occurs here
6LL |         p.x += 10;
7   |         --- capture is mutable because of use here
8LL |         println!("{:?}", p);
9   |                          - first borrow occurs due to use of `p` in closure
10...
11LL |     println!("{:?}", p);
12   |                      ^ immutable borrow occurs here
13LL |
14LL |     c();
15   |     - mutable borrow later used here
16   |
17   = 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)
18
19error: aborting due to previous error
20
21For more information about this error, try `rustc --explain E0502`.