codeql
codeql copied to clipboard
Rust: Fix type inference for library parameters
trafficstars
The old logic relied on parameters having a pattern, which is not the case for parameters extracted from library code.
The updated test output reveals that we do not handle operator calls correctly. For example, i32 implements both Add and Add<Rhs = &i32>, and currently we resolve 1 + 2 to both add methods, which means that 2 will have reverse-propagated type &i32 in addition to i32.