Skip to content

Commit c56b122

Browse files
committed
bless more tests
1 parent 2888a98 commit c56b122

File tree

5 files changed

+12
-58
lines changed

5 files changed

+12
-58
lines changed

src/test/ui/borrowck/borrowck-describe-lvalue.ast.nll.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | *y = 1;
1010
| ------ first borrow later used here
1111

1212
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
1414
|
1515
LL | let y = &mut x;
1616
| ------ first mutable borrow occurs here
@@ -26,10 +26,10 @@ error: captured variable cannot escape `FnMut` closure body
2626
LL | || {
2727
| - inferred to be a `FnMut` closure
2828
LL | / || { //[mir]~ ERROR captured variable cannot escape `FnMut` closure body
29+
LL | | //[ast]~^ ERROR lifetime of `x` is too short
2930
LL | | let y = &mut x;
3031
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+
... |
3333
LL | | drop(y);
3434
LL | | }
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

372372
error[E0382]: use of moved value: `x`
373-
--> $DIR/borrowck-describe-lvalue.rs:318:22
373+
--> $DIR/borrowck-describe-lvalue.rs:319:22
374374
|
375375
LL | drop(x);
376376
| - value moved here

src/test/ui/issues/issue-40510-1.nll.stderr

-14
This file was deleted.
+5-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
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
|
44
LL | || {
55
| - inferred to be a `FnMut` closure
6-
LL | / || {
6+
LL | / || { //~ ERROR too short
77
LL | | x.push(())
88
LL | | }
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

src/test/ui/issues/issue-44056.rs

-16
This file was deleted.
+3-18
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,15 @@
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
|
44
LL | || {
55
| - inferred to be a `FnMut` closure
6-
LL | / || {
6+
LL | / || { //~ ERROR too short
77
LL | | let _y = &mut x;
88
LL | | }
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

2914
error: aborting due to previous error
3015

0 commit comments

Comments
 (0)