mirror of
https://github.com/github/codeql.git
synced 2026-04-24 08:15:14 +02:00
Merge pull request #19728 from hvitved/rust/type-inference-debug-predicates
Rust: Add another type inference debug predicate
This commit is contained in:
@@ -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(_, _, _))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user