Skip to content

Commit c6894ea

Browse files
committed
wip3
1 parent c9aba13 commit c6894ea

1 file changed

Lines changed: 1 addition & 16 deletions

File tree

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

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -811,29 +811,14 @@ private module Input3 implements InputSig3 {
811811
)
812812
}
813813

814-
pragma[nomagic]
815-
private predicate foo(
816-
AssocFunctionResolution::AssocFunctionCall call, AstNode receiver, TypeParameter tp
817-
) {
818-
call.(AssocFunctionResolution::AssocFunctionCall).hasReceiver() and
819-
receiver = call.getNodeAt(any(FunctionPosition pos | pos.asPosition() = 0)) and
820-
tp = inferType(receiver).getATypeParameter()
821-
}
822-
823814
Type inferCallArgumentTypeContextual(AstNode n, TypePath path) {
824815
exists(Call call, FunctionPosition pos, TypePath path0 |
825816
result = inferCallArgumentTypeContextualDefault(call, pos.asPosition(), n, _, _, path0) and
826817
not call.(AssocFunctionResolution::AssocFunctionCall).hasReceiverAtPos(pos)
827818
or
828819
pos.asPosition() = 0 and
829820
result = inferFunctionCallSelfArgumentTypeContextual(call, n, DerefChain::nil(), path0) and
830-
// for method calls, the root type will have to be known already in order to resolve the call,
831-
// so only propagate contextual information that is compatible with the root type
832-
(
833-
foo(call, n, path.getHead())
834-
or
835-
not call.(AssocFunctionResolution::AssocFunctionCall).hasReceiver()
836-
)
821+
not path0.isEmpty()
837822
|
838823
if call.(AssocFunctionResolution::OperationAssocFunctionCall).implicitBorrowAt(pos, _)
839824
then

0 commit comments

Comments
 (0)