1 error[E0594]: cannot assign to `x`, as it is not declared as mutable
2 --> $DIR/closure-captures.rs:20:5
4 LL | fn one_closure(x: i32) {
5 | - help: consider changing this to be mutable: `mut x`
10 error[E0594]: cannot assign to `x`, as it is not declared as mutable
11 --> $DIR/closure-captures.rs:22:5
13 LL | fn one_closure(x: i32) {
14 | - help: consider changing this to be mutable: `mut x`
19 error[E0594]: cannot assign to `x`, as it is not declared as mutable
20 --> $DIR/closure-captures.rs:28:9
22 LL | fn two_closures(x: i32) {
23 | - help: consider changing this to be mutable: `mut x`
28 error[E0594]: cannot assign to `x`, as it is not declared as mutable
29 --> $DIR/closure-captures.rs:32:9
31 LL | fn two_closures(x: i32) {
32 | - help: consider changing this to be mutable: `mut x`
37 error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
38 --> $DIR/closure-captures.rs:40:9
41 | ^^ cannot borrow as mutable
43 | - mutable borrow occurs due to use of `x` in closure
45 help: consider changing this to accept closures that implement `FnMut`
46 --> $DIR/closure-captures.rs:39:12
54 error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
55 --> $DIR/closure-captures.rs:44:9
58 | ^^ cannot borrow as mutable
60 | - mutable borrow occurs due to use of `x` in closure
62 help: consider changing this to accept closures that implement `FnMut`
63 --> $DIR/closure-captures.rs:43:12
71 error[E0594]: cannot assign to `x`, as it is not declared as mutable
72 --> $DIR/closure-captures.rs:52:10
74 LL | fn two_closures_ref(x: i32) {
75 | - help: consider changing this to be mutable: `mut x`
77 LL | x = 1;} //~ ERROR
80 error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
81 --> $DIR/closure-captures.rs:51:9
84 | ^^ cannot borrow as mutable
85 LL | x = 1;} //~ ERROR
86 | - mutable borrow occurs due to use of `x` in closure
88 help: consider changing this to accept closures that implement `FnMut`
89 --> $DIR/closure-captures.rs:50:12
94 LL | | x = 1;} //~ ERROR
97 error[E0594]: cannot assign to `x`, as it is not declared as mutable
98 --> $DIR/closure-captures.rs:56:5
100 LL | fn two_closures_ref(x: i32) {
101 | - help: consider changing this to be mutable: `mut x`
103 LL | x = 1;}); //~ ERROR
104 | ^^^^^ cannot assign
106 error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
107 --> $DIR/closure-captures.rs:55:9
110 | ^^ cannot borrow as mutable
111 LL | x = 1;}); //~ ERROR
112 | - mutable borrow occurs due to use of `x` in closure
114 help: consider changing this to accept closures that implement `FnMut`
115 --> $DIR/closure-captures.rs:54:12
117 LL | fn_ref(move || {
120 LL | | x = 1;}); //~ ERROR
123 error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
124 --> $DIR/closure-captures.rs:61:9
127 | ^^ cannot borrow as mutable
129 | - mutable borrow occurs due to use of `x` in closure
131 help: consider changing this to accept closures that implement `FnMut`
132 --> $DIR/closure-captures.rs:60:12
140 error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
141 --> $DIR/closure-captures.rs:64:9
144 | ^^ cannot borrow as mutable
146 | - mutable borrow occurs due to use of `x` in closure
148 help: consider changing this to accept closures that implement `FnMut`
149 --> $DIR/closure-captures.rs:63:12
151 LL | fn_ref(move || {
157 error: aborting due to 12 previous errors
159 Some errors occurred: E0594, E0596.
160 For more information about an error, try `rustc --explain E0594`.