Skip to content

Commit e476d05

Browse files
committed
Add tests for zero exponents in excessive_precision
1 parent 42f2304 commit e476d05

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

tests/ui/excessive_precision.fixed

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,7 @@ fn main() {
6363

6464
// issue #7744
6565
let _ = 2.225_073_858_507_201e-308_f64;
66+
67+
// issue #7745
68+
let _ = 0_f64;
6669
}

tests/ui/excessive_precision.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,7 @@ fn main() {
6363

6464
// issue #7744
6565
let _ = 2.225_073_858_507_201_1e-308_f64;
66+
67+
// issue #7745
68+
let _ = 1.000_000_000_000_001e-324_f64;
6669
}

tests/ui/excessive_precision.stderr

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,11 @@ error: float has excessive precision
8484
LL | let _ = 2.225_073_858_507_201_1e-308_f64;
8585
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `2.225_073_858_507_201e-308_f64`
8686

87-
error: aborting due to 14 previous errors
87+
error: float has excessive precision
88+
--> $DIR/excessive_precision.rs:68:13
89+
|
90+
LL | let _ = 1.000_000_000_000_001e-324_f64;
91+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `0_f64`
92+
93+
error: aborting due to 15 previous errors
8894

0 commit comments

Comments
 (0)