diff options
| author | Oliver Schneider <github35764891676564198441@oli-obk.de> | 2018-06-27 13:36:30 +0200 |
|---|---|---|
| committer | Oliver Schneider <github35764891676564198441@oli-obk.de> | 2018-06-28 11:04:25 +0200 |
| commit | 4eea1a4e5e28a9a84579ee6a52f115375adefde6 (patch) | |
| tree | e1cb8479f2e57b83a38e83060cf33025c08d5cb7 /src/test/ui/const-eval/conditional_array_execution.stderr | |
| parent | 4bb9648b27e2c9f9efdb9e29a0d90b229aaff562 (diff) | |
Don't const propagate the body of 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 | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/src/test/ui/const-eval/conditional_array_execution.stderr b/src/test/ui/const-eval/conditional_array_execution.stderr index 64010c946a7..8a1b7572179 100644 --- a/src/test/ui/const-eval/conditional_array_execution.stderr +++ b/src/test/ui/const-eval/conditional_array_execution.stderr @@ -1,8 +1,10 @@ -warning: attempt to subtract with overflow - --> $DIR/conditional_array_execution.rs:15:19 +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 | note: lint level defined here --> $DIR/conditional_array_execution.rs:11:9 @@ -10,16 +12,8 @@ note: lint level defined here LL | #![warn(const_err)] | ^^^^^^^^^ -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: referenced constant - --> $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 @@ -28,13 +22,13 @@ LL | println!("{}", FOO); | ^^^ warning: this expression will panic at runtime - --> $DIR/conditional_array_execution.rs:20:20 + --> $DIR/conditional_array_execution.rs:19:20 | LL | println!("{}", FOO); | ^^^ referenced constant has errors error[E0080]: referenced constant - --> $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 @@ -43,7 +37,7 @@ LL | println!("{}", FOO); | ^^^ error[E0080]: erroneous constant used - --> $DIR/conditional_array_execution.rs:20:20 + --> $DIR/conditional_array_execution.rs:19:20 | LL | println!("{}", FOO); | ^^^ referenced constant has errors |
