about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs
diff options
context:
space:
mode:
authorDan Gohman <dev@sunfishcode.online>2022-05-02 13:46:29 -0700
committerDan Gohman <dev@sunfishcode.online>2022-05-02 13:52:13 -0700
commit6ff77b96f11143cf63f3522e4ffee4568b72330c (patch)
tree7ebab0184d933ad766c3bd5af28c2417b3faa4f7 /src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs
parent95f8b2600240022f0a82e703b35d4bc14a42eb1b (diff)
downloadrust-6ff77b96f11143cf63f3522e4ffee4568b72330c.tar.gz
rust-6ff77b96f11143cf63f3522e4ffee4568b72330c.zip
Fix `cast_lossless` to avoid warning on `usize` to `f64` conversion.
Previously, the `cast_lossless` lint would issue a warning on code that
converted a `usize` value to `f64`, on 32-bit targets.

`usize` to `f64` is a lossless cast on 32-bit targets, however there is
no corresponding `f64::from` that takes a `usize`, so `cast_lossless`'s
suggested replacement does not compile.

This PR disables the lint in the case of casting from `usize` or `isize`.

Fixes #3689.

changelog: [`cast_lossless`] no longer gives wrong suggestion on usize->f64
Diffstat (limited to 'src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs')
0 files changed, 0 insertions, 0 deletions