]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/unnamed_address.rs
Auto merge of #73456 - tmiasko:musl-libdir, r=Mark-Simulacrum
[rust.git] / src / tools / clippy / clippy_lints / src / unnamed_address.rs
index 4e077b95b5c68024c9eaca1f78c343c62a2dfe9a..53e47f09ae55ce256890e20d57228f1558772065 100644 (file)
@@ -65,14 +65,14 @@ fn is_comparison(binop: BinOpKind) -> bool {
         }
 
         fn is_trait_ptr(cx: &LateContext<'_, '_>, expr: &Expr<'_>) -> bool {
-            match cx.tables.expr_ty_adjusted(expr).kind {
+            match cx.tables().expr_ty_adjusted(expr).kind {
                 ty::RawPtr(ty::TypeAndMut { ty, .. }) => ty.is_trait(),
                 _ => false,
             }
         }
 
         fn is_fn_def(cx: &LateContext<'_, '_>, expr: &Expr<'_>) -> bool {
-            if let ty::FnDef(..) = cx.tables.expr_ty(expr).kind {
+            if let ty::FnDef(..) = cx.tables().expr_ty(expr).kind {
                 true
             } else {
                 false
@@ -98,11 +98,11 @@ fn is_fn_def(cx: &LateContext<'_, '_>, expr: &Expr<'_>) -> bool {
         if_chain! {
             if let ExprKind::Call(ref func, [ref _left, ref _right]) = expr.kind;
             if let ExprKind::Path(ref func_qpath) = func.kind;
-            if let Some(def_id) = cx.tables.qpath_res(func_qpath, func.hir_id).opt_def_id();
+            if let Some(def_id) = cx.tables().qpath_res(func_qpath, func.hir_id).opt_def_id();
             if match_def_path(cx, def_id, &paths::PTR_EQ) ||
                 match_def_path(cx, def_id, &paths::RC_PTR_EQ) ||
                 match_def_path(cx, def_id, &paths::ARC_PTR_EQ);
-            let ty_param = cx.tables.node_substs(func.hir_id).type_at(0);
+            let ty_param = cx.tables().node_substs(func.hir_id).type_at(0);
             if ty_param.is_trait();
             then {
                 span_lint_and_help(
@@ -119,8 +119,8 @@ fn is_fn_def(cx: &LateContext<'_, '_>, expr: &Expr<'_>) -> bool {
         if_chain! {
             if let ExprKind::Binary(binop, ref left, ref right) = expr.kind;
             if is_comparison(binop.node);
-            if cx.tables.expr_ty_adjusted(left).is_fn_ptr() &&
-                cx.tables.expr_ty_adjusted(right).is_fn_ptr();
+            if cx.tables().expr_ty_adjusted(left).is_fn_ptr() &&
+                cx.tables().expr_ty_adjusted(right).is_fn_ptr();
             if is_fn_def(cx, left) || is_fn_def(cx, right);
             then {
                 span_lint(