Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit bb3bddf

Browse files
committedDec 24, 2024
fix: Ensure incremental compilation is also enabled
1 parent f768697 commit bb3bddf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎compiler/rustc_expand/src/proc_macro.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,11 @@ impl MultiItemModifier for DeriveProcMacro {
149149

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

0 commit comments

Comments
 (0)
Failed to load comments.