about summary refs log tree commit diff
path: root/compiler/rustc_interface/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-11-06 08:35:28 +0100
committerGitHub <noreply@github.com>2022-11-06 08:35:28 +0100
commit13e62be1e5efbab8b3a8247fb61d2712b28aa20f (patch)
tree43884a33d6891efcacc46a8a54f9012cadbf9ecd /compiler/rustc_interface/src
parentef0d79f8654e5d9b170844263ef73d2aa615fa50 (diff)
parent27e0f03d411b867ea0605c43aea1eccdd4b9c71c (diff)
downloadrust-13e62be1e5efbab8b3a8247fb61d2712b28aa20f.tar.gz
rust-13e62be1e5efbab8b3a8247fb61d2712b28aa20f.zip
Rollup merge of #104016 - Nilstrieb:query-descs-more, r=compiler-errors
Add internal descriptions to a few queries

helps with #104008
Diffstat (limited to 'compiler/rustc_interface/src')
-rw-r--r--compiler/rustc_interface/src/proc_macro_decls.rs15
1 files changed, 5 insertions, 10 deletions
diff --git a/compiler/rustc_interface/src/proc_macro_decls.rs b/compiler/rustc_interface/src/proc_macro_decls.rs
index 4c236c693d0..9bf7778bfb2 100644
--- a/compiler/rustc_interface/src/proc_macro_decls.rs
+++ b/compiler/rustc_interface/src/proc_macro_decls.rs
@@ -4,21 +4,16 @@ use rustc_middle::ty::TyCtxt;
 use rustc_span::symbol::sym;
 
 fn proc_macro_decls_static(tcx: TyCtxt<'_>, (): ()) -> Option<LocalDefId> {
-    let mut finder = Finder { tcx, decls: None };
+    let mut decls = None;
 
     for id in tcx.hir().items() {
-        let attrs = finder.tcx.hir().attrs(id.hir_id());
-        if finder.tcx.sess.contains_name(attrs, sym::rustc_proc_macro_decls) {
-            finder.decls = Some(id.owner_id.def_id);
+        let attrs = tcx.hir().attrs(id.hir_id());
+        if tcx.sess.contains_name(attrs, sym::rustc_proc_macro_decls) {
+            decls = Some(id.owner_id.def_id);
         }
     }
 
-    finder.decls
-}
-
-struct Finder<'tcx> {
-    tcx: TyCtxt<'tcx>,
-    decls: Option<LocalDefId>,
+    decls
 }
 
 pub(crate) fn provide(providers: &mut Providers) {