Rust: Improve type inference for for loops and range expressions#19971
Merged
hvitved merged 3 commits intogithub:mainfrom Jul 8, 2025
Merged
Rust: Improve type inference for for loops and range expressions#19971hvitved merged 3 commits intogithub:mainfrom
for loops and range expressions#19971hvitved merged 3 commits intogithub:mainfrom
Conversation
2e9addd to
2c8f0b8
Compare
a36c9ec to
7647bc3
Compare
geoffw0
reviewed
Jul 7, 2025
Contributor
geoffw0
left a comment
There was a problem hiding this comment.
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 |
Contributor
There was a problem hiding this comment.
Really happy to see these! 🎉
f741e41 to
1518cad
Compare
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR generalizes the existing logic for inferring types of
forloops to be based on theIntoIteratortrait, cf. howforloops are desugared. Additionally, this PR also adds type inference for range expressions like1..10.DCA looks good; more resolved calls, no significant slowdown.