mirror of
https://github.com/github/codeql.git
synced 2026-02-12 05:01:06 +01:00
Rust: Fix QL4QL finding
This commit is contained in:
@@ -2615,8 +2615,8 @@ private Type inferMethodCallTypeSelf(
|
||||
path = selfPath and
|
||||
not result instanceof TypeParameter
|
||||
or
|
||||
exists(TypeParameter tp, TypePath pathToTypeParam, TypePath suffix |
|
||||
impl.targetTypeParameterAt(tp, pathToTypeParam) and
|
||||
exists(TypePath pathToTypeParam, TypePath suffix |
|
||||
impl.targetHasTypeParameterAt(pathToTypeParam) and
|
||||
path0 = pathToTypeParam.appendInverse(suffix) and
|
||||
result = t0 and
|
||||
path = selfPath.append(suffix)
|
||||
|
||||
@@ -20,12 +20,13 @@ class DerefImplItemNode extends ImplItemNode {
|
||||
Type resolveSelfTypeAt(TypePath path) { result = resolveImplSelfTypeAt(this, path) }
|
||||
|
||||
/**
|
||||
* Holds if the target type of the dereference implemention mentions type
|
||||
* parameter `tp` at `path`.
|
||||
* Holds if the target type of the dereference implemention mentions a type
|
||||
* parameter at `path`.
|
||||
*/
|
||||
pragma[nomagic]
|
||||
predicate targetTypeParameterAt(TypeParameter tp, TypePath path) {
|
||||
tp = this.getAssocItem("Target").(TypeAlias).getTypeRepr().(TypeMention).resolveTypeAt(path)
|
||||
predicate targetHasTypeParameterAt(TypePath path) {
|
||||
this.getAssocItem("Target").(TypeAlias).getTypeRepr().(TypeMention).resolveTypeAt(path)
|
||||
instanceof TypeParameter
|
||||
}
|
||||
|
||||
/** Gets the first type parameter of the type being implemented, if any. */
|
||||
|
||||
Reference in New Issue
Block a user