Rust: Add another type inference debug predicate

This commit is contained in:
Tom Hvitved
2025-06-11 12:43:11 +02:00
parent 75caa182f5
commit 9f8a3abcff

View File

@@ -1516,4 +1516,15 @@ private module Debug {
mce = getRelevantLocatable() and
result = resolveMethodCallTarget(mce)
}
pragma[nomagic]
private int countTypes(AstNode n, TypePath path, Type t) {
t = inferType(n, path) and
result = strictcount(Type t0 | t0 = inferType(n, path))
}
predicate maxTypes(AstNode n, TypePath path, Type t, int c) {
c = countTypes(n, path, t) and
c = max(countTypes(_, _, _))
}
}