mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +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 {
|
class MethodCallExpr extends Generated::MethodCallExpr {
|
||||||
override Function getStaticTarget() {
|
private Function getStaticTargetFrom(boolean fromSource) {
|
||||||
result = resolveMethodCallExpr(this) and
|
result = resolveMethodCallExpr(this) and
|
||||||
|
(if result.fromSource() then fromSource = true else fromSource = false) and
|
||||||
(
|
(
|
||||||
// prioritize inherent implementation methods first
|
// prioritize inherent implementation methods first
|
||||||
isInherentImplFunction(result)
|
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) {
|
private string toStringPart(int index) {
|
||||||
index = 0 and
|
index = 0 and
|
||||||
result = this.getReceiver().toAbbreviatedString()
|
result = this.getReceiver().toAbbreviatedString()
|
||||||
|
|||||||
Reference in New Issue
Block a user