From 53139c51c1122e7108033a2da08fe490a47c25cc Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Sun, 23 Feb 2020 17:44:33 -0500 Subject: [PATCH] Correct stderr output for failing tests --- .../const-eval/validate_uninhabited_zsts.rs | 4 ++-- .../validate_uninhabited_zsts.stderr | 18 ++++++++++-------- .../async-generator-issue-67158.stderr | 1 - 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.rs b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.rs index f18e00fd633ea..59757908acd1e 100644 --- a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.rs +++ b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.rs @@ -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] } @@ -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 diff --git a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.stderr b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.stderr index bde7f2536fac1..2ea173cdd9930 100644 --- a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.stderr +++ b/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 @@ -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`. diff --git a/src/test/ui/generator/async-generator-issue-67158.stderr b/src/test/ui/generator/async-generator-issue-67158.stderr index 7270d188e8b88..c2ea55c1e7203 100644 --- a/src/test/ui/generator/async-generator-issue-67158.stderr +++ b/src/test/ui/generator/async-generator-issue-67158.stderr @@ -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`.