Dogfood new trivially_copy_pass_by_ref lint

This commit is contained in:
Wim Looman
2018-05-31 20:15:48 +02:00
committed by Wim Looman
parent 700ece5648
commit 621fdcc3bc
15 changed files with 91 additions and 91 deletions

View File

@@ -71,14 +71,14 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
fn check_lit(cx: &LateContext, lit: &Lit, e: &Expr) {
match lit.node {
LitKind::Float(ref s, FloatTy::F32) => check_known_consts(cx, e, s, "f32"),
LitKind::Float(ref s, FloatTy::F64) => check_known_consts(cx, e, s, "f64"),
LitKind::FloatUnsuffixed(ref s) => check_known_consts(cx, e, s, "f{32, 64}"),
LitKind::Float(s, FloatTy::F32) => check_known_consts(cx, e, s, "f32"),
LitKind::Float(s, FloatTy::F64) => check_known_consts(cx, e, s, "f64"),
LitKind::FloatUnsuffixed(s) => check_known_consts(cx, e, s, "f{32, 64}"),
_ => (),
}
}
fn check_known_consts(cx: &LateContext, e: &Expr, s: &symbol::Symbol, module: &str) {
fn check_known_consts(cx: &LateContext, e: &Expr, s: symbol::Symbol, module: &str) {
let s = s.as_str();
if s.parse::<f64>().is_ok() {
for &(constant, name, min_digits) in KNOWN_CONSTS {