diff options
| author | Oliver Schneider <github35764891676564198441@oli-obk.de> | 2018-07-18 14:23:07 +0200 |
|---|---|---|
| committer | Oliver Schneider <github35764891676564198441@oli-obk.de> | 2018-07-18 18:52:43 +0200 |
| commit | 9329957d321a3612fe9c95cf58a67115b0bbda5f (patch) | |
| tree | e2d1fb7fb1508f6d00bde640f2a5df837c30c89d /src/test/ui/const-eval | |
| parent | 1f4e21028d34c0aeccc4c7b21e0d9ce044c5646c (diff) | |
Const-propagate casts
Diffstat (limited to 'src/test/ui/const-eval')
| -rw-r--r-- | src/test/ui/const-eval/promoted_errors.rs | 3 | ||||
| -rw-r--r-- | src/test/ui/const-eval/promoted_errors.stderr | 18 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/test/ui/const-eval/promoted_errors.rs b/src/test/ui/const-eval/promoted_errors.rs index a39afb9bdd4..04e9bfbc03e 100644 --- a/src/test/ui/const-eval/promoted_errors.rs +++ b/src/test/ui/const-eval/promoted_errors.rs @@ -24,5 +24,8 @@ fn main() { //~| WARN const_err println!("{}", 1/(false as u32)); //~^ WARN const_err + //~| WARN const_err let _x = 1/(false as u32); + //~^ WARN const_err + //~| WARN const_err } diff --git a/src/test/ui/const-eval/promoted_errors.stderr b/src/test/ui/const-eval/promoted_errors.stderr index a4c1c48a03d..9afe5f20af3 100644 --- a/src/test/ui/const-eval/promoted_errors.stderr +++ b/src/test/ui/const-eval/promoted_errors.stderr @@ -34,9 +34,27 @@ warning: this expression will panic at runtime LL | let _x = 1/(1-1); | ^^^^^^^ attempt to divide by zero +warning: attempt to divide by zero + --> $DIR/promoted_errors.rs:25:20 + | +LL | println!("{}", 1/(false as u32)); + | ^^^^^^^^^^^^^^^^ + warning: this expression will panic at runtime --> $DIR/promoted_errors.rs:25:20 | LL | println!("{}", 1/(false as u32)); | ^^^^^^^^^^^^^^^^ attempt to divide by zero +warning: attempt to divide by zero + --> $DIR/promoted_errors.rs:28:14 + | +LL | let _x = 1/(false as u32); + | ^^^^^^^^^^^^^^^^ + +warning: this expression will panic at runtime + --> $DIR/promoted_errors.rs:28:14 + | +LL | let _x = 1/(false as u32); + | ^^^^^^^^^^^^^^^^ attempt to divide by zero + |
