1 error[E0594]: cannot assign to `n`, as it is not declared as mutable
2 --> $DIR/unboxed-closures-mutate-upvar.rs:25:9
5 | - help: consider changing this to be mutable: `mut n`
6 LL | let mut f = to_fn_mut(|| { //~ ERROR closure cannot assign
10 error[E0594]: cannot assign to `n`, as it is not declared as mutable
11 --> $DIR/unboxed-closures-mutate-upvar.rs:42:9
14 | - help: consider changing this to be mutable: `mut n`
16 LL | n += 1; //~ ERROR cannot assign
17 | ^^^^^^ cannot assign
19 error[E0594]: cannot assign to `n`, as it is not declared as mutable
20 --> $DIR/unboxed-closures-mutate-upvar.rs:56:9
23 | - help: consider changing this to be mutable: `mut n`
24 LL | let mut f = to_fn(move || {
25 LL | n += 1; //~ ERROR cannot assign
26 | ^^^^^^ cannot assign
28 error[E0594]: cannot assign to `n`, as it is a captured variable in a `Fn` closure
29 --> $DIR/unboxed-closures-mutate-upvar.rs:63:9
31 LL | n += 1; //~ ERROR cannot assign
32 | ^^^^^^ cannot assign
34 help: consider changing this to accept closures that implement `FnMut`
35 --> $DIR/unboxed-closures-mutate-upvar.rs:62:23
37 LL | let mut f = to_fn(move || {
38 | _______________________^
39 LL | | n += 1; //~ ERROR cannot assign
43 error: aborting due to 4 previous errors
45 For more information about this error, try `rustc --explain E0594`.