diff options
| author | Oliver Schneider <github35764891676564198441@oli-obk.de> | 2018-05-17 12:07:00 +0200 |
|---|---|---|
| committer | Oliver Schneider <github35764891676564198441@oli-obk.de> | 2018-05-19 13:10:51 +0200 |
| commit | d81651e8e9af5c8c40a4bd9b6b7becf12486bdad (patch) | |
| tree | 9e645a6f5644a4884aa5590270c94f504af0263c /src/test/ui | |
| parent | bdace29de04af4fe9e4317b73c3f7d6418a33de1 (diff) | |
| download | rust-d81651e8e9af5c8c40a4bd9b6b7becf12486bdad.tar.gz rust-d81651e8e9af5c8c40a4bd9b6b7becf12486bdad.zip | |
Release mode overflows should not cause const eval to error
Diffstat (limited to 'src/test/ui')
| -rw-r--r-- | src/test/ui/const-eval/promoted_errors.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/const-eval/promoted_errors.stderr | 28 |
2 files changed, 8 insertions, 22 deletions
diff --git a/src/test/ui/const-eval/promoted_errors.rs b/src/test/ui/const-eval/promoted_errors.rs index 7385860abae..a39afb9bdd4 100644 --- a/src/test/ui/const-eval/promoted_errors.rs +++ b/src/test/ui/const-eval/promoted_errors.rs @@ -14,8 +14,6 @@ // compile-flags: -O fn main() { println!("{}", 0u32 - 1); - //~^ WARN const_err - //~| WARN const_err let _x = 0u32 - 1; //~^ WARN const_err println!("{}", 1/(1-1)); diff --git a/src/test/ui/const-eval/promoted_errors.stderr b/src/test/ui/const-eval/promoted_errors.stderr index 8e9a0ea43a4..683ee5375fb 100644 --- a/src/test/ui/const-eval/promoted_errors.stderr +++ b/src/test/ui/const-eval/promoted_errors.stderr @@ -1,8 +1,8 @@ warning: constant evaluation error - --> $DIR/promoted_errors.rs:16:20 + --> $DIR/promoted_errors.rs:17:14 | -LL | println!("{}", 0u32 - 1); - | ^^^^^^^^ attempt to subtract with overflow +LL | let _x = 0u32 - 1; + | ^^^^^^^^ attempt to subtract with overflow | note: lint level defined here --> $DIR/promoted_errors.rs:11:9 @@ -10,44 +10,32 @@ note: lint level defined here LL | #![warn(const_err)] | ^^^^^^^^^ -warning: constant evaluation error - --> $DIR/promoted_errors.rs:16:20 - | -LL | println!("{}", 0u32 - 1); - | ^^^^^^^^ attempt to subtract with overflow - -warning: constant evaluation error - --> $DIR/promoted_errors.rs:19:14 - | -LL | let _x = 0u32 - 1; - | ^^^^^^^^ attempt to subtract with overflow - warning: attempt to divide by zero - --> $DIR/promoted_errors.rs:21:20 + --> $DIR/promoted_errors.rs:19:20 | LL | println!("{}", 1/(1-1)); | ^^^^^^^ warning: constant evaluation error - --> $DIR/promoted_errors.rs:21:20 + --> $DIR/promoted_errors.rs:19:20 | LL | println!("{}", 1/(1-1)); | ^^^^^^^ attempt to divide by zero warning: attempt to divide by zero - --> $DIR/promoted_errors.rs:24:14 + --> $DIR/promoted_errors.rs:22:14 | LL | let _x = 1/(1-1); | ^^^^^^^ warning: constant evaluation error - --> $DIR/promoted_errors.rs:24:14 + --> $DIR/promoted_errors.rs:22:14 | LL | let _x = 1/(1-1); | ^^^^^^^ attempt to divide by zero warning: constant evaluation error - --> $DIR/promoted_errors.rs:27:20 + --> $DIR/promoted_errors.rs:25:20 | LL | println!("{}", 1/(false as u32)); | ^^^^^^^^^^^^^^^^ attempt to divide by zero |
