Salsify the crate graph

I.e. make it not one giant input but multiple, for incrementality and decreased memory usage for Salsa 3 reasons.
This commit is contained in:
Chayim Refael Friedman 2025-01-02 01:45:32 +02:00
parent 44f18c3d05
commit c94e9efbef
108 changed files with 3630 additions and 2512 deletions

View file

@ -389,9 +389,9 @@ pub fn semantic_diagnostics(
module.and_then(|m| db.toolchain_channel(m.krate().into())),
Some(ReleaseChannel::Nightly) | None
);
let krate = module.map(|module| module.krate()).unwrap_or_else(|| {
(*db.crate_graph().crates_in_topological_order().last().unwrap()).into()
});
let krate = module
.map(|module| module.krate())
.unwrap_or_else(|| (*db.all_crates().last().unwrap()).into());
let display_target = krate.to_display_target(db);
let ctx = DiagnosticsContext { config, sema, resolve, edition, is_nightly, display_target };