Skip to content
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

Revert "resolve: Unload speculatively resolved crates before freezing… #121038

Closed
wants to merge 1 commit into from

Conversation

weiznich
Copy link
Contributor

… cstore"

This reverts commit a2ab48c.

Fixes #120830 by reverting the commit that introduced the regression.

cc @petrochenkov

@rustbot
Copy link
Collaborator

rustbot commented Feb 13, 2024

r? @pnkfelix

rustbot has assigned @pnkfelix.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 13, 2024
@petrochenkov
Copy link
Contributor

I haven't seen #120830.
We should rather fix it than revert #119592, I'll look at it tomorrow.

@petrochenkov
Copy link
Contributor

petrochenkov commented Feb 14, 2024

CrateNum of the unloaded crate is preserved in SourceFile loaded at some point, then we attempt to access the unloaded crate data from EncodedSourceFileId::new if incremental compilation is enabled.

In OnDiskCache::serialize we go through all tcx.sess.source_map().files() and process them possibly accessing their corresponding crate data.

SourceFile is created when any span from the speculatively loaded crate is accessed (that means always?).

@petrochenkov
Copy link
Contributor

Superseded by #121167.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

thread 'rustc' panicked at compiler/rustc_metadata/src/rmeta/encoder.rs:1888:17
4 participants