File tree Expand file tree Collapse file tree 5 files changed +12
-58
lines changed Expand file tree Collapse file tree 5 files changed +12
-58
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ LL | *y = 1;
1010 | ------ first borrow later used here
1111
1212error[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
1414 |
1515LL | let y = &mut x;
1616 | ------ first mutable borrow occurs here
@@ -26,10 +26,10 @@ error: captured variable cannot escape `FnMut` closure body
2626LL | || {
2727 | - inferred to be a `FnMut` closure
2828LL | / || { //[mir]~ ERROR captured variable cannot escape `FnMut` closure body
29+ LL | | //[ast]~^ ERROR lifetime of `x` is too short
2930LL | | let y = &mut x;
3031LL | | &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+ ... |
3333LL | | drop(y);
3434LL | | }
3535 | |_________________^ returns a closure that contains a reference to a captured variable, which then escapes the closure body
@@ -370,7 +370,7 @@ LL | drop(x);
370370 This warning will become a hard error in the future.
371371
372372error[E0382]: use of moved value: `x`
373- --> $DIR/borrowck-describe-lvalue.rs:318 :22
373+ --> $DIR/borrowck-describe-lvalue.rs:319 :22
374374 |
375375LL | drop(x);
376376 | - 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
33 |
44LL | || {
55 | - inferred to be a `FnMut` closure
6- LL | / || {
6+ LL | / || { //~ ERROR too short
77LL | | x.push(())
88LL | | }
99 | |_________^ returns a closure that contains a reference to a captured variable, which then escapes the closure body
1010 |
1111 = note: `FnMut` closures only have access to their captured variables while they are executing...
1212 = 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
1615
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
33 |
44LL | || {
55 | - inferred to be a `FnMut` closure
6- LL | / || {
6+ LL | / || { //~ ERROR too short
77LL | | let _y = &mut x;
88LL | | }
99 | |_________^ returns a closure that contains a reference to a captured variable, which then escapes the closure body
1010 |
1111 = note: `FnMut` closures only have access to their captured variables while they are executing...
1212 = 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- | |_^
2813
2914error: aborting due to previous error
3015
You can’t perform that action at this time.
0 commit comments