Rust: Disambiguate types inferred from trait bounds by hvitved · Pull Request #21464 · github/codeql

In certain cases where a type implements the same trait but with different type arguments, we may infer overlapping types from trait bounds (see example in first commit).

In order to disambiguate, this PR takes the same approach as #21420, but lifting the idea from that PR into the shared type inference library, so it applies to both resolution of <Foo as Bar<...>> paths as well as constraints on type parameters inside functions.