1
Fork 0

Fix lines that exceed max width manually

This commit is contained in:
topecongiro 2017-11-05 04:56:05 +09:00
parent 7a06d312fd
commit a6c71e9c0d
8 changed files with 55 additions and 22 deletions

View file

@ -49,9 +49,16 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
| (_, FloatWidth::F64) => "f64",
_ => "f32"
};
span_help_and_lint(cx, ZERO_DIVIDED_BY_ZERO, expr.span,
span_help_and_lint(
cx,
ZERO_DIVIDED_BY_ZERO,
expr.span,
"constant division of 0.0 with 0.0 will always result in NaN",
&format!("Consider using `std::{}::NAN` if you would like a constant representing NaN", float_type));
&format!(
"Consider using `std::{}::NAN` if you would like a constant representing NaN",
float_type,
),
);
}
}
}