1
1
error[E0499]: cannot borrow `*f` as mutable more than once at a time
2
- --> $DIR/two-phase-nonrecv-autoref.rs:50 :11
2
+ --> $DIR/two-phase-nonrecv-autoref.rs:51 :11
3
3
|
4
4
LL | f(f(10));
5
5
| - ^ second mutable borrow occurs here
@@ -8,7 +8,7 @@ LL | f(f(10));
8
8
| first borrow later used by call
9
9
10
10
error[E0382]: use of moved value: `f`
11
- --> $DIR/two-phase-nonrecv-autoref.rs:57 :11
11
+ --> $DIR/two-phase-nonrecv-autoref.rs:58 :11
12
12
|
13
13
LL | fn twice_ten_so<F: FnOnce(i32) -> i32>(f: Box<F>) {
14
14
| - move occurs because `f` has type `Box<F>`, which does not implement the `Copy` trait
@@ -18,7 +18,7 @@ LL | f(f(10));
18
18
| value moved here
19
19
20
20
error[E0499]: cannot borrow `*f` as mutable more than once at a time
21
- --> $DIR/two-phase-nonrecv-autoref.rs:62 :11
21
+ --> $DIR/two-phase-nonrecv-autoref.rs:63 :11
22
22
|
23
23
LL | f(f(10));
24
24
| - ^ second mutable borrow occurs here
@@ -27,7 +27,7 @@ LL | f(f(10));
27
27
| first borrow later used by call
28
28
29
29
error[E0382]: use of moved value: `f`
30
- --> $DIR/two-phase-nonrecv-autoref.rs:69 :11
30
+ --> $DIR/two-phase-nonrecv-autoref.rs:70 :11
31
31
|
32
32
LL | fn twice_ten_oo(f: Box<dyn FnOnce(i32) -> i32>) {
33
33
| - move occurs because `f` has type `Box<dyn FnOnce(i32) -> i32>`, which does not implement the `Copy` trait
@@ -37,7 +37,7 @@ LL | f(f(10));
37
37
| value moved here
38
38
39
39
error[E0502]: cannot borrow `a` as immutable because it is also borrowed as mutable
40
- --> $DIR/two-phase-nonrecv-autoref.rs:107 :27
40
+ --> $DIR/two-phase-nonrecv-autoref.rs:108 :27
41
41
|
42
42
LL | double_access(&mut a, &a);
43
43
| ------------- ------ ^^ immutable borrow occurs here
@@ -46,7 +46,7 @@ LL | double_access(&mut a, &a);
46
46
| mutable borrow later used by call
47
47
48
48
error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable
49
- --> $DIR/two-phase-nonrecv-autoref.rs:132 :7
49
+ --> $DIR/two-phase-nonrecv-autoref.rs:133 :7
50
50
|
51
51
LL | i[i[3]] = 4;
52
52
| --^----
@@ -56,18 +56,18 @@ LL | i[i[3]] = 4;
56
56
| mutable borrow occurs here
57
57
|
58
58
help: try adding a local storing this...
59
- --> $DIR/two-phase-nonrecv-autoref.rs:132 :8
59
+ --> $DIR/two-phase-nonrecv-autoref.rs:133 :8
60
60
|
61
61
LL | i[i[3]] = 4;
62
62
| ^^^
63
63
help: ...and then using that local here
64
- --> $DIR/two-phase-nonrecv-autoref.rs:132 :6
64
+ --> $DIR/two-phase-nonrecv-autoref.rs:133 :6
65
65
|
66
66
LL | i[i[3]] = 4;
67
67
| ^^^^^^
68
68
69
69
error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable
70
- --> $DIR/two-phase-nonrecv-autoref.rs:138 :7
70
+ --> $DIR/two-phase-nonrecv-autoref.rs:139 :7
71
71
|
72
72
LL | i[i[3]] = i[4];
73
73
| --^----
@@ -77,12 +77,12 @@ LL | i[i[3]] = i[4];
77
77
| mutable borrow occurs here
78
78
|
79
79
help: try adding a local storing this...
80
- --> $DIR/two-phase-nonrecv-autoref.rs:138 :8
80
+ --> $DIR/two-phase-nonrecv-autoref.rs:139 :8
81
81
|
82
82
LL | i[i[3]] = i[4];
83
83
| ^^^
84
84
help: ...and then using that local here
85
- --> $DIR/two-phase-nonrecv-autoref.rs:138 :6
85
+ --> $DIR/two-phase-nonrecv-autoref.rs:139 :6
86
86
|
87
87
LL | i[i[3]] = i[4];
88
88
| ^^^^^^
0 commit comments