File tree 1 file changed +5
-10
lines changed
compiler/rustc_interface/src
1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -4,21 +4,16 @@ use rustc_middle::ty::TyCtxt;
4
4
use rustc_span:: symbol:: sym;
5
5
6
6
fn proc_macro_decls_static ( tcx : TyCtxt < ' _ > , ( ) : ( ) ) -> Option < LocalDefId > {
7
- let mut finder = Finder { tcx , decls : None } ;
7
+ let mut decls = None ;
8
8
9
9
for id in tcx. hir ( ) . items ( ) {
10
- let attrs = finder . tcx . hir ( ) . attrs ( id. hir_id ( ) ) ;
11
- if finder . tcx . sess . contains_name ( attrs, sym:: rustc_proc_macro_decls) {
12
- finder . decls = Some ( id. owner_id . def_id ) ;
10
+ let attrs = tcx. hir ( ) . attrs ( id. hir_id ( ) ) ;
11
+ if tcx. sess . contains_name ( attrs, sym:: rustc_proc_macro_decls) {
12
+ decls = Some ( id. owner_id . def_id ) ;
13
13
}
14
14
}
15
15
16
- finder. decls
17
- }
18
-
19
- struct Finder < ' tcx > {
20
- tcx : TyCtxt < ' tcx > ,
21
- decls : Option < LocalDefId > ,
16
+ decls
22
17
}
23
18
24
19
pub ( crate ) fn provide ( providers : & mut Providers ) {
You can’t perform that action at this time.
0 commit comments