Skip to content

Rust: Assume prelude is always available in path resolution #19936

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

Merged
merged 1 commit into from
Jul 1, 2025

Conversation

hvitved
Copy link
Contributor

@hvitved hvitved commented Jul 1, 2025

It should be safe to assume that the prelude is always available, since shadowing definitions will be prioritized anyway, so this PR removes the crate-dependency restriction.

DCA looks great: windows-rs, in particular, has a high increase in resolvable calls (from 11 % to 33 %).

@github-actions github-actions bot added the Rust Pull requests that update Rust code label Jul 1, 2025
@hvitved hvitved force-pushed the rust/path-resolution-prelude-always branch 2 times, most recently from 1dd2cf5 to d3bf010 Compare July 1, 2025 08:06
@hvitved hvitved force-pushed the rust/path-resolution-prelude-always branch from d3bf010 to bd1f46b Compare July 1, 2025 08:18
@hvitved hvitved added the no-change-note-required This PR does not need a change note label Jul 1, 2025
@hvitved hvitved marked this pull request as ready for review July 1, 2025 08:45
@Copilot Copilot AI review requested due to automatic review settings July 1, 2025 08:45
@hvitved hvitved requested a review from a team as a code owner July 1, 2025 08:45
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Contributor

@geoffw0 geoffw0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the goal here mainly to reduce inconsistencies?

Copy link
Contributor

@aibaars aibaars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me.

@hvitved
Copy link
Contributor Author

hvitved commented Jul 1, 2025

Is the goal here mainly to reduce inconsistencies?

The goal is to resolve more paths; I have seen cases where the prelude was not correctly taken into account, which this PR resolves.

@hvitved hvitved merged commit d6b051e into github:main Jul 1, 2025
22 checks passed
@hvitved hvitved deleted the rust/path-resolution-prelude-always branch July 1, 2025 11:13
@geoffw0
Copy link
Contributor

geoffw0 commented Jul 1, 2025

I forgot to look at DCA before approving - significantly more sinks are found which is great, and probably explained by resolving more paths 🎉. We also find more call targets and have fewer type inference inconsistencies 👍.

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.

3 participants