1 error[E0594]: cannot assign to `x`, as it is a captured variable in a `Fn` closure
2 --> $DIR/borrow-immutable-upvar-mutation.rs:15:27
4 LL | let _f = to_fn(|| x = 42);
7 help: consider changing this to accept closures that implement `FnMut`
8 --> $DIR/borrow-immutable-upvar-mutation.rs:15:24
10 LL | let _f = to_fn(|| x = 42);
13 error[E0596]: cannot borrow `y` as mutable, as it is a captured variable in a `Fn` closure
14 --> $DIR/borrow-immutable-upvar-mutation.rs:18:31
16 LL | let _g = to_fn(|| set(&mut y));
17 | ^^^^^^ cannot borrow as mutable
19 help: consider changing this to accept closures that implement `FnMut`
20 --> $DIR/borrow-immutable-upvar-mutation.rs:18:24
22 LL | let _g = to_fn(|| set(&mut y));
25 error[E0594]: cannot assign to `z`, as it is a captured variable in a `Fn` closure
26 --> $DIR/borrow-immutable-upvar-mutation.rs:21:55
28 LL | let _h = to_fn_mut(|| { set(&mut z); to_fn(|| z = 42); });
29 | ^^^^^^ cannot assign
31 help: consider changing this to accept closures that implement `FnMut`
32 --> $DIR/borrow-immutable-upvar-mutation.rs:21:52
34 LL | let _h = to_fn_mut(|| { set(&mut z); to_fn(|| z = 42); });
37 error[E0594]: cannot assign to `x`, as it is a captured variable in a `Fn` closure
38 --> $DIR/borrow-immutable-upvar-mutation.rs:27:32
40 LL | let _f = to_fn(move || x = 42);
41 | ^^^^^^ cannot assign
43 help: consider changing this to accept closures that implement `FnMut`
44 --> $DIR/borrow-immutable-upvar-mutation.rs:27:24
46 LL | let _f = to_fn(move || x = 42);
49 error[E0596]: cannot borrow `y` as mutable, as it is a captured variable in a `Fn` closure
50 --> $DIR/borrow-immutable-upvar-mutation.rs:30:36
52 LL | let _g = to_fn(move || set(&mut y));
53 | ^^^^^^ cannot borrow as mutable
55 help: consider changing this to accept closures that implement `FnMut`
56 --> $DIR/borrow-immutable-upvar-mutation.rs:30:24
58 LL | let _g = to_fn(move || set(&mut y));
61 error[E0594]: cannot assign to `z`, as it is a captured variable in a `Fn` closure
62 --> $DIR/borrow-immutable-upvar-mutation.rs:33:65
64 LL | let _h = to_fn_mut(move || { set(&mut z); to_fn(move || z = 42); });
65 | ^^^^^^ cannot assign
67 help: consider changing this to accept closures that implement `FnMut`
68 --> $DIR/borrow-immutable-upvar-mutation.rs:33:57
70 LL | let _h = to_fn_mut(move || { set(&mut z); to_fn(move || z = 42); });
73 error: aborting due to 6 previous errors
75 Some errors have detailed explanations: E0594, E0596.
76 For more information about an error, try `rustc --explain E0594`.