Update the existing UI tests to reflect diagnostic changes in NLL.
This commit is contained in:
parent
0d9998cb97
commit
35971ccc41
14
src/test/ui/asm-out-assign-imm.nll.stderr
Normal file
14
src/test/ui/asm-out-assign-imm.nll.stderr
Normal file
@ -0,0 +1,14 @@
|
||||
error[E0384]: cannot assign twice to immutable variable `x`
|
||||
--> $DIR/asm-out-assign-imm.rs:33:9
|
||||
|
|
||||
LL | let x: isize;
|
||||
| - consider changing this to `mut x`
|
||||
LL | x = 1;
|
||||
| ----- first assignment to `x`
|
||||
...
|
||||
LL | asm!("mov $1, $0" : "=r"(x) : "r"(5));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot assign twice to immutable variable
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0384`.
|
@ -10,7 +10,7 @@ error[E0384]: cannot assign to immutable argument `_x` (Mir)
|
||||
--> $DIR/immutable-arg.rs:14:5
|
||||
|
|
||||
LL | fn foo(_x: u32) {
|
||||
| -- argument not declared as `mut`
|
||||
| -- consider changing this to `mut _x`
|
||||
LL | _x = 4;
|
||||
| ^^^^^^ cannot assign to immutable argument
|
||||
|
||||
|
@ -2,7 +2,9 @@ error[E0384]: cannot assign twice to immutable variable `x`
|
||||
--> $DIR/command-line-diagnostics.rs:16:5
|
||||
|
|
||||
LL | let x = 42;
|
||||
| -- first assignment to `x`
|
||||
| - -- first assignment to `x`
|
||||
| |
|
||||
| consider changing this to `mut x`
|
||||
LL | x = 43;
|
||||
| ^^^^^^ cannot assign twice to immutable variable
|
||||
|
||||
|
@ -10,7 +10,9 @@ error[E0384]: cannot assign twice to immutable variable `s.x`
|
||||
--> $DIR/issue-35937.rs:26:5
|
||||
|
|
||||
LL | let s = S { x: 42 };
|
||||
| ----------- first assignment to `s.x`
|
||||
| - ----------- first assignment to `s.x`
|
||||
| |
|
||||
| consider changing this to `mut s`
|
||||
LL | s.x += 1; //~ ERROR cannot assign
|
||||
| ^^^^^^^^ cannot assign twice to immutable variable
|
||||
|
||||
@ -18,7 +20,10 @@ error[E0384]: cannot assign twice to immutable variable `s.x`
|
||||
--> $DIR/issue-35937.rs:30:5
|
||||
|
|
||||
LL | fn bar(s: S) {
|
||||
| - first assignment to `s.x`
|
||||
| -
|
||||
| |
|
||||
| first assignment to `s.x`
|
||||
| consider changing this to `mut s`
|
||||
LL | s.x += 1; //~ ERROR cannot assign
|
||||
| ^^^^^^^^ cannot assign twice to immutable variable
|
||||
|
||||
|
@ -18,7 +18,7 @@ error[E0384]: cannot assign to immutable argument `y`
|
||||
--> $DIR/ex3-both-anon-regions-one-is-struct-2.rs:14:5
|
||||
|
|
||||
LL | fn foo(mut x: Ref, y: &u32) {
|
||||
| - argument not declared as `mut`
|
||||
| - consider changing this to `mut y`
|
||||
LL | y = x.b; //~ ERROR lifetime mismatch
|
||||
| ^^^^^^^ cannot assign to immutable argument
|
||||
|
||||
|
@ -32,6 +32,9 @@ LL | x = 2; //~ ERROR (Ast) [E0384]
|
||||
error[E0384]: cannot assign twice to immutable variable `x` (Mir)
|
||||
--> $DIR/liveness-assign-imm-local-notes.rs:23:9
|
||||
|
|
||||
LL | let x;
|
||||
| - consider changing this to `mut x`
|
||||
...
|
||||
LL | x = 2;
|
||||
| ----- first assignment to `x`
|
||||
LL | x = 3; //~ ERROR (Ast) [E0384]
|
||||
@ -40,6 +43,9 @@ LL | x = 3; //~ ERROR (Ast) [E0384]
|
||||
error[E0384]: cannot assign twice to immutable variable `x` (Mir)
|
||||
--> $DIR/liveness-assign-imm-local-notes.rs:35:13
|
||||
|
|
||||
LL | let x;
|
||||
| - consider changing this to `mut x`
|
||||
...
|
||||
LL | x = 2;
|
||||
| ----- first assignment to `x`
|
||||
LL | x = 3; //~ ERROR (Ast) [E0384]
|
||||
@ -48,12 +54,18 @@ LL | x = 3; //~ ERROR (Ast) [E0384]
|
||||
error[E0384]: cannot assign twice to immutable variable `x` (Mir)
|
||||
--> $DIR/liveness-assign-imm-local-notes.rs:45:13
|
||||
|
|
||||
LL | let x;
|
||||
| - consider changing this to `mut x`
|
||||
...
|
||||
LL | x = 1; //~ ERROR (Ast) [E0384]
|
||||
| ^^^^^ cannot assign twice to immutable variable
|
||||
|
||||
error[E0384]: cannot assign twice to immutable variable `x` (Mir)
|
||||
--> $DIR/liveness-assign-imm-local-notes.rs:48:13
|
||||
|
|
||||
LL | let x;
|
||||
| - consider changing this to `mut x`
|
||||
...
|
||||
LL | x = 1; //~ ERROR (Ast) [E0384]
|
||||
| ----- first assignment to `x`
|
||||
...
|
||||
|
Loading…
Reference in New Issue
Block a user