1
1
error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
2
- --> $DIR/borrowck-closures-slice-patterns.rs:9 :13
2
+ --> $DIR/borrowck-closures-slice-patterns.rs:7 :13
3
3
|
4
4
LL | let f = || {
5
5
| -- immutable borrow occurs here
@@ -13,7 +13,7 @@ LL | f();
13
13
| - immutable borrow later used here
14
14
15
15
error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
16
- --> $DIR/borrowck-closures-slice-patterns.rs:18 :13
16
+ --> $DIR/borrowck-closures-slice-patterns.rs:16 :13
17
17
|
18
18
LL | let mut f = || {
19
19
| -- mutable borrow occurs here
@@ -27,7 +27,7 @@ LL | f();
27
27
| - mutable borrow later used here
28
28
29
29
error[E0382]: borrow of moved value: `x`
30
- --> $DIR/borrowck-closures-slice-patterns.rs:27 :5
30
+ --> $DIR/borrowck-closures-slice-patterns.rs:25 :5
31
31
|
32
32
LL | fn arr_by_move(x: [String; 3]) {
33
33
| - move occurs because `x` has type `[std::string::String; 3]`, which does not implement the `Copy` trait
@@ -40,7 +40,7 @@ LL | &x;
40
40
| ^^ value borrowed here after move
41
41
42
42
error[E0502]: cannot borrow `*x` as mutable because it is also borrowed as immutable
43
- --> $DIR/borrowck-closures-slice-patterns.rs:35 :13
43
+ --> $DIR/borrowck-closures-slice-patterns.rs:33 :13
44
44
|
45
45
LL | let f = || {
46
46
| -- immutable borrow occurs here
@@ -54,7 +54,7 @@ LL | f();
54
54
| - immutable borrow later used here
55
55
56
56
error[E0501]: cannot borrow `x` as immutable because previous closure requires unique access
57
- --> $DIR/borrowck-closures-slice-patterns.rs:44 :13
57
+ --> $DIR/borrowck-closures-slice-patterns.rs:42 :13
58
58
|
59
59
LL | let mut f = || {
60
60
| -- closure construction occurs here
@@ -68,7 +68,7 @@ LL | f();
68
68
| - first borrow later used here
69
69
70
70
error[E0382]: borrow of moved value: `x`
71
- --> $DIR/borrowck-closures-slice-patterns.rs:53 :5
71
+ --> $DIR/borrowck-closures-slice-patterns.rs:51 :5
72
72
|
73
73
LL | fn arr_box_by_move(x: Box<[String; 3]>) {
74
74
| - move occurs because `x` has type `std::boxed::Box<[std::string::String; 3]>`, which does not implement the `Copy` trait
@@ -81,7 +81,7 @@ LL | &x;
81
81
| ^^ value borrowed here after move
82
82
83
83
error[E0502]: cannot borrow `*x` as mutable because it is also borrowed as immutable
84
- --> $DIR/borrowck-closures-slice-patterns.rs:61 :13
84
+ --> $DIR/borrowck-closures-slice-patterns.rs:59 :13
85
85
|
86
86
LL | let f = || {
87
87
| -- immutable borrow occurs here
@@ -95,7 +95,7 @@ LL | f();
95
95
| - immutable borrow later used here
96
96
97
97
error[E0501]: cannot borrow `x` as immutable because previous closure requires unique access
98
- --> $DIR/borrowck-closures-slice-patterns.rs:70 :13
98
+ --> $DIR/borrowck-closures-slice-patterns.rs:68 :13
99
99
|
100
100
LL | let mut f = || {
101
101
| -- closure construction occurs here
0 commit comments