no-integer-division-in-float-context Disallow integer division whose result immediately becomes a float Converting the result of integer division to a float preserves the already-truncated integer quotient. Instead, you SHOULD convert both operands to the intended floating-point type before dividing them. - Category: correctness - Level: warning - Fix: suggestion - Scope: module Reported function ratio(left: int32, right: int32): float64 { return (left / right) as float64; } Accepted function ratio(left: int32, right: int32): float64 { return (left as float64) / (right as float64); } Prior art - Clippy ยท integerdivision language/linter/src/rules/correctness/nointegerdivisioninfloatcontext.rs:8