diff --git a/clippy_lints/src/identity_op.rs b/clippy_lints/src/identity_op.rs index 23b34362171..8a58f2681d6 100644 --- a/clippy_lints/src/identity_op.rs +++ b/clippy_lints/src/identity_op.rs @@ -63,7 +63,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for IdentityOp { fn check(cx: &LateContext<'_, '_>, e: &Expr, m: i8, span: Span, arg: Span) { if let Some(Constant::Int(v)) = constant_simple(cx, cx.tables, e) { let check = match cx.tables.expr_ty(e).sty { - ty::TyInt(ity) => unsext(cx.tcx, -1i128, ity), + ty::TyInt(ity) => unsext(cx.tcx, -1_i128, ity), ty::TyUint(uty) => clip(cx.tcx, !0, uty), _ => return, }; diff --git a/clippy_lints/src/non_copy_const.rs b/clippy_lints/src/non_copy_const.rs index f2c9210aae4..119b4c2d861 100644 --- a/clippy_lints/src/non_copy_const.rs +++ b/clippy_lints/src/non_copy_const.rs @@ -244,9 +244,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonCopyConst { } } - let ty = if !needs_check_adjustment { - cx.tables.expr_ty(dereferenced_expr) - } else { + let ty = if needs_check_adjustment { let adjustments = cx.tables.expr_adjustments(dereferenced_expr); if let Some(i) = adjustments.iter().position(|adj| match adj.kind { Adjust::Borrow(_) | Adjust::Deref(_) => true, @@ -261,6 +259,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonCopyConst { // No borrow adjustments = the entire const is moved. return; } + } else { + cx.tables.expr_ty(dereferenced_expr) }; verify_ty_bound(cx, ty, Source::Expr { expr: expr.span });