]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unboxed-closures/unboxed-closure-immutable-capture.stderr
Rollup merge of #105843 - compiler-errors:sugg-const, r=lcnr
[rust.git] / src / test / ui / unboxed-closures / unboxed-closure-immutable-capture.stderr
1 error[E0594]: cannot assign to `x`, as it is not declared as mutable
2   --> $DIR/unboxed-closure-immutable-capture.rs:9:13
3    |
4 LL |     let x = 0;
5    |         - help: consider changing this to be mutable: `mut x`
6 LL |     move || x = 1;
7    |             ^^^^^ cannot assign
8
9 error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
10   --> $DIR/unboxed-closure-immutable-capture.rs:10:17
11    |
12 LL |     let x = 0;
13    |         - help: consider changing this to be mutable: `mut x`
14 LL |     move || x = 1;
15 LL |     move || set(&mut x);
16    |                 ^^^^^^ cannot borrow as mutable
17
18 error[E0594]: cannot assign to `x`, as it is not declared as mutable
19   --> $DIR/unboxed-closure-immutable-capture.rs:11:13
20    |
21 LL |     let x = 0;
22    |         - help: consider changing this to be mutable: `mut x`
23 ...
24 LL |     move || x = 1;
25    |             ^^^^^ cannot assign
26
27 error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
28   --> $DIR/unboxed-closure-immutable-capture.rs:12:17
29    |
30 LL |     let x = 0;
31    |         - help: consider changing this to be mutable: `mut x`
32 ...
33 LL |     move || set(&mut x);
34    |                 ^^^^^^ cannot borrow as mutable
35
36 error[E0594]: cannot assign to `x`, as it is not declared as mutable
37   --> $DIR/unboxed-closure-immutable-capture.rs:13:8
38    |
39 LL |     let x = 0;
40    |         - help: consider changing this to be mutable: `mut x`
41 ...
42 LL |     || x = 1;
43    |        ^^^^^ cannot assign
44
45 error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
46   --> $DIR/unboxed-closure-immutable-capture.rs:14:12
47    |
48 LL |     let x = 0;
49    |         - help: consider changing this to be mutable: `mut x`
50 ...
51 LL |     || set(&mut x);
52    |            ^^^^^^ cannot borrow as mutable
53
54 error[E0594]: cannot assign to `x`, as it is not declared as mutable
55   --> $DIR/unboxed-closure-immutable-capture.rs:15:8
56    |
57 LL |     let x = 0;
58    |         - help: consider changing this to be mutable: `mut x`
59 ...
60 LL |     || x = 1;
61    |        ^^^^^ cannot assign
62
63 error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
64   --> $DIR/unboxed-closure-immutable-capture.rs:16:12
65    |
66 LL |     let x = 0;
67    |         - help: consider changing this to be mutable: `mut x`
68 ...
69 LL |     || set(&mut x);
70    |            ^^^^^^ cannot borrow as mutable
71
72 error: aborting due to 8 previous errors
73
74 Some errors have detailed explanations: E0594, E0596.
75 For more information about an error, try `rustc --explain E0594`.