Merge pull request #19728 from hvitved/rust/type-inference-debug-predicates

Rust: Add another type inference debug predicate
This commit is contained in:
Tom Hvitved
2025-06-12 12:15:19 +02:00
committed by GitHub

View File

@@ -1570,4 +1570,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(_, _, _))
}
}