diff options
| author | flip1995 <philipp.krones@embecosm.com> | 2021-03-12 15:30:50 +0100 |
|---|---|---|
| committer | flip1995 <philipp.krones@embecosm.com> | 2021-03-12 15:30:50 +0100 |
| commit | f2f2a005b4efd3e44ac6a02ea2b9660d28401679 (patch) | |
| tree | c4ece65dffee2aa79eaa3b7f190765a95055f815 /clippy_lints/src/inconsistent_struct_constructor.rs | |
| parent | 36a27ecaacad74f69b21a12bc66b826f11f2d44e (diff) | |
| download | rust-f2f2a005b4efd3e44ac6a02ea2b9660d28401679.tar.gz rust-f2f2a005b4efd3e44ac6a02ea2b9660d28401679.zip | |
Merge commit '6ed6f1e6a1a8f414ba7e6d9b8222e7e5a1686e42' into clippyup
Diffstat (limited to 'clippy_lints/src/inconsistent_struct_constructor.rs')
| -rw-r--r-- | clippy_lints/src/inconsistent_struct_constructor.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clippy_lints/src/inconsistent_struct_constructor.rs b/clippy_lints/src/inconsistent_struct_constructor.rs index c5afdf530eb..4f35e13c85a 100644 --- a/clippy_lints/src/inconsistent_struct_constructor.rs +++ b/clippy_lints/src/inconsistent_struct_constructor.rs @@ -66,8 +66,7 @@ impl LateLintPass<'_> for InconsistentStructConstructor { fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) { if_chain! { if let ExprKind::Struct(qpath, fields, base) = expr.kind; - if let Some(def_id) = cx.qpath_res(qpath, expr.hir_id).opt_def_id(); - let ty = cx.tcx.type_of(def_id); + let ty = cx.typeck_results().expr_ty(expr); if let Some(adt_def) = ty.ty_adt_def(); if adt_def.is_struct(); if let Some(variant) = adt_def.variants.iter().next(); |
