Skip to content

Commit f6eaa9b

Browse files
committed
fixup! redundant_box lint
1 parent dd1467a commit f6eaa9b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clippy_lints/src/redundant_box.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use clippy_utils::source::snippet;
44
use clippy_utils::ty::approx_ty_size;
55
use rustc_errors::Applicability;
66
use rustc_hir::{AmbigArg, Expr, ExprKind, GenericArg, Path, PathSegment, QPath, Ty, TyKind};
7-
use rustc_lint::{LateContext, LateLintPass};
7+
use rustc_lint::{LateContext, LateLintPass, LintContext};
88
use rustc_session::declare_lint_pass;
99

1010
declare_clippy_lint! {
@@ -58,8 +58,8 @@ fn is_thin_type<'tcx>(cx: &LateContext<'tcx>, ty: rustc_middle::ty::Ty<'tcx>) ->
5858
// target is a different architecture. Can/should we do someting about it? Maybe make it
5959
// configurable?
6060
ty.is_sized(cx.tcx, cx.typing_env()) && {
61-
let size = approx_ty_size(cx, ty);
62-
0 < size && size <= size_of::<usize>() as u64
61+
let size = 8 * approx_ty_size(cx, ty);
62+
0 < size && size <= cx.sess().target.pointer_width as u64
6363
}
6464
}
6565

0 commit comments

Comments
 (0)