@@ -77,11 +77,11 @@ error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
77
77
--> $DIR/borrowck-closures-two-mut.rs:24:24
78
78
|
79
79
LL | let c1 = to_fn_mut(|| x = 4);
80
- | -- - previous borrow occurs due to use of `x` in closure
80
+ | -- - first borrow occurs due to use of `x` in closure
81
81
| |
82
82
| first mutable borrow occurs here
83
83
LL | let c2 = to_fn_mut(|| x = 5); //~ ERROR cannot borrow `x` as mutable more than once
84
- | ^^ - borrow occurs due to use of `x` in closure
84
+ | ^^ - second borrow occurs due to use of `x` in closure
85
85
| |
86
86
| second mutable borrow occurs here
87
87
LL | //~| ERROR cannot borrow `x` as mutable more than once
@@ -92,11 +92,11 @@ error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
92
92
--> $DIR/borrowck-closures-two-mut.rs:36:24
93
93
|
94
94
LL | let c1 = to_fn_mut(|| set(&mut x));
95
- | -- - previous borrow occurs due to use of `x` in closure
95
+ | -- - first borrow occurs due to use of `x` in closure
96
96
| |
97
97
| first mutable borrow occurs here
98
98
LL | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
99
- | ^^ - borrow occurs due to use of `x` in closure
99
+ | ^^ - second borrow occurs due to use of `x` in closure
100
100
| |
101
101
| second mutable borrow occurs here
102
102
LL | //~| ERROR cannot borrow `x` as mutable more than once
@@ -107,11 +107,11 @@ error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
107
107
--> $DIR/borrowck-closures-two-mut.rs:44:24
108
108
|
109
109
LL | let c1 = to_fn_mut(|| x = 5);
110
- | -- - previous borrow occurs due to use of `x` in closure
110
+ | -- - first borrow occurs due to use of `x` in closure
111
111
| |
112
112
| first mutable borrow occurs here
113
113
LL | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
114
- | ^^ - borrow occurs due to use of `x` in closure
114
+ | ^^ - second borrow occurs due to use of `x` in closure
115
115
| |
116
116
| second mutable borrow occurs here
117
117
LL | //~| ERROR cannot borrow `x` as mutable more than once
@@ -122,11 +122,11 @@ error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
122
122
--> $DIR/borrowck-closures-two-mut.rs:52:24
123
123
|
124
124
LL | let c1 = to_fn_mut(|| x = 5);
125
- | -- - previous borrow occurs due to use of `x` in closure
125
+ | -- - first borrow occurs due to use of `x` in closure
126
126
| |
127
127
| first mutable borrow occurs here
128
128
LL | let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nested closure)
129
- | ^^ - borrow occurs due to use of `x` in closure
129
+ | ^^ - second borrow occurs due to use of `x` in closure
130
130
| |
131
131
| second mutable borrow occurs here
132
132
...
@@ -137,11 +137,11 @@ error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
137
137
--> $DIR/borrowck-closures-two-mut.rs:65:24
138
138
|
139
139
LL | let c1 = to_fn_mut(|| set(&mut *x.f));
140
- | -- - previous borrow occurs due to use of `x` in closure
140
+ | -- - first borrow occurs due to use of `x` in closure
141
141
| |
142
142
| first mutable borrow occurs here
143
143
LL | let c2 = to_fn_mut(|| set(&mut *x.f));
144
- | ^^ - borrow occurs due to use of `x` in closure
144
+ | ^^ - second borrow occurs due to use of `x` in closure
145
145
| |
146
146
| second mutable borrow occurs here
147
147
...
0 commit comments