Cleanup misc::check_nan
This was a bit messed up after a bigger rebase.
This commit is contained in:
parent
991a30237a
commit
ca60e8a2a0
|
@ -433,16 +433,14 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
|
||||||
fn check_nan(cx: &LateContext, path: &Path, expr: &Expr) {
|
fn check_nan(cx: &LateContext, path: &Path, expr: &Expr) {
|
||||||
if !in_constant(cx, expr.id) {
|
if !in_constant(cx, expr.id) {
|
||||||
if let Some(seg) = path.segments.last() {
|
if let Some(seg) = path.segments.last() {
|
||||||
path.segments.last().map(|seg| {
|
if seg.name == "NAN" {
|
||||||
if seg.name == "NAN" {
|
span_lint(
|
||||||
span_lint(
|
cx,
|
||||||
cx,
|
CMP_NAN,
|
||||||
CMP_NAN,
|
expr.span,
|
||||||
expr.span,
|
"doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead",
|
||||||
"doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead",
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue