mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-18 19:43:43 +00:00
commit
4796ea0558
@ -167,8 +167,9 @@ impl LateLintPass for FloatCmp {
|
|||||||
span_lint(cx,
|
span_lint(cx,
|
||||||
FLOAT_CMP,
|
FLOAT_CMP,
|
||||||
expr.span,
|
expr.span,
|
||||||
&format!("{}-comparison of f32 or f64 detected. Consider changing this to `abs({} - {}) < \
|
&format!("{}-comparison of f32 or f64 detected. Consider changing this to `({} - {}).abs() < \
|
||||||
epsilon` for some suitable value of epsilon",
|
epsilon` for some suitable value of epsilon. \
|
||||||
|
std::f32::EPSILON and std::f64::EPSILON are available.",
|
||||||
binop_to_string(op),
|
binop_to_string(op),
|
||||||
snippet(cx, left.span, ".."),
|
snippet(cx, left.span, ".."),
|
||||||
snippet(cx, right.span, "..")));
|
snippet(cx, right.span, "..")));
|
||||||
|
Loading…
Reference in New Issue
Block a user