diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2018-10-18 05:58:20 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2018-10-19 09:34:28 -0400 |
| commit | d5d5e8c5f52ccc5f88f8cf691118e364e64bf75b (patch) | |
| tree | 2fcedb722ee17271631f294a79d1676456417e7e /src/test/ui/consts/const-eval/conditional_array_execution.stderr | |
| parent | 26fdac62244233a6dae0240ea649c49c188cc1b6 (diff) | |
lowering casts in constants now creates multiple uses
This can trigger more errors than before. Not sure what is the best fix here.
Diffstat (limited to 'src/test/ui/consts/const-eval/conditional_array_execution.stderr')
| -rw-r--r-- | src/test/ui/consts/const-eval/conditional_array_execution.stderr | 16 |
1 files changed, 12 insertions, 4 deletions
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 29f5f8e2ade..b22a8d8aead 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:19:20 + --> $DIR/conditional_array_execution.rs:20:20 | LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize]; | ----- attempt to subtract with overflow @@ -21,12 +21,20 @@ LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize]; LL | println!("{}", FOO); | ^^^ -error[E0080]: erroneous constant used - --> $DIR/conditional_array_execution.rs:19:20 +error[E0080]: could not evaluate constant + --> $DIR/conditional_array_execution.rs:20:20 | LL | println!("{}", FOO); | ^^^ referenced constant has errors -error: aborting due to 2 previous 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 For more information about this error, try `rustc --explain E0080`. |
