@@ -5,8 +5,9 @@ LL | fn to_fn<A, F: Fn<A>>(f: F) -> F {
5
5
| - change this to accept `FnMut` instead of `Fn`
6
6
...
7
7
LL | let _f = to_fn(|| x = 42);
8
- | ----- ^^^^^^ cannot assign
9
- | |
8
+ | ----- -- ^^^^^^ cannot assign
9
+ | | |
10
+ | | in this closure
10
11
| expects `Fn` instead of `FnMut`
11
12
12
13
error[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 {
16
17
| - change this to accept `FnMut` instead of `Fn`
17
18
...
18
19
LL | let _g = to_fn(|| set(&mut y));
19
- | ----- ^^^^^^ cannot borrow as mutable
20
- | |
20
+ | ----- -- ^^^^^^ cannot borrow as mutable
21
+ | | |
22
+ | | in this closure
21
23
| expects `Fn` instead of `FnMut`
22
24
23
25
error[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 {
27
29
| - change this to accept `FnMut` instead of `Fn`
28
30
...
29
31
LL | to_fn(|| z = 42);
30
- | ----- ^^^^^^ cannot assign
31
- | |
32
+ | ----- -- ^^^^^^ cannot assign
33
+ | | |
34
+ | | in this closure
32
35
| expects `Fn` instead of `FnMut`
33
36
34
37
error[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 {
38
41
| - change this to accept `FnMut` instead of `Fn`
39
42
...
40
43
LL | let _f = to_fn(move || x = 42);
41
- | ----- ^^^^^^ cannot assign
42
- | |
44
+ | ----- ------- ^^^^^^ cannot assign
45
+ | | |
46
+ | | in this closure
43
47
| expects `Fn` instead of `FnMut`
44
48
45
49
error[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 {
49
53
| - change this to accept `FnMut` instead of `Fn`
50
54
...
51
55
LL | let _g = to_fn(move || set(&mut y));
52
- | ----- ^^^^^^ cannot borrow as mutable
53
- | |
56
+ | ----- ------- ^^^^^^ cannot borrow as mutable
57
+ | | |
58
+ | | in this closure
54
59
| expects `Fn` instead of `FnMut`
55
60
56
61
error[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 {
60
65
| - change this to accept `FnMut` instead of `Fn`
61
66
...
62
67
LL | to_fn(move || z = 42);
63
- | ----- ^^^^^^ cannot assign
64
- | |
68
+ | ----- ------- ^^^^^^ cannot assign
69
+ | | |
70
+ | | in this closure
65
71
| expects `Fn` instead of `FnMut`
66
72
67
73
error[E0594]: cannot assign to `x`, as it is a captured variable in a `Fn` closure
0 commit comments