Skip to content

Commit 2215712

Browse files
committed
Rust: Fix bad join on name column
1 parent ca3e2db commit 2215712

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

rust/ql/lib/codeql/rust/internal/typeinference/TypeMention.qll

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class NonAliasPathTypeMention extends PathTypeMention {
149149
TypeItemNode getResolved() { result = resolved }
150150

151151
pragma[nomagic]
152-
private TypeRepr getAssocTypeArg(string name) {
152+
private TypeMention getAssocTypeArg(string name) {
153153
result = this.getSegment().getGenericArgList().getAssocTypeArg(name)
154154
}
155155

@@ -254,7 +254,7 @@ class NonAliasPathTypeMention extends PathTypeMention {
254254
)
255255
}
256256

257-
pragma[nomagic]
257+
bindingset[name]
258258
private TypeAlias getResolvedAlias(string name) {
259259
result = resolved.(TraitItemNode).getAssocItem(name)
260260
}
@@ -265,7 +265,7 @@ class NonAliasPathTypeMention extends PathTypeMention {
265265
exists(TypeAlias alias, string name |
266266
result = this.getAssocTypeArg(name) and
267267
tp = TAssociatedTypeTypeParameter(resolved, alias) and
268-
alias = resolved.(TraitItemNode).getASuccessor(name)
268+
alias = this.getResolvedAlias(name)
269269
)
270270
or
271271
// If `path` is the trait of an `impl` block then any associated types
@@ -283,10 +283,9 @@ class NonAliasPathTypeMention extends PathTypeMention {
283283
// the rhs. of the type alias is a type argument to the trait.
284284
exists(ImplItemNode impl, TypeAlias alias, string name |
285285
this = impl.getTraitPath() and
286-
alias = impl.getASuccessor(pragma[only_bind_into](name)) and
286+
alias = impl.getASuccessor(name) and
287287
result = alias.getTypeRepr() and
288-
tp =
289-
TAssociatedTypeTypeParameter(resolved, this.getResolvedAlias(pragma[only_bind_into](name)))
288+
tp = TAssociatedTypeTypeParameter(resolved, this.getResolvedAlias(name))
290289
)
291290
}
292291

0 commit comments

Comments
 (0)