@@ -141,27 +141,25 @@ impl MultiItemModifier for DeriveProcMacro {
141
141
142
142
// FIXME(pr-time): Just using the crate hash to notice when the proc-macro code has
143
143
// changed. How to *correctly* depend on exactly the macro definition?
144
- // I.e., depending on the crate hash is just a HACK ( and leaves garbage in the
145
- // incremental compilation dir) .
144
+ // I.e., depending on the crate hash is just a HACK, and ideally the dependency would be
145
+ // more narrow .
146
146
let macro_def_id = invoc_expn_data. macro_def_id . unwrap ( ) ;
147
147
let proc_macro_crate_hash = tcx. crate_hash ( macro_def_id. krate ) ;
148
148
149
149
assert_eq ! ( invoc_expn_data. call_site, span) ;
150
150
151
- let res = crate :: derive_macro_expansion:: enter_context ( ( ecx, self . client ) , move || {
152
- let key = ( invoc_id, proc_macro_crate_hash, input) ;
153
- // FIXME(pr-time): Is this the correct way to check for incremental compilation (as
154
- // well)?
155
- if tcx. sess . opts . incremental . is_some ( )
156
- && tcx. sess . opts . unstable_opts . cache_proc_macros
157
- {
158
- tcx. derive_macro_expansion ( key) . cloned ( )
159
- } else {
160
- crate :: derive_macro_expansion:: provide_derive_macro_expansion ( tcx, key) . cloned ( )
161
- }
162
- } ) ;
151
+ let key = ( invoc_id, proc_macro_crate_hash, input) ;
163
152
164
- res
153
+ // FIXME(pr-time): Is this the correct way to check for incremental compilation (as
154
+ // well)?
155
+ if tcx. sess . opts . incremental . is_some ( ) && tcx. sess . opts . unstable_opts . cache_proc_macros
156
+ {
157
+ crate :: derive_macro_expansion:: enter_context ( ( ecx, self . client ) , move || {
158
+ tcx. derive_macro_expansion ( key) . cloned ( )
159
+ } )
160
+ } else {
161
+ crate :: derive_macro_expansion:: provide_derive_macro_expansion ( tcx, key) . cloned ( )
162
+ }
165
163
} ) ;
166
164
let Ok ( output) = res else {
167
165
// error will already have been emitted
0 commit comments