summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_interface/src/proc_macro_decls.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_interface/src/proc_macro_decls.rs')
-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 4c236c693..9bf7778bf 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) {