diff options
| author | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2018-04-20 14:18:29 +0200 |
|---|---|---|
| committer | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2018-04-24 13:11:48 +0200 |
| commit | cd6c186e4eb410413522e2be2ef6309edf3d0b32 (patch) | |
| tree | fe3f5e008cd252804e323c692124386384bf5197 /src/test/ui/const-eval/conditional_array_execution.stderr | |
| parent | 52ed3d8761dc42e51429eb3bbf56a94d14fdd5c6 (diff) | |
Warn on all erroneous constants
Diffstat (limited to 'src/test/ui/const-eval/conditional_array_execution.stderr')
| -rw-r--r-- | src/test/ui/const-eval/conditional_array_execution.stderr | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/test/ui/const-eval/conditional_array_execution.stderr b/src/test/ui/const-eval/conditional_array_execution.stderr index fd29990fec2..713b1b36c08 100644 --- a/src/test/ui/const-eval/conditional_array_execution.stderr +++ b/src/test/ui/const-eval/conditional_array_execution.stderr @@ -6,8 +6,14 @@ LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize]; | = note: #[warn(const_err)] on by default +warning: this constant cannot be used + --> $DIR/conditional_array_execution.rs:15:1 + | +LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize]; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to subtract with overflow + warning: constant evaluation error - --> $DIR/conditional_array_execution.rs:19:20 + --> $DIR/conditional_array_execution.rs:20:20 | LL | println!("{}", FOO); | ^^^ referenced constant has errors |
