Skip to content

Commit

Permalink
Update output for borrowck=migrate compare mode.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
davidtwco committed Oct 16, 2018
1 parent 8b34881 commit 539404b
Show file tree
Hide file tree
Showing 204 changed files with 920 additions and 2,958 deletions.
14 changes: 13 additions & 1 deletion src/test/ui/access-mode-in-closures.nll.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ note: move occurs because `v` has type `std::vec::Vec<isize>`, which does not im
LL | match *s { sty(v) => v } //~ ERROR cannot move out
| ^

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

error: aborting due to 2 previous errors

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

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

14 changes: 13 additions & 1 deletion src/test/ui/binop/binop-move-semantics.nll.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ error[E0507]: cannot move out of borrowed content
LL | *n; //~ ERROR: cannot move out of borrowed content
| ^^ cannot move out of borrowed content

error[E0507]: cannot move out of `*n` which is behind a `&` reference
--> $DIR/binop-move-semantics.rs:42:5
|
LL | let n = &y;
| -- help: consider changing this to be a mutable reference: `&mut y`
...
LL | *n; //~ ERROR: cannot move out of borrowed content
| ^^
| |
| cannot move out of `*n` which is behind a `&` reference
| `n` is a `&` reference, so the data it refers to cannot be moved

error[E0502]: cannot borrow `f` as immutable because it is also borrowed as mutable
--> $DIR/binop-move-semantics.rs:64:5
|
Expand Down Expand Up @@ -62,7 +74,7 @@ LL | | &mut f; //~ ERROR: cannot borrow `f` as mutable because it is also b
| | immutable borrow later used here
| mutable borrow occurs here

error: aborting due to 6 previous errors
error: aborting due to 7 previous errors

Some errors occurred: E0382, E0502, E0507.
For more information about an error, try `rustc --explain E0382`.
8 changes: 6 additions & 2 deletions src/test/ui/borrowck/borrowck-closures-unique.nll.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,19 @@ LL | let c2 = || set(x); //~ ERROR two closures require unique access to `x`
LL | c1;
| -- first borrow later used here

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

error: aborting due to 4 previous errors
error: aborting due to 3 previous errors

Some errors occurred: E0500, E0524, E0594.
For more information about an error, try `rustc --explain E0500`.
19 changes: 15 additions & 4 deletions src/test/ui/borrowck/borrowck-describe-lvalue.ast.nll.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ LL | //[mir]~^ ERROR cannot borrow `x` as mutable more than o
LL | *y = 1;
| ------ first borrow later used here

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

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

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

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

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

error: aborting due to 32 previous errors
error: aborting due to 29 previous errors

Some errors occurred: E0382, E0499, E0502, E0503.
For more information about an error, try `rustc --explain E0382`.
20 changes: 20 additions & 0 deletions src/test/ui/borrowck/borrowck-fn-in-const-a.ast.nll.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
error[E0507]: cannot move out of borrowed content
--> $DIR/borrowck-fn-in-const-a.rs:19:16
|
LL | return *x //[ast]~ ERROR cannot move out of borrowed content [E0507]
| ^^ cannot move out of borrowed content

error[E0507]: cannot move out of `*x` which is behind a `&` reference
--> $DIR/borrowck-fn-in-const-a.rs:19:16
|
LL | fn broken(x: &String) -> String {
| ------- help: consider changing this to be a mutable reference: `&mut std::string::String`
LL | return *x //[ast]~ ERROR cannot move out of borrowed content [E0507]
| ^^
| |
| cannot move out of `*x` which is behind a `&` reference
| `x` is a `&` reference, so the data it refers to cannot be moved

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0507`.
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
error[E0507]: cannot move out of `*__next` which is behind a `&` reference
--> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:22:10
|
LL | for &a in x.iter() { //~ ERROR cannot move out
| -^
| ||
| |cannot move out of `*__next` which is behind a `&` reference
| |`__next` is a `&` reference, so the data it refers to cannot be moved
| help: consider changing this to be a mutable reference: `&mut a`

error[E0507]: cannot move out of borrowed content
--> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:22:15
|
Expand All @@ -13,6 +23,16 @@ note: move occurs because `a` has type `&mut i32`, which does not implement the
LL | for &a in x.iter() { //~ ERROR cannot move out
| ^

error[E0507]: cannot move out of `*__next` which is behind a `&` reference
--> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:28:10
|
LL | for &a in &f.a { //~ ERROR cannot move out
| -^
| ||
| |cannot move out of `*__next` which is behind a `&` reference
| |`__next` is a `&` reference, so the data it refers to cannot be moved
| help: consider changing this to be a mutable reference: `&mut a`

error[E0507]: cannot move out of borrowed content
--> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:28:15
|
Expand All @@ -28,6 +48,16 @@ note: move occurs because `a` has type `std::boxed::Box<isize>`, which does not
LL | for &a in &f.a { //~ ERROR cannot move out
| ^

error[E0507]: cannot move out of `*__next` which is behind a `&` reference
--> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:32:10
|
LL | for &a in x.iter() { //~ ERROR cannot move out
| -^
| ||
| |cannot move out of `*__next` which is behind a `&` reference
| |`__next` is a `&` reference, so the data it refers to cannot be moved
| help: consider changing this to be a mutable reference: `&mut a`

error[E0507]: cannot move out of borrowed content
--> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:32:15
|
Expand All @@ -43,6 +73,6 @@ note: move occurs because `a` has type `std::boxed::Box<i32>`, which does not im
LL | for &a in x.iter() { //~ ERROR cannot move out
| ^

error: aborting due to 3 previous errors
error: aborting due to 6 previous errors

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

0 comments on commit 539404b

Please sign in to comment.