Skip to content

Commit bec542f

Browse files
committed
Rust: Fix type inference for library parameters
The old logic relied on parameters having a pattern, which is not the case for parameters extracted from library code.
1 parent 8fe2699 commit bec542f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ private module CallExprBaseMatchingInput implements MatchingInputSig {
569569
exists(Param p, int i, boolean inMethod |
570570
paramPos(this.getParamList(), p, i, inMethod) and
571571
dpos = TPositionalDeclarationPosition(i, inMethod) and
572-
result = inferAnnotatedType(p.getPat(), path)
572+
result = p.getTypeRepr().(TypeMention).resolveTypeAt(path)
573573
)
574574
or
575575
exists(SelfParam self |

0 commit comments

Comments
 (0)