Skip to content

Rust: Disambiguate associated function calls #19995

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

hvitved
Copy link
Contributor

@hvitved hvitved commented Jul 7, 2025

No description provided.

@github-actions github-actions bot added Ruby Rust Pull requests that update Rust code labels Jul 7, 2025
@@ -1284,7 +1285,7 @@
// siblings).
not exists(impl.getAttributeMacroExpansion()) and
// We use this for resolving methods, so exclude traits that do not have methods.
exists(Function f | f = trait.getASuccessor(_) and f.getParamList().hasSelfParam()) and
exists(Function f | f = trait.getASuccessor(_)) and

Check warning

Code scanning / CodeQL

Expression can be replaced with a cast Warning

The assignment to
f
in the exists(..) can replaced with an instanceof expression.
@@ -1475,6 +1528,14 @@
result = getTraitMethod(mc.getTypeAt(TypePath::nil()), mc.getMethodName())
}

/** Gets a method that the method call `mc` resolves to, if any. */
cached
Function resolveCallTarget(CallExpr ce) {

Check warning

Code scanning / CodeQL

Missing QLDoc for parameter Warning

The QLDoc has no documentation for ce, but the QLDoc mentions mc
@hvitved hvitved force-pushed the rust/disambiguate-assoc-function-calls branch from fc8ff54 to 0aaedf5 Compare July 8, 2025 09:06
@github-actions github-actions bot removed the Ruby label Jul 8, 2025
@hvitved hvitved force-pushed the rust/disambiguate-assoc-function-calls branch from 0aaedf5 to 9ce2d5b Compare July 8, 2025 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant