Skip to content
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

Rust: Small type inference tweaks #19038

Merged
merged 6 commits into from
Mar 17, 2025

Conversation

paldepind
Copy link
Contributor

Just some small changes I made when reading through the type inference implementation.

@github-actions github-actions bot added the Rust Pull requests that update Rust code label Mar 17, 2025
@@ -578,14 +578,9 @@ private module CallExprBaseMatchingInput implements MatchingInputSig {
}

Declaration getTarget() {
result =
[
CallExprImpl::getResolvedFunction(this).(AstNode),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note, this line calls getResolvedFunction and casts to AstNode. The next line calls getResolvedFunction and calls to Struct. Seems like the later will always be included in the former.

@paldepind paldepind marked this pull request as ready for review March 17, 2025 07:07
@paldepind paldepind added the no-change-note-required This PR does not need a change note label Mar 17, 2025
@paldepind paldepind requested a review from hvitved March 17, 2025 07:24
hvitved
hvitved previously approved these changes Mar 17, 2025
Copy link
Contributor

@hvitved hvitved left a comment

Choose a reason for hiding this comment

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

LGTM, just one question.

println!("{:?}", x.a);
}

fn generic_field_access() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do all the expressions in this test have correctly inferred types (I didn't bother to check the .expected file)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe so, yes :)

@paldepind
Copy link
Contributor Author

I've merged main.

@paldepind paldepind merged commit f90d53a into github:main Mar 17, 2025
39 checks passed
@paldepind paldepind deleted the rust-type-inference-tweaks branch March 17, 2025 13:11
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.

2 participants