Skip to content

Commit

Permalink
Update compare-mode=nll stderr files to reflect the fix to rust-lang#…
Browse files Browse the repository at this point in the history
  • Loading branch information
pnkfelix committed Oct 29, 2018
1 parent d5798c9 commit 87ce5ec
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 65 deletions.
8 changes: 2 additions & 6 deletions src/test/ui/borrowck/borrowck-closures-unique.nll.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,15 @@ LL | let c2 = || set(x); //~ ERROR two closures require unique access to `x`
LL | c1;
| -- first borrow later used here

warning[E0594]: cannot assign to `x`, as it is not declared as mutable
error[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 3 previous errors
error: aborting due to 4 previous errors

Some errors occurred: E0500, E0524, E0594.
For more information about an error, try `rustc --explain E0500`.
7 changes: 2 additions & 5 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

warning: captured variable cannot escape `FnMut` closure body
error: captured variable cannot escape `FnMut` closure body
--> $DIR/borrowck-describe-lvalue.rs:305:16
|
LL | || {
Expand All @@ -36,9 +36,6 @@ 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 @@ -382,7 +379,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 29 previous errors
error: aborting due to 30 previous errors

Some errors occurred: E0382, E0499, E0502, E0503.
For more information about an error, try `rustc --explain E0382`.
26 changes: 5 additions & 21 deletions src/test/ui/borrowck/mutability-errors.nll.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -277,57 +277,41 @@ LL | &mut x; //~ ERROR
LL | &mut x.0; //~ ERROR
| ^^^^^^^^ cannot borrow as mutable

warning[E0594]: cannot assign to `x`, as it is not declared as mutable
error[E0594]: cannot assign to `x`, as it is not declared as mutable
--> $DIR/mutability-errors.rs:70:9
|
LL | fn imm_capture(x: (i32,)) {
| - help: consider changing this to be mutable: `mut x`
LL | || { //~ ERROR
LL | x = (1,);
| ^^^^^^^^ 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.

warning[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable
error[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable
--> $DIR/mutability-errors.rs:71:9
|
LL | fn imm_capture(x: (i32,)) {
| - help: consider changing this to be mutable: `mut x`
...
LL | x.0 = 1;
| ^^^^^^^ 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.

warning[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
--> $DIR/mutability-errors.rs:72:9
|
LL | fn imm_capture(x: (i32,)) {
| - help: consider changing this to be mutable: `mut x`
...
LL | &mut x;
| ^^^^^^ cannot borrow as mutable
|
= 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.

warning[E0596]: cannot borrow `x.0` as mutable, as `x` is not declared as mutable
error[E0596]: cannot borrow `x.0` as mutable, as `x` is not declared as mutable
--> $DIR/mutability-errors.rs:73:9
|
LL | fn imm_capture(x: (i32,)) {
| - help: consider changing this to be mutable: `mut x`
...
LL | &mut x.0;
| ^^^^^^^^ cannot borrow as mutable
|
= 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[E0594]: cannot assign to `x`, as it is not declared as mutable
--> $DIR/mutability-errors.rs:76:9
Expand Down Expand Up @@ -389,7 +373,7 @@ error[E0596]: cannot borrow `X.0` as mutable, as `X` is an immutable static item
LL | &mut X.0; //~ ERROR
| ^^^^^^^^ cannot borrow as mutable

error: aborting due to 34 previous errors
error: aborting due to 38 previous errors

Some errors occurred: E0594, E0596.
For more information about an error, try `rustc --explain E0594`.
Original file line number Diff line number Diff line change
Expand Up @@ -33,59 +33,43 @@ LL | let x = 0;
LL | move || set(&mut x); //~ ERROR cannot borrow
| ^^^^^^ cannot borrow as mutable

warning[E0594]: cannot assign to `x`, as it is not declared as mutable
error[E0594]: cannot assign to `x`, as it is not declared as mutable
--> $DIR/unboxed-closure-immutable-capture.rs:23:8
|
LL | let x = 0;
| - help: consider changing this to be mutable: `mut x`
...
LL | || x = 1; //~ ERROR cannot assign
| ^^^^^ 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.

warning[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
--> $DIR/unboxed-closure-immutable-capture.rs:25:12
|
LL | let x = 0;
| - help: consider changing this to be mutable: `mut x`
...
LL | || set(&mut x); //~ ERROR cannot assign
| ^^^^^^ cannot borrow as mutable
|
= 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.

warning[E0594]: cannot assign to `x`, as it is not declared as mutable
error[E0594]: cannot assign to `x`, as it is not declared as mutable
--> $DIR/unboxed-closure-immutable-capture.rs:26:8
|
LL | let x = 0;
| - help: consider changing this to be mutable: `mut x`
...
LL | || x = 1; //~ ERROR cannot assign
| ^^^^^ 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.

warning[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
--> $DIR/unboxed-closure-immutable-capture.rs:28:12
|
LL | let x = 0;
| - help: consider changing this to be mutable: `mut x`
...
LL | || set(&mut x); //~ ERROR cannot assign
| ^^^^^^ cannot borrow as mutable
|
= 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 8 previous errors

Some errors occurred: E0594, E0596.
For more information about an error, try `rustc --explain E0594`.
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
warning[E0596]: cannot borrow `tick1` as mutable, as it is not declared as mutable
error[E0596]: cannot borrow `tick1` as mutable, as it is not declared as mutable
--> $DIR/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.rs:27:9
|
LL | let tick1 = || {
| ----- help: consider changing this to be mutable: `mut tick1`
...
LL | tick1();
| ^^^^^ cannot borrow as mutable
|
= 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[E0596]: cannot borrow `tick2` as mutable, as it is not declared as mutable
--> $DIR/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.rs:30:5
Expand All @@ -20,6 +16,6 @@ LL | let tick2 = || { //~ ERROR closure cannot assign to immutable local var
LL | tick2(); //~ ERROR cannot borrow
| ^^^^^ cannot borrow as mutable

error: aborting due to previous error
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0596`.
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
warning[E0594]: cannot assign to `n`, as it is not declared as mutable
error[E0594]: cannot assign to `n`, as it is not declared as mutable
--> $DIR/unboxed-closures-mutate-upvar.rs:25:9
|
LL | let n = 0;
| - help: consider changing this to be mutable: `mut n`
LL | let mut f = to_fn_mut(|| { //~ ERROR closure cannot assign
LL | n += 1;
| ^^^^^^ 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[E0594]: cannot assign to `n`, as it is not declared as mutable
--> $DIR/unboxed-closures-mutate-upvar.rs:42:9
Expand Down Expand Up @@ -44,6 +40,6 @@ LL | | n += 1; //~ ERROR cannot assign
LL | | });
| |_____^

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

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

0 comments on commit 87ce5ec

Please sign in to comment.