@@ -5,8 +5,9 @@ LL | fn to_fn<A, F: Fn<A>>(f: F) -> F {
55 | - change this to accept `FnMut` instead of `Fn`
66...
77LL | let _f = to_fn(|| x = 42);
8- | ----- ^^^^^^ cannot assign
9- | |
8+ | ----- -- ^^^^^^ cannot assign
9+ | | |
10+ | | in this closure
1011 | expects `Fn` instead of `FnMut`
1112
1213error[E0596]: cannot borrow `y` as mutable, as it is a captured variable in a `Fn` closure
@@ -16,8 +17,9 @@ LL | fn to_fn<A, F: Fn<A>>(f: F) -> F {
1617 | - change this to accept `FnMut` instead of `Fn`
1718...
1819LL | let _g = to_fn(|| set(&mut y));
19- | ----- ^^^^^^ cannot borrow as mutable
20- | |
20+ | ----- -- ^^^^^^ cannot borrow as mutable
21+ | | |
22+ | | in this closure
2123 | expects `Fn` instead of `FnMut`
2224
2325error[E0594]: cannot assign to `z`, as it is a captured variable in a `Fn` closure
@@ -27,8 +29,9 @@ LL | fn to_fn<A, F: Fn<A>>(f: F) -> F {
2729 | - change this to accept `FnMut` instead of `Fn`
2830...
2931LL | to_fn(|| z = 42);
30- | ----- ^^^^^^ cannot assign
31- | |
32+ | ----- -- ^^^^^^ cannot assign
33+ | | |
34+ | | in this closure
3235 | expects `Fn` instead of `FnMut`
3336
3437error[E0594]: cannot assign to `x`, as it is a captured variable in a `Fn` closure
@@ -38,8 +41,9 @@ LL | fn to_fn<A, F: Fn<A>>(f: F) -> F {
3841 | - change this to accept `FnMut` instead of `Fn`
3942...
4043LL | let _f = to_fn(move || x = 42);
41- | ----- ^^^^^^ cannot assign
42- | |
44+ | ----- ------- ^^^^^^ cannot assign
45+ | | |
46+ | | in this closure
4347 | expects `Fn` instead of `FnMut`
4448
4549error[E0596]: cannot borrow `y` as mutable, as it is a captured variable in a `Fn` closure
@@ -49,8 +53,9 @@ LL | fn to_fn<A, F: Fn<A>>(f: F) -> F {
4953 | - change this to accept `FnMut` instead of `Fn`
5054...
5155LL | let _g = to_fn(move || set(&mut y));
52- | ----- ^^^^^^ cannot borrow as mutable
53- | |
56+ | ----- ------- ^^^^^^ cannot borrow as mutable
57+ | | |
58+ | | in this closure
5459 | expects `Fn` instead of `FnMut`
5560
5661error[E0594]: cannot assign to `z`, as it is a captured variable in a `Fn` closure
@@ -60,8 +65,9 @@ LL | fn to_fn<A, F: Fn<A>>(f: F) -> F {
6065 | - change this to accept `FnMut` instead of `Fn`
6166...
6267LL | to_fn(move || z = 42);
63- | ----- ^^^^^^ cannot assign
64- | |
68+ | ----- ------- ^^^^^^ cannot assign
69+ | | |
70+ | | in this closure
6571 | expects `Fn` instead of `FnMut`
6672
6773error[E0594]: cannot assign to `x`, as it is a captured variable in a `Fn` closure
0 commit comments