FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Rust: Improve type inference for `for` loops and range expressions by hvitved · Pull Request #19971 · github/codeql · GitHub

Repository navigation

Rust: Improve type inference for for loops and range expressions - #19971

Merged
hvitved merged 3 commits into
github:mainfrom
hvitved:rust/type-inference-for-range
Jul 8, 2025
Merged

hvitved merged 3 commits into
github:mainfrom
hvitved:rust/type-inference-for-range

Conversation

hvitved commented Jul 3, 2025 •
edited
Loading

Copy link
Copy Markdown
Contributor

This PR generalizes the existing logic for inferring types of for loops to be based on the IntoIterator trait, cf. how for loops are desugared. Additionally, this PR also adds type inference for range expressions like 1..10.

DCA looks good; more resolved calls, no significant slowdown.

github-actions Bot added the Rust Pull requests that update Rust code label Jul 3, 2025
hvitved force-pushed the rust/type-inference-for-range branch from 2e9addd to 2c8f0b8 Compare July 3, 2025 16:01
hvitved force-pushed the rust/type-inference-for-range branch 2 times, most recently from a36c9ec to 7647bc3 Compare July 4, 2025 12:48
hvitved marked this pull request as ready for review July 7, 2025 07:35
Copilot AI review requested due to automatic review settings July 7, 2025 07:35
hvitved requested a review from a team as a code owner July 7, 2025 07:35

Copilot AI 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

geoffw0 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

A few questions, but otherwise looks great, as does the DCA run.

let path = e.path(); // $ Alert[rust/summary/taint-sources]
let file_name = e.file_name(); // $ Alert[rust/summary/taint-sources]
sink(path); // $ hasTaintFlow
sink(file_name); // $ hasTaintFlow

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Really happy to see these! 🎉

hvitved force-pushed the rust/type-inference-for-range branch from f741e41 to 1518cad Compare July 8, 2025 09:29
hvitved requested a review from geoffw0 July 8, 2025 09:42

geoffw0 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM.

hvitved merged commit 411aa6d into github:main Jul 8, 2025
hvitved deleted the rust/type-inference-for-range branch July 8, 2025 10:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL