diff --git a/rust/ql/lib/codeql/rust/internal/TypeInference.qll b/rust/ql/lib/codeql/rust/internal/TypeInference.qll index 4a53b5dee8e..a94c893c219 100644 --- a/rust/ql/lib/codeql/rust/internal/TypeInference.qll +++ b/rust/ql/lib/codeql/rust/internal/TypeInference.qll @@ -2024,7 +2024,7 @@ private module NonMethodResolution { ImplItemNode impl, NonMethodFunction implFunction ) { exists(TypePath path | - type = assocFunctionTypeAt(implFunction, impl, pos, path) and + type = getAssocFunctionTypeAt(implFunction, impl, pos, path) and implFunction.implements(traitFunction) and FunctionOverloading::traitTypeParameterOccurrence(trait, traitFunction, _, pos, path, _) | diff --git a/rust/ql/lib/codeql/rust/internal/typeinference/FunctionOverloading.qll b/rust/ql/lib/codeql/rust/internal/typeinference/FunctionOverloading.qll index 9373f62b0e4..b58084e31cf 100644 --- a/rust/ql/lib/codeql/rust/internal/typeinference/FunctionOverloading.qll +++ b/rust/ql/lib/codeql/rust/internal/typeinference/FunctionOverloading.qll @@ -79,7 +79,7 @@ predicate traitTypeParameterOccurrence( TypeParameter tp ) { f = trait.getASuccessor(functionName) and - tp = assocFunctionTypeAt(f, trait, pos, path) and + tp = getAssocFunctionTypeAt(f, trait, pos, path) and tp = trait.(TraitTypeAbstraction).getATypeParameter() } @@ -120,7 +120,7 @@ predicate functionResolutionDependsOnArgument( exists(TraitItemNode trait, string functionName | implHasSibling(impl, trait) and traitTypeParameterOccurrence(trait, _, functionName, pos, path, _) and - type = assocFunctionTypeAt(f, impl, pos, path) and + type = getAssocFunctionTypeAt(f, impl, pos, path) and f = impl.getASuccessor(functionName) and pos.isPosition() ) diff --git a/rust/ql/lib/codeql/rust/internal/typeinference/FunctionType.qll b/rust/ql/lib/codeql/rust/internal/typeinference/FunctionType.qll index 4c4de4fa767..789f0ca2e3c 100644 --- a/rust/ql/lib/codeql/rust/internal/typeinference/FunctionType.qll +++ b/rust/ql/lib/codeql/rust/internal/typeinference/FunctionType.qll @@ -78,7 +78,7 @@ private newtype TAssocFunctionType = } bindingset[condition, constraint, tp] -private Type traitConstraintTypeAt( +private Type getTraitConstraintTypeAt( TypeMention condition, TypeMention constraint, TypeParameter tp, TypePath path ) { BaseTypes::conditionSatisfiesConstraintTypeAt(_, condition, constraint, @@ -90,7 +90,7 @@ private Type traitConstraintTypeAt( * `pos` at path `path` */ pragma[nomagic] -Type assocFunctionTypeAt(Function f, ImplOrTraitItemNode i, FunctionPosition pos, TypePath path) { +Type getAssocFunctionTypeAt(Function f, ImplOrTraitItemNode i, FunctionPosition pos, TypePath path) { exists(MkAssocFunctionType(f, i, pos)) and ( // No specialization needed when the function is directly in the trait or @@ -109,7 +109,7 @@ Type assocFunctionTypeAt(Function f, ImplOrTraitItemNode i, FunctionPosition pos exists(TraitItemNode trait, TypeMention condition, TypeMention constraint | trait.getAnAssocItem() = f and BaseTypes::rootTypesSatisfaction(_, TTrait(trait), _, condition, constraint) and - result = traitConstraintTypeAt(condition, constraint, tp, suffix) + result = getTraitConstraintTypeAt(condition, constraint, tp, suffix) | condition = i.(Trait) or condition = i.(Impl).getSelfTy() ) @@ -173,7 +173,7 @@ class AssocFunctionType extends MkAssocFunctionType { Type getTypeAt(TypePath path) { exists(Function f, FunctionPosition pos, ImplOrTraitItemNode i, Type t | this.appliesTo(f, i, pos) and - t = assocFunctionTypeAt(f, i, pos, path) + t = getAssocFunctionTypeAt(f, i, pos, path) | not t instanceof SelfTypeParameter and result = t