Skip to content

Commit

Permalink
Update ui tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewjasper committed Sep 24, 2018
1 parent c5047cb commit 1a6ed02
Show file tree
Hide file tree
Showing 24 changed files with 73 additions and 720 deletions.
29 changes: 2 additions & 27 deletions src/test/ui/borrowck/borrowck-anon-fields-struct.nll.stderr
@@ -1,27 +1,3 @@
error[E0502]: cannot borrow `y` as immutable because it is also borrowed as mutable
--> $DIR/borrowck-anon-fields-struct.rs:23:19
|
LL | Y(ref mut a, _) => a
| --------- mutable borrow occurs here
...
LL | let b = match y {
| ^ immutable borrow occurs here
...
LL | *a += 1;
| ------- borrow later used here

error[E0502]: cannot borrow `y` as immutable because it is also borrowed as mutable
--> $DIR/borrowck-anon-fields-struct.rs:38:19
|
LL | Y(ref mut a, _) => a
| --------- mutable borrow occurs here
...
LL | let b = match y {
| ^ immutable borrow occurs here
...
LL | *a += 1;
| ------- borrow later used here

error[E0499]: cannot borrow `y.0` as mutable more than once at a time
--> $DIR/borrowck-anon-fields-struct.rs:39:11
|
Expand All @@ -34,7 +10,6 @@ LL | Y(ref mut b, _) => b //~ ERROR cannot borrow
LL | *a += 1;
| ------- borrow later used here

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

Some errors occurred: E0499, E0502.
For more information about an error, try `rustc --explain E0499`.
For more information about this error, try `rustc --explain E0499`.
29 changes: 2 additions & 27 deletions src/test/ui/borrowck/borrowck-anon-fields-tuple.nll.stderr
@@ -1,27 +1,3 @@
error[E0502]: cannot borrow `y` as immutable because it is also borrowed as mutable
--> $DIR/borrowck-anon-fields-tuple.rs:21:19
|
LL | (ref mut a, _) => a
| --------- mutable borrow occurs here
...
LL | let b = match y {
| ^ immutable borrow occurs here
...
LL | *a += 1;
| ------- borrow later used here

error[E0502]: cannot borrow `y` as immutable because it is also borrowed as mutable
--> $DIR/borrowck-anon-fields-tuple.rs:36:19
|
LL | (ref mut a, _) => a
| --------- mutable borrow occurs here
...
LL | let b = match y {
| ^ immutable borrow occurs here
...
LL | *a += 1;
| ------- borrow later used here

error[E0499]: cannot borrow `y.0` as mutable more than once at a time
--> $DIR/borrowck-anon-fields-tuple.rs:37:10
|
Expand All @@ -34,7 +10,6 @@ LL | (ref mut b, _) => b //~ ERROR cannot borrow
LL | *a += 1;
| ------- borrow later used here

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

Some errors occurred: E0499, E0502.
For more information about an error, try `rustc --explain E0499`.
For more information about this error, try `rustc --explain E0499`.
29 changes: 2 additions & 27 deletions src/test/ui/borrowck/borrowck-anon-fields-variant.nll.stderr
@@ -1,27 +1,3 @@
error[E0502]: cannot borrow `y` as immutable because it is also borrowed as mutable
--> $DIR/borrowck-anon-fields-variant.rs:26:19
|
LL | Foo::Y(ref mut a, _) => a,
| --------- mutable borrow occurs here
...
LL | let b = match y {
| ^ immutable borrow occurs here
...
LL | *a += 1;
| ------- borrow later used here

error[E0502]: cannot borrow `y` as immutable because it is also borrowed as mutable
--> $DIR/borrowck-anon-fields-variant.rs:43:19
|
LL | Foo::Y(ref mut a, _) => a,
| --------- mutable borrow occurs here
...
LL | let b = match y {
| ^ immutable borrow occurs here
...
LL | *a += 1;
| ------- borrow later used here

error[E0499]: cannot borrow `y.0` as mutable more than once at a time
--> $DIR/borrowck-anon-fields-variant.rs:44:14
|
Expand All @@ -34,7 +10,6 @@ LL | Foo::Y(ref mut b, _) => b, //~ ERROR cannot borrow
LL | *a += 1;
| ------- borrow later used here

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

Some errors occurred: E0499, E0502.
For more information about an error, try `rustc --explain E0499`.
For more information about this error, try `rustc --explain E0499`.
13 changes: 1 addition & 12 deletions src/test/ui/borrowck/borrowck-borrow-from-owned-ptr.nll.stderr
Expand Up @@ -28,17 +28,6 @@ LL | let _bar2 = &mut foo.bar1; //~ ERROR cannot borrow
LL | *bar1;
| ----- borrow later used here

error[E0502]: cannot borrow `*foo` as immutable because it is also borrowed as mutable
--> $DIR/borrowck-borrow-from-owned-ptr.rs:72:11
|
LL | let bar1 = &mut foo.bar1;
| ------------- mutable borrow occurs here
LL | match *foo {
| ^^^^ immutable borrow occurs here
...
LL | *bar1;
| ----- borrow later used here

error[E0499]: cannot borrow `foo.bar1` as mutable more than once at a time
--> $DIR/borrowck-borrow-from-owned-ptr.rs:73:21
|
Expand Down Expand Up @@ -121,7 +110,7 @@ LL | let foo = make_foo();
LL | let bar1 = &mut foo.bar1; //~ ERROR cannot borrow
| ^^^^^^^^^^^^^ cannot borrow as mutable

error: aborting due to 12 previous errors
error: aborting due to 11 previous errors

Some errors occurred: E0499, E0502, E0596.
For more information about an error, try `rustc --explain E0499`.
Expand Up @@ -28,17 +28,6 @@ LL | let _bar2 = &mut foo.bar1; //~ ERROR cannot borrow
LL | *bar1;
| ----- borrow later used here

error[E0502]: cannot borrow `foo` as immutable because it is also borrowed as mutable
--> $DIR/borrowck-borrow-from-stack-variable.rs:70:11
|
LL | let bar1 = &mut foo.bar1;
| ------------- mutable borrow occurs here
LL | match foo {
| ^^^ immutable borrow occurs here
...
LL | *bar1;
| ----- borrow later used here

error[E0499]: cannot borrow `foo.bar1` as mutable more than once at a time
--> $DIR/borrowck-borrow-from-stack-variable.rs:71:21
|
Expand Down Expand Up @@ -121,7 +110,7 @@ LL | let foo = make_foo();
LL | let bar1 = &mut foo.bar1; //~ ERROR cannot borrow
| ^^^^^^^^^^^^^ cannot borrow as mutable

error: aborting due to 12 previous errors
error: aborting due to 11 previous errors

Some errors occurred: E0499, E0502, E0596.
For more information about an error, try `rustc --explain E0499`.

0 comments on commit 1a6ed02

Please sign in to comment.