Skip to content

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

Closed
weiznich wants to merge 1 commit into
rust-lang:masterfrom
weiznich:revert/119592
Closed

weiznich wants to merge 1 commit into
rust-lang:masterfrom
weiznich:revert/119592

Conversation

@weiznich

Copy link
Copy Markdown
Contributor

… cstore"

This reverts commit a2ab48c.

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

cc @petrochenkov

@rustbot

rustbot commented Feb 13, 2024

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Contributor

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

@petrochenkov

petrochenkov commented Feb 14, 2024 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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