about summary refs log tree commit diff
path: root/clippy_lints/src/methods/zst_offset.rs
diff options
context:
space:
mode:
authorflip1995 <philipp.krones@embecosm.com>2021-04-08 17:50:13 +0200
committerflip1995 <philipp.krones@embecosm.com>2021-04-08 17:50:13 +0200
commitf6d1f368db9e726fde825dc2525cdec07673b416 (patch)
tree3528a2e5d9d2c22732db72815ce4e121b157bfb9 /clippy_lints/src/methods/zst_offset.rs
parentcde58f7174cd83752b3c0a00a970dcc07c511077 (diff)
Merge commit 'b40ea209e7f14c8193ddfc98143967b6a2f4f5c9' into clippyup
Diffstat (limited to 'clippy_lints/src/methods/zst_offset.rs')
-rw-r--r--clippy_lints/src/methods/zst_offset.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/clippy_lints/src/methods/zst_offset.rs b/clippy_lints/src/methods/zst_offset.rs
index 9f6a7c4db17..866cf616679 100644
--- a/clippy_lints/src/methods/zst_offset.rs
+++ b/clippy_lints/src/methods/zst_offset.rs
@@ -6,10 +6,9 @@ use rustc_middle::ty;
 
 use super::ZST_OFFSET;
 
-pub(super) fn check(cx: &LateContext<'_>, expr: &hir::Expr<'_>, args: &[hir::Expr<'_>]) {
+pub(super) fn check(cx: &LateContext<'_>, expr: &hir::Expr<'_>, recv: &hir::Expr<'_>) {
     if_chain! {
-        if args.len() == 2;
-        if let ty::RawPtr(ty::TypeAndMut { ref ty, .. }) = cx.typeck_results().expr_ty(&args[0]).kind();
+        if let ty::RawPtr(ty::TypeAndMut { ty, .. }) = cx.typeck_results().expr_ty(recv).kind();
         if let Ok(layout) = cx.tcx.layout_of(cx.param_env.and(ty));
         if layout.is_zst();
         then {