Skip to content

Commit

Permalink
fix: Ensure incremental compilation is also enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
futile committed Dec 8, 2024
1 parent 691729f commit e7cbfd7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion compiler/rustc_expand/src/proc_macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ impl MultiItemModifier for DeriveProcMacro {

let res = crate::derive_macro_expansion::enter_context((ecx, self.client), move || {
let key = (invoc_id, proc_macro_crate_hash, input);
if tcx.sess.opts.unstable_opts.cache_all_derive_macros {
// FIXME(pr-time): Is this the correct way to check for incremental compilation (as
// well)?
if tcx.sess.opts.incremental.is_some()
&& tcx.sess.opts.unstable_opts.cache_all_derive_macros
{
tcx.derive_macro_expansion(key).cloned()
} else {
crate::derive_macro_expansion::provide_derive_macro_expansion(tcx, key).cloned()
Expand Down

0 comments on commit e7cbfd7

Please sign in to comment.