File tree 5 files changed +12
-58
lines changed
5 files changed +12
-58
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ LL | *y = 1;
10
10
| ------ first borrow later used here
11
11
12
12
error[E0499]: cannot borrow `x` as mutable more than once at a time
13
- --> $DIR/borrowck-describe-lvalue.rs:307 :20
13
+ --> $DIR/borrowck-describe-lvalue.rs:308 :20
14
14
|
15
15
LL | let y = &mut x;
16
16
| ------ first mutable borrow occurs here
@@ -26,10 +26,10 @@ error: captured variable cannot escape `FnMut` closure body
26
26
LL | || {
27
27
| - inferred to be a `FnMut` closure
28
28
LL | / || { //[mir]~ ERROR captured variable cannot escape `FnMut` closure body
29
+ LL | | //[ast]~^ ERROR lifetime of `x` is too short
29
30
LL | | let y = &mut x;
30
31
LL | | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time
31
- LL | | //[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time
32
- LL | | *y = 1;
32
+ ... |
33
33
LL | | drop(y);
34
34
LL | | }
35
35
| |_________________^ returns a closure that contains a reference to a captured variable, which then escapes the closure body
@@ -370,7 +370,7 @@ LL | drop(x);
370
370
This warning will become a hard error in the future.
371
371
372
372
error[E0382]: use of moved value: `x`
373
- --> $DIR/borrowck-describe-lvalue.rs:318 :22
373
+ --> $DIR/borrowck-describe-lvalue.rs:319 :22
374
374
|
375
375
LL | drop(x);
376
376
| - value moved here
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- warning : captured variable cannot escape `FnMut` closure body
2
- --> $DIR/issue-40510-3.rs:18 :9
1
+ error : captured variable cannot escape `FnMut` closure body
2
+ --> $DIR/issue-40510-3.rs:20 :9
3
3
|
4
4
LL | || {
5
5
| - inferred to be a `FnMut` closure
6
- LL | / || {
6
+ LL | / || { //~ ERROR too short
7
7
LL | | x.push(())
8
8
LL | | }
9
9
| |_________^ returns a closure that contains a reference to a captured variable, which then escapes the closure body
10
10
|
11
11
= note: `FnMut` closures only have access to their captured variables while they are executing...
12
12
= note: ...therefore, they cannot allow references to captured variables to escape
13
- = warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
14
- It represents potential unsoundness in your code.
15
- This warning will become a hard error in the future.
13
+
14
+ error: aborting due to previous error
16
15
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- warning : captured variable cannot escape `FnMut` closure body
2
- --> $DIR/issue-49824.rs:22 :9
1
+ error : captured variable cannot escape `FnMut` closure body
2
+ --> $DIR/issue-49824.rs:23 :9
3
3
|
4
4
LL | || {
5
5
| - inferred to be a `FnMut` closure
6
- LL | / || {
6
+ LL | / || { //~ ERROR too short
7
7
LL | | let _y = &mut x;
8
8
LL | | }
9
9
| |_________^ returns a closure that contains a reference to a captured variable, which then escapes the closure body
10
10
|
11
11
= note: `FnMut` closures only have access to their captured variables while they are executing...
12
12
= note: ...therefore, they cannot allow references to captured variables to escape
13
- = warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
14
- It represents potential unsoundness in your code.
15
- This warning will become a hard error in the future.
16
-
17
- error: compilation successful
18
- --> $DIR/issue-49824.rs:18:1
19
- |
20
- LL | / fn main() {
21
- LL | | //~^ compilation successful
22
- LL | | let mut x = 0;
23
- LL | | || {
24
- ... |
25
- LL | | };
26
- LL | | }
27
- | |_^
28
13
29
14
error: aborting due to previous error
30
15
You can’t perform that action at this time.
0 commit comments