-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incremental Compilation needs to rebuild everything when feature gates are changed #47820
Comments
@oberien thanks for the report! I think this is a rustc issue because Cargo is reinvoking the compiler, but it looks like stale results may be getting used by incremental compilation? |
We should probably include the features in the hash of command line options that we give, I guess. |
triage: P-medium |
Well, I'll triage as P-high just to make sure @michaelwoerister sees this. triage: P-high |
This is a duplicate of #47003. |
Shall we close it then, @michaelwoerister ? |
Yes, closing as duplicate. Moving over the P-high tag to the original. |
Given this example:
main.rs
foo.rs
Without the feature gate
nll
,foo::foo
won't compile, becausevec
is borrowed byvec.push
which doesn't allowvec.len
to borrow it again. Withnll
, this is solved and the code compiles.With the annotation in main.rs,
cargo build
will build everything just fine.After a successful build if we remove
#[feature(nll)]
and executecargo build
again, everything still compiles, even though it shouldn.I think that this is due to incremental compilation. Cargo reuses the old module
foo
instead of recompiling it. If it would recompile it (e.g. after adding a newline to the end of foo.rs), the build breaks as expected.The text was updated successfully, but these errors were encountered: