diff options
| author | llogiq <bogusandre@gmail.com> | 2025-07-06 15:18:52 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-06 15:18:52 +0000 |
| commit | 412def25d513aced025b52ba4092b5e103117776 (patch) | |
| tree | 20e5f9e09d20d52d3e11c37a7bb0d6498cf47104 /compiler/rustc_llvm/llvm-wrapper/ArchiveWrapper.cpp | |
| parent | 60d57851ad7c4c0d1377a05a123a71c2b5aababf (diff) | |
| parent | 0c0a4d559263cb56e96825be356b540d380d13d4 (diff) | |
| download | rust-412def25d513aced025b52ba4092b5e103117776.tar.gz rust-412def25d513aced025b52ba4092b5e103117776.zip | |
fix: Improve floating point lint to handle ambiguous type (#15133)
Fixes: rust-lang/rust-clippy#14897, rust-lang/rust-clippy#10015 This is not a perfect solution, but it fixes the issue. Happy to discuss further with the clippy team. This PR refines check_mul_add to avoid false positives on ambiguous float types (e.g., f32 vs f64). It improves type detection and ensures mul_add is only suggested when the type is clear. Changes: - Improved detection of ambiguous float types - Refined mul_add suggestion logic - Added tests for ambiguous cases ## Example Before this change, expressions like: ```rust let x = 1.0; // ambiguous type let _ = x * 2.0 + 0.5; // could incorrectly suggest mul_add ``` ---- changelog: [`suboptimal_flops`]: improve handling of ambiguous float types in mul_add suggestions
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/ArchiveWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
