diff --git a/rust/ql/lib/codeql/rust/internal/typeinference/AssociatedTypes.qll b/rust/ql/lib/codeql/rust/internal/typeinference/AssociatedTypes.qll index 546bdad6169..b53f6177ab9 100644 --- a/rust/ql/lib/codeql/rust/internal/typeinference/AssociatedTypes.qll +++ b/rust/ql/lib/codeql/rust/internal/typeinference/AssociatedTypes.qll @@ -21,7 +21,7 @@ final class AssocType extends TypeAlias { /** Gets an associated type of `trait` or of a supertrait of `trait`. */ AssocType getTraitAssocType(Trait trait) { - result = trait.getSupertrait*().getAssocItemList().getAnAssocItem() + result.getTrait() = trait.getSupertrait*() } /** Holds if `path` is of the form `::name` */ @@ -44,7 +44,7 @@ predicate tpAssociatedType(TypeParam tp, AssocType assoc, Path path) { resolvePath(path.getQualifier()) = tp and resolvePath(path) = assoc or - exists(TypeRepr typeRepr, Path traitPath, string name | + exists(PathTypeRepr typeRepr, Path traitPath, string name | asTraitPath(path, typeRepr, traitPath, name) and tp = resolvePath(typeRepr.(PathTypeRepr).getPath()) and assoc = resolvePath(traitPath).(TraitItemNode).getAssocItem(name) diff --git a/rust/ql/lib/codeql/rust/internal/typeinference/Type.qll b/rust/ql/lib/codeql/rust/internal/typeinference/Type.qll index f9cebef3523..4a4f00d7eba 100644 --- a/rust/ql/lib/codeql/rust/internal/typeinference/Type.qll +++ b/rust/ql/lib/codeql/rust/internal/typeinference/Type.qll @@ -496,7 +496,7 @@ class TypeParamAssociatedTypeTypeParameter extends TypeParameter, AssocType getTypeAlias() { result = assoc } /** Gets a path that accesses this type parameter. */ - Path getPath() { tpAssociatedType(typeParam, assoc, result) } + Path getAPath() { tpAssociatedType(typeParam, assoc, result) } override ItemNode getDeclaringItem() { result.getTypeParam(_) = typeParam } diff --git a/rust/ql/lib/codeql/rust/internal/typeinference/TypeMention.qll b/rust/ql/lib/codeql/rust/internal/typeinference/TypeMention.qll index 0c71b03c637..70e1b0d7e91 100644 --- a/rust/ql/lib/codeql/rust/internal/typeinference/TypeMention.qll +++ b/rust/ql/lib/codeql/rust/internal/typeinference/TypeMention.qll @@ -322,7 +322,7 @@ private module MkTypeMention