about summary refs log tree commit diff
path: root/clippy_lints/src/default_numeric_fallback.rs
diff options
context:
space:
mode:
authorflip1995 <philipp.krones@embecosm.com>2021-03-12 15:30:50 +0100
committerflip1995 <philipp.krones@embecosm.com>2021-03-12 15:30:50 +0100
commitf2f2a005b4efd3e44ac6a02ea2b9660d28401679 (patch)
treec4ece65dffee2aa79eaa3b7f190765a95055f815 /clippy_lints/src/default_numeric_fallback.rs
parent36a27ecaacad74f69b21a12bc66b826f11f2d44e (diff)
downloadrust-f2f2a005b4efd3e44ac6a02ea2b9660d28401679.tar.gz
rust-f2f2a005b4efd3e44ac6a02ea2b9660d28401679.zip
Merge commit '6ed6f1e6a1a8f414ba7e6d9b8222e7e5a1686e42' into clippyup
Diffstat (limited to 'clippy_lints/src/default_numeric_fallback.rs')
-rw-r--r--clippy_lints/src/default_numeric_fallback.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/clippy_lints/src/default_numeric_fallback.rs b/clippy_lints/src/default_numeric_fallback.rs
index 6ace9aa6bdf..369efacc9bc 100644
--- a/clippy_lints/src/default_numeric_fallback.rs
+++ b/clippy_lints/src/default_numeric_fallback.rs
@@ -130,10 +130,9 @@ impl<'a, 'tcx> Visitor<'tcx> for NumericFallbackVisitor<'a, 'tcx> {
                 }
             },
 
-            ExprKind::Struct(qpath, fields, base) => {
+            ExprKind::Struct(_, fields, base) => {
                 if_chain! {
-                    if let Some(def_id) = self.cx.qpath_res(qpath, expr.hir_id).opt_def_id();
-                    let ty = self.cx.tcx.type_of(def_id);
+                    let ty = self.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();