about summary refs log tree commit diff
path: root/compiler/rustc_interface/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-11-06 08:13:56 +0000
committerbors <bors@rust-lang.org>2022-11-06 08:13:56 +0000
commit88935e0beacb49bb552de1628bdf50b183f7b926 (patch)
tree2d3b300a5e7651b7fa31bef99a1527912730670e /compiler/rustc_interface/src
parente30fb6a26f1ac406a346cbf79b41c92e84703a28 (diff)
parent619add319fceb06e93faac6f4a274240dc4124c6 (diff)
downloadrust-88935e0beacb49bb552de1628bdf50b183f7b926.tar.gz
rust-88935e0beacb49bb552de1628bdf50b183f7b926.zip
Auto merge of #104043 - matthiaskrgr:rollup-sttf9e8, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #103012 (Suggest use .. to fill in the rest of the fields of Struct)
 - #103851 (Fix json flag in bootstrap doc)
 - #103990 (rustdoc: clean up `.logo-container` layout CSS)
 - #104002 (fix a comment in UnsafeCell::new)
 - #104014 (Migrate test-arrow to CSS variables)
 - #104016 (Add internal descriptions to a few queries)
 - #104035 (Add 'closure match' test to weird-exprs.rs.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
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) {