Skip to content

Commit 337e161

Browse files
authored
Merge pull request #20834 from hvitved/rust/fix-bad-join
Rust: Fix bad join
2 parents caccee9 + f926a07 commit 337e161

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,11 @@ class NonAliasPathTypeMention extends PathTypeMention {
207207
)
208208
}
209209

210+
pragma[nomagic]
211+
private TypeAlias getResolvedAlias(string name) {
212+
result = resolved.(TraitItemNode).getAssocItem(name)
213+
}
214+
210215
/** Gets the type mention in this path for the type parameter `tp`, if any. */
211216
pragma[nomagic]
212217
private TypeMention getTypeMentionForTypeParameter(TypeParameter tp) {
@@ -228,16 +233,11 @@ class NonAliasPathTypeMention extends PathTypeMention {
228233
// }
229234
// ```
230235
// the rhs. of the type alias is a type argument to the trait.
231-
exists(ImplItemNode impl, AssociatedTypeTypeParameter param, TypeAlias alias, string name |
236+
exists(ImplItemNode impl, TypeAlias alias, string name |
232237
this = impl.getTraitPath() and
233-
param.getTrait() = resolved and
234-
name = param.getTypeAlias().getName().getText() and
235238
alias = impl.getASuccessor(pragma[only_bind_into](name)) and
236239
result = alias.getTypeRepr() and
237-
tp =
238-
TAssociatedTypeTypeParameter(resolved
239-
.(TraitItemNode)
240-
.getAssocItem(pragma[only_bind_into](name)))
240+
tp = TAssociatedTypeTypeParameter(this.getResolvedAlias(pragma[only_bind_into](name)))
241241
)
242242
or
243243
// Handle the special syntactic sugar for function traits. For now we only

0 commit comments

Comments
 (0)