diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2021-10-01 16:14:35 -0700 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2021-10-01 16:14:35 -0700 |
| commit | 51160808b8d9821079896baed1023be446555cc4 (patch) | |
| tree | d6476de7c161277d35f8006dc418201e6f410f90 | |
| parent | fe999e88edd2254124be6419607bd29156841f59 (diff) | |
| download | rust-51160808b8d9821079896baed1023be446555cc4.tar.gz rust-51160808b8d9821079896baed1023be446555cc4.zip | |
Add regression test
| -rw-r--r-- | tests/ui/excessive_precision.fixed | 3 | ||||
| -rw-r--r-- | tests/ui/excessive_precision.rs | 3 | ||||
| -rw-r--r-- | tests/ui/excessive_precision.stderr | 8 |
3 files changed, 13 insertions, 1 deletions
diff --git a/tests/ui/excessive_precision.fixed b/tests/ui/excessive_precision.fixed index 90376620a9f..f57191d2ae5 100644 --- a/tests/ui/excessive_precision.fixed +++ b/tests/ui/excessive_precision.fixed @@ -60,4 +60,7 @@ fn main() { // issue #2840 let num = 0.000_000_000_01e-10f64; + + // issue #7744 + let _ = 2.225_073_858_507_201e-_308_f64; } diff --git a/tests/ui/excessive_precision.rs b/tests/ui/excessive_precision.rs index ce4722a90f9..4db6e4d4831 100644 --- a/tests/ui/excessive_precision.rs +++ b/tests/ui/excessive_precision.rs @@ -60,4 +60,7 @@ fn main() { // issue #2840 let num = 0.000_000_000_01e-10f64; + + // issue #7744 + let _ = 2.225_073_858_507_201_1e-308_f64; } diff --git a/tests/ui/excessive_precision.stderr b/tests/ui/excessive_precision.stderr index e59c20c30b4..4c8194b1d86 100644 --- a/tests/ui/excessive_precision.stderr +++ b/tests/ui/excessive_precision.stderr @@ -78,5 +78,11 @@ error: float has excessive precision LL | let bad_bige32: f32 = 1.123_456_788_888E-10; | ^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `1.123_456_8E-10` -error: aborting due to 13 previous errors +error: float has excessive precision + --> $DIR/excessive_precision.rs:65:13 + | +LL | let _ = 2.225_073_858_507_201_1e-308_f64; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `2.225_073_858_507_201e-_308_f64` + +error: aborting due to 14 previous errors |
