Skip to content

Commit 7bbf269

Browse files
committed
WIP
1 parent 50e34d7 commit 7bbf269

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,6 +1802,10 @@ private module BlanketImplementation {
18021802
}
18031803

18041804
predicate methodCallMatchesBlanketImpl(MethodCall mc, Type t, Impl impl, Trait trait, Function f) {
1805+
// Only check method calls where we have ruled out inherent method targets.
1806+
// Ideally we would also check if non-blanket method targets have been ruled
1807+
// out.
1808+
methodCallHasNoInherentTarget(mc) and
18051809
exists(string name, int arity |
18061810
isMethodCall(mc, t, name, arity) and
18071811
blanketImplementationMethod(impl, trait, name, arity, f)
@@ -1871,8 +1875,8 @@ private Function resolveMethodCallTarget(MethodCall mc) {
18711875
// The method comes from an `impl` block targeting the type of the receiver.
18721876
result = getMethodFromImpl(mc)
18731877
or
1874-
// result = BlanketImplementation::getMethodFromBlanketImpl(mc)
1875-
// or
1878+
result = BlanketImplementation::getMethodFromBlanketImpl(mc)
1879+
or
18761880
// The type of the receiver is a type parameter and the method comes from a
18771881
// trait bound on the type parameter.
18781882
result = getTypeParameterMethod(mc.getTypeAt(TypePath::nil()), mc.getMethodName())

0 commit comments

Comments
 (0)