Skip to content

Commit

Permalink
Correct stderr output for failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Simulacrum committed Feb 24, 2020
1 parent 6d4e588 commit 53139c5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/test/ui/consts/const-eval/validate_uninhabited_zsts.rs
Expand Up @@ -3,7 +3,7 @@

const fn foo() -> ! {
unsafe { std::mem::transmute(()) }
//~^ WARN any use of this value will cause an error [const_err]
//~^ ERROR evaluation of constant value failed
//~| WARN the type `!` does not permit zero-initialization [invalid_value]
}

Expand All @@ -12,7 +12,7 @@ enum Empty { }

#[warn(const_err)]
const FOO: [Empty; 3] = [foo(); 3];

//~^ WARN any use of this value will cause an error
#[warn(const_err)]
const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
//~^ ERROR it is undefined behavior to use this value
Expand Down
18 changes: 10 additions & 8 deletions src/test/ui/consts/const-eval/validate_uninhabited_zsts.stderr
@@ -1,14 +1,16 @@
warning: any use of this value will cause an error
error[E0080]: evaluation of constant value failed
--> $DIR/validate_uninhabited_zsts.rs:5:14
|
LL | unsafe { std::mem::transmute(()) }
| ^^^^^^^^^^^^^^^^^^^^^^^
| |
| entering unreachable code
| inside call to `foo` at $DIR/validate_uninhabited_zsts.rs:14:26
...
| ^^^^^^^^^^^^^^^^^^^^^^^ entering unreachable code

warning: any use of this value will cause an error
--> $DIR/validate_uninhabited_zsts.rs:14:26
|
LL | const FOO: [Empty; 3] = [foo(); 3];
| -----------------------------------
| -------------------------^^^^^-----
| |
| referenced constant has errors
|
note: lint level defined here
--> $DIR/validate_uninhabited_zsts.rs:13:8
Expand Down Expand Up @@ -47,6 +49,6 @@ LL | const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
|
= note: 0-variant enums have no valid value

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

For more information about this error, try `rustc --explain E0080`.
1 change: 0 additions & 1 deletion src/test/ui/generator/async-generator-issue-67158.stderr
Expand Up @@ -6,4 +6,3 @@ LL | async { yield print!(":C") };

error: aborting due to previous error

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

0 comments on commit 53139c5

Please sign in to comment.