Skip to content

Rust: Fallback crate resolution #20225

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hvitved
Copy link
Contributor

@hvitved hvitved commented Aug 14, 2025

Before this PR, we relied strictly on crate dependency information from the extractor when resolving paths to crates. However, for whatever reason, this information may sometimes be incomplete, so in this PR we relax this condition and allow for a path to resolve to any crate in the DB, as long as the name of that crate does not conflict with the name of a known dependency.

In order to reduce path resolution inconsistencies, this PR also adds a step to make resolution of qualified paths like q::p consistent; of all the candidate resolution targets of q, only chose the one(s) that are consistent with what q::p may resolve to.

DCA looks great: Percentage of calls with call target increases from 61.52 to 62.44, at only a marginal slowdown.

@github-actions github-actions bot added the Rust Pull requests that update Rust code label Aug 14, 2025
@hvitved hvitved force-pushed the rust/path-resolution-crate-fallback branch 6 times, most recently from f1e4bb9 to 8b44182 Compare August 19, 2025 08:29
@hvitved hvitved force-pushed the rust/path-resolution-crate-fallback branch 4 times, most recently from 4ee31bd to 8a3c3aa Compare August 25, 2025 07:24
@hvitved hvitved added the no-change-note-required This PR does not need a change note label Aug 25, 2025
@hvitved hvitved force-pushed the rust/path-resolution-crate-fallback branch 3 times, most recently from 500792f to 36a7fe1 Compare August 25, 2025 09:57
@hvitved hvitved force-pushed the rust/path-resolution-crate-fallback branch from 36a7fe1 to 245b001 Compare August 25, 2025 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-change-note-required This PR does not need a change note Rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant