-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Incremental compilation doesn't update static strings. #49301
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
Comments
Thanks for the bug report, @pinkisemils! |
OK, I can reproduce on nightly. Cannot reproduce on beta though. Could this be MIRI related, @oli-obk? Are we hashing just an ID instead of contents somewhere? |
Hashing for statics just hashes the rust/src/librustc/ich/impls_ty.rs Lines 392 to 416 in 15add36
|
So... we can't use recursion, because of recursive statics (which is the entire reason for the DefId-hashing), but we could keep a This means we need to manually hash the allocation instead of using a generated impl. |
@oli-obk sounds good. I think you don't even need to hash the 0s and 1s as disambiguators, simply not recursing into allocations that have already been visited should be enough. Also, I would just use a |
Oh so we could recurse! That makes things easier. I'll try to get to it on Sunday, but we might still end up needing to backport to beta. |
Probably, yes. But the fix should be small and self-contained, so that's fine. |
Fixed in #49424 |
When changing a static string in a way that doesn't change it's length,
cargo build
won't rebuild the changed string.For instance, if the binary has already been built, changing
hello
toxxxxx
will result in a binary that still outputshello
.If built with
CARGO_INCREMENTAL=0
, everything works as expected. If the length of the string is changed, everything also works as expected.Tested on
rustc 1.26.0-nightly (75af15ee6 2018-03-20)
.The text was updated successfully, but these errors were encountered: