]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/non_copy_const.rs
Rollup merge of #83092 - petrochenkov:qspan, r=estebank
[rust.git] / clippy_lints / src / non_copy_const.rs
index 3a9aa6ced03ba7558d89d7c3ee82af6ce46dca6d..8aebce67917afa1559e16925ced20f8f16238bf7 100644 (file)
@@ -18,7 +18,7 @@
 use rustc_span::{InnerSpan, Span, DUMMY_SP};
 use rustc_typeck::hir_ty_to_ty;
 
-use crate::utils::{in_constant, qpath_res, span_lint_and_then};
+use crate::utils::{in_constant, span_lint_and_then};
 use if_chain::if_chain;
 
 // FIXME: this is a correctness problem but there's no suitable
@@ -271,7 +271,7 @@ fn check_trait_item(&mut self, cx: &LateContext<'tcx>, trait_item: &'tcx TraitIt
 
     fn check_impl_item(&mut self, cx: &LateContext<'tcx>, impl_item: &'tcx ImplItem<'_>) {
         if let ImplItemKind::Const(hir_ty, body_id) = &impl_item.kind {
-            let item_hir_id = cx.tcx.hir().get_parent_node(impl_item.hir_id);
+            let item_hir_id = cx.tcx.hir().get_parent_node(impl_item.hir_id());
             let item = cx.tcx.hir().expect_item(item_hir_id);
 
             match &item.kind {
@@ -339,7 +339,7 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
             }
 
             // Make sure it is a const item.
-            let item_def_id = match qpath_res(cx, qpath, expr.hir_id) {
+            let item_def_id = match cx.qpath_res(qpath, expr.hir_id) {
                 Res::Def(DefKind::Const | DefKind::AssocConst, did) => did,
                 _ => return,
             };
@@ -383,7 +383,7 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
                             needs_check_adjustment = false;
                             break;
                         },
-                        ExprKind::Unary(UnOp::UnDeref, _) => {
+                        ExprKind::Unary(UnOp::Deref, _) => {
                             // `*e` => desugared to `*Deref::deref(&e)`,
                             // meaning `e` must be referenced.
                             // no need to go further up since a method call is involved now.