diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2018-10-17 18:23:43 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2018-10-19 09:34:28 -0400 |
| commit | a66ab2bedcc2ac34086d17753f777ffe31dc6349 (patch) | |
| tree | 3d5d005e0bb321cd2dac736160138c5b246bc96d /src/test | |
| parent | d5d5e8c5f52ccc5f88f8cf691118e364e64bf75b (diff) | |
skip user-type annotations if they don't have regions
Diffstat (limited to 'src/test')
3 files changed, 4 insertions, 19 deletions
diff --git a/src/test/ui/consts/const-eval/conditional_array_execution.rs b/src/test/ui/consts/const-eval/conditional_array_execution.rs index 9a6ffcd2c67..8142ed0155a 100644 --- a/src/test/ui/consts/const-eval/conditional_array_execution.rs +++ b/src/test/ui/consts/const-eval/conditional_array_execution.rs @@ -14,7 +14,6 @@ const X: u32 = 5; const Y: u32 = 6; const FOO: u32 = [X - Y, Y - X][(X < Y) as usize]; //~^ WARN this constant cannot be used -//~| ERROR fn main() { println!("{}", FOO); diff --git a/src/test/ui/consts/const-eval/conditional_array_execution.stderr b/src/test/ui/consts/const-eval/conditional_array_execution.stderr index b22a8d8aead..29f5f8e2ade 100644 --- a/src/test/ui/consts/const-eval/conditional_array_execution.stderr +++ b/src/test/ui/consts/const-eval/conditional_array_execution.stderr @@ -13,7 +13,7 @@ LL | #![warn(const_err)] | ^^^^^^^^^ error[E0080]: referenced constant has errors - --> $DIR/conditional_array_execution.rs:20:20 + --> $DIR/conditional_array_execution.rs:19:20 | LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize]; | ----- attempt to subtract with overflow @@ -21,20 +21,12 @@ LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize]; LL | println!("{}", FOO); | ^^^ -error[E0080]: could not evaluate constant - --> $DIR/conditional_array_execution.rs:20:20 +error[E0080]: erroneous constant used + --> $DIR/conditional_array_execution.rs:19:20 | LL | println!("{}", FOO); | ^^^ referenced constant has errors -error[E0080]: constant evaluation error - --> $DIR/conditional_array_execution.rs:15:1 - | -LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize]; - | ^^^^^^^^^^^^^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | attempt to subtract with overflow - -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0080`. diff --git a/src/test/ui/consts/const-eval/promoted_errors.stderr b/src/test/ui/consts/const-eval/promoted_errors.stderr index 1c4868c2af9..85b5696be94 100644 --- a/src/test/ui/consts/const-eval/promoted_errors.stderr +++ b/src/test/ui/consts/const-eval/promoted_errors.stderr @@ -34,12 +34,6 @@ warning: attempt to divide by zero LL | println!("{}", 1/(false as u32)); | ^^^^^^^^^^^^^^^^ -warning: this expression will panic at runtime - --> $DIR/promoted_errors.rs:24:20 - | -LL | println!("{}", 1/(false as u32)); - | ^^^^^^^^^^^^^^^^ attempt to divide by zero - warning: attempt to divide by zero --> $DIR/promoted_errors.rs:26:14 | |
