1 error[E0594]: cannot assign to `x`, as it is not declared as mutable
2 --> $DIR/closure-captures.rs:7: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:9: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:15: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:19: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:27:9
40 LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
41 | - change this to accept `FnMut` instead of `Fn`
44 | ------ -- in this closure
46 | expects `Fn` instead of `FnMut`
48 | ^^ cannot borrow as mutable
50 | - mutable borrow occurs due to use of `x` in closure
52 error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
53 --> $DIR/closure-captures.rs:31:9
55 LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
56 | - change this to accept `FnMut` instead of `Fn`
59 | ------ ------- in this closure
61 | expects `Fn` instead of `FnMut`
63 | ^^ cannot borrow as mutable
65 | - mutable borrow occurs due to use of `x` in closure
67 error[E0594]: cannot assign to `x`, as it is not declared as mutable
68 --> $DIR/closure-captures.rs:39:10
70 LL | fn two_closures_ref(x: i32) {
71 | - help: consider changing this to be mutable: `mut x`
76 error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
77 --> $DIR/closure-captures.rs:38:9
79 LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
80 | - change this to accept `FnMut` instead of `Fn`
83 | ------ -- in this closure
85 | expects `Fn` instead of `FnMut`
87 | ^^ cannot borrow as mutable
89 | - mutable borrow occurs due to use of `x` in closure
91 error[E0594]: cannot assign to `x`, as it is not declared as mutable
92 --> $DIR/closure-captures.rs:43:5
94 LL | fn two_closures_ref(x: i32) {
95 | - help: consider changing this to be mutable: `mut x`
100 error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
101 --> $DIR/closure-captures.rs:42:9
103 LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
104 | - change this to accept `FnMut` instead of `Fn`
106 LL | fn_ref(move || {
107 | ------ ------- in this closure
109 | expects `Fn` instead of `FnMut`
111 | ^^ cannot borrow as mutable
113 | - mutable borrow occurs due to use of `x` in closure
115 error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
116 --> $DIR/closure-captures.rs:48:9
118 LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
119 | - change this to accept `FnMut` instead of `Fn`
122 | ------ -- in this closure
124 | expects `Fn` instead of `FnMut`
126 | ^^ cannot borrow as mutable
128 | -- mutable borrow occurs due to use of `x` in closure
130 error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
131 --> $DIR/closure-captures.rs:51:9
133 LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
134 | - change this to accept `FnMut` instead of `Fn`
136 LL | fn_ref(move || {
137 | ------ ------- in this closure
139 | expects `Fn` instead of `FnMut`
141 | ^^ cannot borrow as mutable
143 | -- mutable borrow occurs due to use of `x` in closure
145 error: aborting due to 12 previous errors
147 Some errors have detailed explanations: E0594, E0596.
148 For more information about an error, try `rustc --explain E0594`.