Skip to content

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

Merged
hvitved merged 1 commit into
github:mainfrom
hvitved:rust/path-resolution-prelude-always
Jul 1, 2025
Merged

Rust: Assume prelude is always available in path resolution#19936
hvitved merged 1 commit into
github:mainfrom
hvitved:rust/path-resolution-prelude-always

Conversation

@hvitved

@hvitvedhvitved commented Jul 1, 2025

Copy link
Copy Markdown
Contributor

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-actionsgithub-actionsBot added the Rust Pull requests that update Rust code label Jul 1, 2025
@hvitved
hvitvedforce-pushed the rust/path-resolution-prelude-always branch 2 times, most recently from 1dd2cf5 to d3bf010CompareJuly 1, 2025 08:06
@hvitved
hvitvedforce-pushed the rust/path-resolution-prelude-always branch from d3bf010 to bd1f46bCompareJuly 1, 2025 08:18
@hvitvedhvitved 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
CopilotAI review requested due to automatic review settings July 1, 2025 08:45
@hvitved
hvitved requested a review from a team as a code ownerJuly 1, 2025 08:45
CopilotAI reviewed Jul 1, 2025

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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.

@geoffw0geoffw0 left a comment

Copy link
Copy Markdown
Contributor

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?

@aibaarsaibaars left a comment

Copy link
Copy Markdown
Contributor

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

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:mainJul 1, 2025
@hvitved
hvitved deleted the rust/path-resolution-prelude-always branch July 1, 2025 11:13
@geoffw0

Copy link
Copy Markdown
Contributor

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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-change-note-requiredThis PR does not need a change noteRustPull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@hvitved@geoffw0@aibaars