]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/closure-use-spans.stderr
Auto merge of #105145 - Ayush1325:sequential-remote-server, r=Mark-Simulacrum
[rust.git] / src / test / ui / nll / closure-use-spans.stderr
1 error[E0506]: cannot assign to `x` because it is borrowed
2   --> $DIR/closure-use-spans.rs:5:5
3    |
4 LL |     let y = &x;
5    |             -- borrow of `x` occurs here
6 LL |     x = 0;
7    |     ^^^^^ assignment to borrowed `x` occurs here
8 LL |     || *y;
9    |        -- borrow later captured here by closure
10
11 error[E0506]: cannot assign to `x` because it is borrowed
12   --> $DIR/closure-use-spans.rs:11:5
13    |
14 LL |     let y = &mut x;
15    |             ------ borrow of `x` occurs here
16 LL |     x = 0;
17    |     ^^^^^ assignment to borrowed `x` occurs here
18 LL |     || *y = 1;
19    |        -- borrow later captured here by closure
20
21 error[E0506]: cannot assign to `x` because it is borrowed
22   --> $DIR/closure-use-spans.rs:17:5
23    |
24 LL |     let y = &x;
25    |             -- borrow of `x` occurs here
26 LL |     x = 0;
27    |     ^^^^^ assignment to borrowed `x` occurs here
28 LL |     move || *y;
29    |             -- borrow later captured here by closure
30
31 error: aborting due to 3 previous errors
32
33 For more information about this error, try `rustc --explain E0506`.