diff --git a/clippy_lints/src/eta_reduction.rs b/clippy_lints/src/eta_reduction.rs index 2b68277ac366..30436716ff95 100644 --- a/clippy_lints/src/eta_reduction.rs +++ b/clippy_lints/src/eta_reduction.rs @@ -147,7 +147,7 @@ fn get_ufcs_type_name( }) } -fn match_borrow_depth(lhs: &ty::Ty<'_>, rhs: &ty::Ty<'_>) -> bool { +fn match_borrow_depth(lhs: ty::Ty<'_>, rhs: ty::Ty<'_>) -> bool { match (&lhs.sty, &rhs.sty) { (ty::Ref(_, t1, _), ty::Ref(_, t2, _)) => match_borrow_depth(&t1, &t2), (l, r) => match (l, r) { @@ -157,7 +157,7 @@ fn match_borrow_depth(lhs: &ty::Ty<'_>, rhs: &ty::Ty<'_>) -> bool { } } -fn match_types(lhs: &ty::Ty<'_>, rhs: &ty::Ty<'_>) -> bool { +fn match_types(lhs: ty::Ty<'_>, rhs: ty::Ty<'_>) -> bool { match (&lhs.sty, &rhs.sty) { (ty::Bool, ty::Bool) | (ty::Char, ty::Char) @@ -172,7 +172,7 @@ fn match_types(lhs: &ty::Ty<'_>, rhs: &ty::Ty<'_>) -> bool { } } -fn get_type_name(cx: &LateContext<'_, '_>, ty: &ty::Ty<'_>) -> String { +fn get_type_name(cx: &LateContext<'_, '_>, ty: ty::Ty<'_>) -> String { match ty.sty { ty::Adt(t, _) => cx.tcx.def_path_str(t.did), ty::Ref(_, r, _) => get_type_name(cx, &r), diff --git a/clippy_lints/src/utils/mod.rs b/clippy_lints/src/utils/mod.rs index 0b2e47fc86a2..c91065e5c1c8 100644 --- a/clippy_lints/src/utils/mod.rs +++ b/clippy_lints/src/utils/mod.rs @@ -104,6 +104,7 @@ pub struct AbsolutePathPrinter<'a, 'tcx> { use rustc::ty::print::Printer; +#[allow(clippy::diverging_sub_expression)] impl<'tcx> Printer<'tcx, 'tcx> for AbsolutePathPrinter<'_, 'tcx> { type Error = !;