about summary refs log tree commit diff
path: root/clippy_lints/src/modulo_arithmetic.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/modulo_arithmetic.rs
parent80bcbf521c7ff95e38a7567432b5519cc18e5b2a (diff)
rustc_lint: only query `typeck_tables_of` when a lint needs it.
Diffstat (limited to 'clippy_lints/src/modulo_arithmetic.rs')
-rw-r--r--clippy_lints/src/modulo_arithmetic.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/clippy_lints/src/modulo_arithmetic.rs b/clippy_lints/src/modulo_arithmetic.rs
index 4ca90455bc4..f76e4721e1f 100644
--- a/clippy_lints/src/modulo_arithmetic.rs
+++ b/clippy_lints/src/modulo_arithmetic.rs
@@ -37,8 +37,8 @@ struct OperandInfo {
 }
 
 fn analyze_operand(operand: &Expr<'_>, cx: &LateContext<'_, '_>, expr: &Expr<'_>) -> Option<OperandInfo> {
-    match constant(cx, cx.tables, operand) {
-        Some((Constant::Int(v), _)) => match cx.tables.expr_ty(expr).kind {
+    match constant(cx, cx.tables(), operand) {
+        Some((Constant::Int(v), _)) => match cx.tables().expr_ty(expr).kind {
             ty::Int(ity) => {
                 let value = sext(cx.tcx, v, ity);
                 return Some(OperandInfo {
@@ -106,7 +106,7 @@ fn check_const_operands<'a, 'tcx>(
 }
 
 fn check_non_const_operands<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr<'_>, operand: &Expr<'_>) {
-    let operand_type = cx.tables.expr_ty(operand);
+    let operand_type = cx.tables().expr_ty(operand);
     if might_have_negative_value(operand_type) {
         span_lint_and_then(
             cx,