X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Ftools%2Fclippy%2Fclippy_lints%2Fsrc%2Funnamed_address.rs;h=53e47f09ae55ce256890e20d57228f1558772065;hb=16957bd4d3a5377263f76ed74c572aad8e4b7e59;hp=4e077b95b5c68024c9eaca1f78c343c62a2dfe9a;hpb=2a1581c50c5af46a7760f0ce9fe93d5b52818940;p=rust.git diff --git a/src/tools/clippy/clippy_lints/src/unnamed_address.rs b/src/tools/clippy/clippy_lints/src/unnamed_address.rs index 4e077b95b5c..53e47f09ae5 100644 --- a/src/tools/clippy/clippy_lints/src/unnamed_address.rs +++ b/src/tools/clippy/clippy_lints/src/unnamed_address.rs @@ -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(