Skip to content

Commit

Permalink
Adjust & --bless tests due to no longer downgrading NLL errors on 2015.
Browse files Browse the repository at this point in the history
  • Loading branch information
Centril committed Sep 25, 2019
1 parent 0c7c98f commit b9eaad2
Show file tree
Hide file tree
Showing 39 changed files with 104 additions and 1,174 deletions.
40 changes: 0 additions & 40 deletions src/test/ui/borrowck/borrowck-anon-fields-variant.nll.stderr

This file was deleted.

4 changes: 1 addition & 3 deletions src/test/ui/borrowck/borrowck-anon-fields-variant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ fn distinct_variant() {
// reference.
let b = match y {
Foo::Y(_, ref mut b) => b,
//~^ WARNING cannot use `y`
//~| WARNING this error has been downgraded to a warning
//~| WARNING this warning will become a hard error in the future
//~^ ERROR cannot use `y`
Foo::X => panic!()
};

Expand Down
12 changes: 4 additions & 8 deletions src/test/ui/borrowck/borrowck-anon-fields-variant.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
warning[E0503]: cannot use `y` because it was mutably borrowed
error[E0503]: cannot use `y` because it was mutably borrowed
--> $DIR/borrowck-anon-fields-variant.rs:17:7
|
LL | Foo::Y(ref mut a, _) => a,
Expand All @@ -9,13 +9,9 @@ LL | Foo::Y(_, ref mut b) => b,
...
LL | *a += 1;
| ------- borrow later used here
|
= warning: this error has been downgraded to a warning for backwards compatibility with previous releases
= warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
= note: for more information, try `rustc --explain E0729`

error[E0503]: cannot use `y` because it was mutably borrowed
--> $DIR/borrowck-anon-fields-variant.rs:37:7
--> $DIR/borrowck-anon-fields-variant.rs:35:7
|
LL | Foo::Y(ref mut a, _) => a,
| --------- borrow of `y.0` occurs here
Expand All @@ -27,7 +23,7 @@ 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:37:14
--> $DIR/borrowck-anon-fields-variant.rs:35:14
|
LL | Foo::Y(ref mut a, _) => a,
| --------- first mutable borrow occurs here
Expand All @@ -38,7 +34,7 @@ LL | Foo::Y(ref mut b, _) => b,
LL | *a += 1;
| ------- first borrow later used here

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

Some errors have detailed explanations: E0499, E0503.
For more information about an error, try `rustc --explain E0499`.
Loading

0 comments on commit b9eaad2

Please sign in to comment.