about summary refs log tree commit diff
path: root/src/tools/clippy
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-04-23 04:13:33 +0000
committerbors <bors@rust-lang.org>2024-04-23 04:13:33 +0000
commita77f76e26302e9a084fb321817675b1dfc1dcd63 (patch)
tree6e5392d17e2b4bc07de4de810e4cba3cf93c8bf0 /src/tools/clippy
parentaca749eefceaed0cda19a7ec5e472fce9387bc00 (diff)
parent6abf1aae2438520780ef463db4c0cbdccc7ca4eb (diff)
downloadrust-a77f76e26302e9a084fb321817675b1dfc1dcd63.tar.gz
rust-a77f76e26302e9a084fb321817675b1dfc1dcd63.zip
Auto merge of #123992 - compiler-errors:no-has-typeck-results, r=jackh726
`has_typeck_results` doesnt need to be a query

self-explanatory
Diffstat (limited to 'src/tools/clippy')
-rw-r--r--src/tools/clippy/clippy_lints/src/functions/must_use.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/clippy/clippy_lints/src/functions/must_use.rs b/src/tools/clippy/clippy_lints/src/functions/must_use.rs
index d0c66900c00..e7ec2b3151e 100644
--- a/src/tools/clippy/clippy_lints/src/functions/must_use.rs
+++ b/src/tools/clippy/clippy_lints/src/functions/must_use.rs
@@ -185,7 +185,7 @@ fn is_mutable_pat(cx: &LateContext<'_>, pat: &hir::Pat<'_>, tys: &mut DefIdSet)
     if let hir::PatKind::Wild = pat.kind {
         return false; // ignore `_` patterns
     }
-    if cx.tcx.has_typeck_results(pat.hir_id.owner.to_def_id()) {
+    if cx.tcx.has_typeck_results(pat.hir_id.owner.def_id) {
         is_mutable_ty(cx, cx.tcx.typeck(pat.hir_id.owner.def_id).pat_ty(pat), tys)
     } else {
         false
@@ -233,7 +233,7 @@ fn mutates_static<'tcx>(cx: &LateContext<'tcx>, body: &'tcx hir::Body<'_>) -> bo
             Call(_, args) => {
                 let mut tys = DefIdSet::default();
                 for arg in args {
-                    if cx.tcx.has_typeck_results(arg.hir_id.owner.to_def_id())
+                    if cx.tcx.has_typeck_results(arg.hir_id.owner.def_id)
                         && is_mutable_ty(cx, cx.tcx.typeck(arg.hir_id.owner.def_id).expr_ty(arg), &mut tys)
                         && is_mutated_static(arg)
                     {
@@ -246,7 +246,7 @@ fn mutates_static<'tcx>(cx: &LateContext<'tcx>, body: &'tcx hir::Body<'_>) -> bo
             MethodCall(_, receiver, args, _) => {
                 let mut tys = DefIdSet::default();
                 for arg in std::iter::once(receiver).chain(args.iter()) {
-                    if cx.tcx.has_typeck_results(arg.hir_id.owner.to_def_id())
+                    if cx.tcx.has_typeck_results(arg.hir_id.owner.def_id)
                         && is_mutable_ty(cx, cx.tcx.typeck(arg.hir_id.owner.def_id).expr_ty(arg), &mut tys)
                         && is_mutated_static(arg)
                     {