Skip to content

Commit 826d998

Browse files
authored
Merge pull request #3036 from matthiaskrgr/clippy_self
fix 2 clippy warnings
2 parents 7392f6c + 66ca395 commit 826d998

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

clippy_lints/src/identity_op.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for IdentityOp {
6363
fn check(cx: &LateContext<'_, '_>, e: &Expr, m: i8, span: Span, arg: Span) {
6464
if let Some(Constant::Int(v)) = constant_simple(cx, cx.tables, e) {
6565
let check = match cx.tables.expr_ty(e).sty {
66-
ty::TyInt(ity) => unsext(cx.tcx, -1i128, ity),
66+
ty::TyInt(ity) => unsext(cx.tcx, -1_i128, ity),
6767
ty::TyUint(uty) => clip(cx.tcx, !0, uty),
6868
_ => return,
6969
};

clippy_lints/src/non_copy_const.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonCopyConst {
244244
}
245245
}
246246

247-
let ty = if !needs_check_adjustment {
248-
cx.tables.expr_ty(dereferenced_expr)
249-
} else {
247+
let ty = if needs_check_adjustment {
250248
let adjustments = cx.tables.expr_adjustments(dereferenced_expr);
251249
if let Some(i) = adjustments.iter().position(|adj| match adj.kind {
252250
Adjust::Borrow(_) | Adjust::Deref(_) => true,
@@ -261,6 +259,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonCopyConst {
261259
// No borrow adjustments = the entire const is moved.
262260
return;
263261
}
262+
} else {
263+
cx.tables.expr_ty(dereferenced_expr)
264264
};
265265

266266
verify_ty_bound(cx, ty, Source::Expr { expr: expr.span });

0 commit comments

Comments
 (0)