about summary refs log tree commit diff
path: root/clippy_lints/src/let_underscore.rs
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2020-06-26 02:56:23 +0300
committerEduard-Mihai Burtescu <edy.burt@gmail.com>2020-06-26 02:56:23 +0300
commitf5ce0e5fe960d09db01cf912c475cd1a52131120 (patch)
tree4c518b2c5be8ec71515b04612e697abbeb163835 /clippy_lints/src/let_underscore.rs
parent80bcbf521c7ff95e38a7567432b5519cc18e5b2a (diff)
rustc_lint: only query `typeck_tables_of` when a lint needs it.
Diffstat (limited to 'clippy_lints/src/let_underscore.rs')
-rw-r--r--clippy_lints/src/let_underscore.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/clippy_lints/src/let_underscore.rs b/clippy_lints/src/let_underscore.rs
index acd628bbaca..0864bbe0f91 100644
--- a/clippy_lints/src/let_underscore.rs
+++ b/clippy_lints/src/let_underscore.rs
@@ -76,7 +76,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LetUnderscore {
             if let PatKind::Wild = local.pat.kind;
             if let Some(ref init) = local.init;
             then {
-                let init_ty = cx.tables.expr_ty(init);
+                let init_ty = cx.tables().expr_ty(init);
                 let contains_sync_guard = init_ty.walk().any(|inner| match inner.unpack() {
                     GenericArgKind::Type(inner_ty) => {
                         SYNC_GUARD_PATHS.iter().any(|path| match_type(cx, inner_ty, path))
@@ -94,7 +94,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LetUnderscore {
                         "consider using an underscore-prefixed named \
                             binding or dropping explicitly with `std::mem::drop`"
                     )
-                } else if is_must_use_ty(cx, cx.tables.expr_ty(init)) {
+                } else if is_must_use_ty(cx, cx.tables().expr_ty(init)) {
                     span_lint_and_help(
                         cx,
                         LET_UNDERSCORE_MUST_USE,