Skip to content

Commit 539404b

Browse files
committed
Update output for borrowck=migrate compare mode.
This commit updates the test output for the updated NLL compare mode that uses `-Z borrowck=migrate` rather than `-Z borrowck=mir`. The previous commit changes `compiletest` and this commit only updates `.nll.stderr` files.
1 parent 8b34881 commit 539404b

File tree

204 files changed

+920
-2958
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+920
-2958
lines changed

src/test/ui/access-mode-in-closures.nll.stderr

+13-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@ note: move occurs because `v` has type `std::vec::Vec<isize>`, which does not im
1313
LL | match *s { sty(v) => v } //~ ERROR cannot move out
1414
| ^
1515

16-
error: aborting due to previous error
16+
error[E0507]: cannot move out of `s.0` which is behind a `&` reference
17+
--> $DIR/access-mode-in-closures.rs:19:24
18+
|
19+
LL | let _foo = unpack(|s| {
20+
| - help: consider changing this to be a mutable reference: `&mut sty`
21+
LL | // Test that `s` is moved here.
22+
LL | match *s { sty(v) => v } //~ ERROR cannot move out
23+
| ^
24+
| |
25+
| cannot move out of `s.0` which is behind a `&` reference
26+
| `s` is a `&` reference, so the data it refers to cannot be moved
27+
28+
error: aborting due to 2 previous errors
1729

1830
For more information about this error, try `rustc --explain E0507`.

src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.nll.stderr

-24
This file was deleted.

src/test/ui/associated-types/associated-types-subtyping-1.nll.stderr

-24
This file was deleted.

src/test/ui/associated-types/cache/project-fn-ret-contravariant.krisskross.nll.stderr

-24
This file was deleted.

src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.nll.stderr

-20
This file was deleted.

src/test/ui/associated-types/cache/project-fn-ret-invariant.krisskross.nll.stderr

-24
This file was deleted.

src/test/ui/associated-types/cache/project-fn-ret-invariant.oneuse.nll.stderr

-24
This file was deleted.

src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.nll.stderr

-22
This file was deleted.

src/test/ui/binop/binop-move-semantics.nll.stderr

+13-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ error[E0507]: cannot move out of borrowed content
3232
LL | *n; //~ ERROR: cannot move out of borrowed content
3333
| ^^ cannot move out of borrowed content
3434

35+
error[E0507]: cannot move out of `*n` which is behind a `&` reference
36+
--> $DIR/binop-move-semantics.rs:42:5
37+
|
38+
LL | let n = &y;
39+
| -- help: consider changing this to be a mutable reference: `&mut y`
40+
...
41+
LL | *n; //~ ERROR: cannot move out of borrowed content
42+
| ^^
43+
| |
44+
| cannot move out of `*n` which is behind a `&` reference
45+
| `n` is a `&` reference, so the data it refers to cannot be moved
46+
3547
error[E0502]: cannot borrow `f` as immutable because it is also borrowed as mutable
3648
--> $DIR/binop-move-semantics.rs:64:5
3749
|
@@ -62,7 +74,7 @@ LL | | &mut f; //~ ERROR: cannot borrow `f` as mutable because it is also b
6274
| | immutable borrow later used here
6375
| mutable borrow occurs here
6476

65-
error: aborting due to 6 previous errors
77+
error: aborting due to 7 previous errors
6678

6779
Some errors occurred: E0382, E0502, E0507.
6880
For more information about an error, try `rustc --explain E0382`.

src/test/ui/borrowck/borrowck-closures-unique.nll.stderr

+6-2
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,19 @@ LL | let c2 = || set(x); //~ ERROR two closures require unique access to `x`
4040
LL | c1;
4141
| -- first borrow later used here
4242

43-
error[E0594]: cannot assign to `x`, as it is not declared as mutable
43+
warning[E0594]: cannot assign to `x`, as it is not declared as mutable
4444
--> $DIR/borrowck-closures-unique.rs:57:38
4545
|
4646
LL | fn e(x: &'static mut isize) {
4747
| - help: consider changing this to be mutable: `mut x`
4848
LL | let c1 = |y: &'static mut isize| x = y; //~ ERROR closure cannot assign to immutable argument
4949
| ^^^^^ cannot assign
50+
|
51+
= warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
52+
It represents potential unsoundness in your code.
53+
This warning will become a hard error in the future.
5054

51-
error: aborting due to 4 previous errors
55+
error: aborting due to 3 previous errors
5256

5357
Some errors occurred: E0500, E0524, E0594.
5458
For more information about an error, try `rustc --explain E0500`.

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

+15-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ LL | //[mir]~^ ERROR cannot borrow `x` as mutable more than o
2020
LL | *y = 1;
2121
| ------ first borrow later used here
2222

23-
error: captured variable cannot escape `FnMut` closure body
23+
warning: captured variable cannot escape `FnMut` closure body
2424
--> $DIR/borrowck-describe-lvalue.rs:305:16
2525
|
2626
LL | || {
@@ -36,6 +36,9 @@ LL | | }
3636
|
3737
= note: `FnMut` closures only have access to their captured variables while they are executing...
3838
= note: ...therefore, they cannot allow references to captured variables to escape
39+
= warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
40+
It represents potential unsoundness in your code.
41+
This warning will become a hard error in the future.
3942

4043
error[E0503]: cannot use `f.x` because it was mutably borrowed
4144
--> $DIR/borrowck-describe-lvalue.rs:53:9
@@ -339,7 +342,7 @@ LL | &[_, F {x: ref xf, ..}] => println!("{}", xf),
339342
LL | drop(x);
340343
| - mutable borrow later used here
341344

342-
error[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable
345+
warning[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable
343346
--> $DIR/borrowck-describe-lvalue.rs:245:29
344347
|
345348
LL | let x = &mut block;
@@ -349,8 +352,12 @@ LL | let p: &'a u8 = &*block.current;
349352
...
350353
LL | drop(x);
351354
| - mutable borrow later used here
355+
|
356+
= warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
357+
It represents potential unsoundness in your code.
358+
This warning will become a hard error in the future.
352359

353-
error[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable
360+
warning[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable
354361
--> $DIR/borrowck-describe-lvalue.rs:260:33
355362
|
356363
LL | let x = &mut block;
@@ -360,6 +367,10 @@ LL | let p : *const u8 = &*(*block).current;
360367
...
361368
LL | drop(x);
362369
| - mutable borrow later used here
370+
|
371+
= warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
372+
It represents potential unsoundness in your code.
373+
This warning will become a hard error in the future.
363374

364375
error[E0382]: use of moved value: `x`
365376
--> $DIR/borrowck-describe-lvalue.rs:318:22
@@ -371,7 +382,7 @@ LL | drop(x); //[ast]~ ERROR use of moved value: `x`
371382
|
372383
= note: move occurs because `x` has type `std::vec::Vec<i32>`, which does not implement the `Copy` trait
373384

374-
error: aborting due to 32 previous errors
385+
error: aborting due to 29 previous errors
375386

376387
Some errors occurred: E0382, E0499, E0502, E0503.
377388
For more information about an error, try `rustc --explain E0382`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
error[E0507]: cannot move out of borrowed content
2+
--> $DIR/borrowck-fn-in-const-a.rs:19:16
3+
|
4+
LL | return *x //[ast]~ ERROR cannot move out of borrowed content [E0507]
5+
| ^^ cannot move out of borrowed content
6+
7+
error[E0507]: cannot move out of `*x` which is behind a `&` reference
8+
--> $DIR/borrowck-fn-in-const-a.rs:19:16
9+
|
10+
LL | fn broken(x: &String) -> String {
11+
| ------- help: consider changing this to be a mutable reference: `&mut std::string::String`
12+
LL | return *x //[ast]~ ERROR cannot move out of borrowed content [E0507]
13+
| ^^
14+
| |
15+
| cannot move out of `*x` which is behind a `&` reference
16+
| `x` is a `&` reference, so the data it refers to cannot be moved
17+
18+
error: aborting due to 2 previous errors
19+
20+
For more information about this error, try `rustc --explain E0507`.

src/test/ui/borrowck/borrowck-for-loop-correct-cmt-for-pattern.nll.stderr

+31-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
error[E0507]: cannot move out of `*__next` which is behind a `&` reference
2+
--> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:22:10
3+
|
4+
LL | for &a in x.iter() { //~ ERROR cannot move out
5+
| -^
6+
| ||
7+
| |cannot move out of `*__next` which is behind a `&` reference
8+
| |`__next` is a `&` reference, so the data it refers to cannot be moved
9+
| help: consider changing this to be a mutable reference: `&mut a`
10+
111
error[E0507]: cannot move out of borrowed content
212
--> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:22:15
313
|
@@ -13,6 +23,16 @@ note: move occurs because `a` has type `&mut i32`, which does not implement the
1323
LL | for &a in x.iter() { //~ ERROR cannot move out
1424
| ^
1525

26+
error[E0507]: cannot move out of `*__next` which is behind a `&` reference
27+
--> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:28:10
28+
|
29+
LL | for &a in &f.a { //~ ERROR cannot move out
30+
| -^
31+
| ||
32+
| |cannot move out of `*__next` which is behind a `&` reference
33+
| |`__next` is a `&` reference, so the data it refers to cannot be moved
34+
| help: consider changing this to be a mutable reference: `&mut a`
35+
1636
error[E0507]: cannot move out of borrowed content
1737
--> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:28:15
1838
|
@@ -28,6 +48,16 @@ note: move occurs because `a` has type `std::boxed::Box<isize>`, which does not
2848
LL | for &a in &f.a { //~ ERROR cannot move out
2949
| ^
3050

51+
error[E0507]: cannot move out of `*__next` which is behind a `&` reference
52+
--> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:32:10
53+
|
54+
LL | for &a in x.iter() { //~ ERROR cannot move out
55+
| -^
56+
| ||
57+
| |cannot move out of `*__next` which is behind a `&` reference
58+
| |`__next` is a `&` reference, so the data it refers to cannot be moved
59+
| help: consider changing this to be a mutable reference: `&mut a`
60+
3161
error[E0507]: cannot move out of borrowed content
3262
--> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:32:15
3363
|
@@ -43,6 +73,6 @@ note: move occurs because `a` has type `std::boxed::Box<i32>`, which does not im
4373
LL | for &a in x.iter() { //~ ERROR cannot move out
4474
| ^
4575

46-
error: aborting due to 3 previous errors
76+
error: aborting due to 6 previous errors
4777

4878
For more information about this error, try `rustc --explain E0507`.

0 commit comments

Comments
 (0)