fix: Fix double rounding of f32 literals

This commit is contained in:
beetrees 2024-07-07 14:27:14 +01:00
parent a5b21ea0aa
commit 320022622c
No known key found for this signature in database
GPG key ID: 8791BD754191EBD6
4 changed files with 47 additions and 33 deletions

View file

@ -5310,6 +5310,28 @@ const FOO$0: f64 = expf64(1.2);
```
"#]],
);
// check `f32` isn't double rounded via `f64`
check(
r#"
/// This is a doc
const FOO$0: f32 = 1.9999999403953552_f32;
"#,
expect![[r#"
*FOO*
```rust
test
```
```rust
const FOO: f32 = 1.9999999
```
---
This is a doc
"#]],
);
}
#[test]