mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Rust: Workaround for method existing both as source and as dependency
This commit is contained in:
@@ -31,8 +31,9 @@ module Impl {
|
||||
* ```
|
||||
*/
|
||||
class MethodCallExpr extends Generated::MethodCallExpr {
|
||||
override Function getStaticTarget() {
|
||||
private Function getStaticTargetFrom(boolean fromSource) {
|
||||
result = resolveMethodCallExpr(this) and
|
||||
(if result.fromSource() then fromSource = true else fromSource = false) and
|
||||
(
|
||||
// prioritize inherent implementation methods first
|
||||
isInherentImplFunction(result)
|
||||
@@ -54,6 +55,13 @@ module Impl {
|
||||
)
|
||||
}
|
||||
|
||||
override Function getStaticTarget() {
|
||||
result = this.getStaticTargetFrom(true)
|
||||
or
|
||||
not exists(this.getStaticTargetFrom(true)) and
|
||||
result = this.getStaticTargetFrom(false)
|
||||
}
|
||||
|
||||
private string toStringPart(int index) {
|
||||
index = 0 and
|
||||
result = this.getReceiver().toAbbreviatedString()
|
||||
|
||||
Reference in New Issue
Block a user