mirror of
https://github.com/github/codeql.git
synced 2026-04-24 16:25:15 +02:00
Rust: Add type inference debug predicates
This commit is contained in:
@@ -1017,3 +1017,24 @@ import Cached
|
||||
* Gets a type that `n` infers to, if any.
|
||||
*/
|
||||
Type inferType(AstNode n) { result = inferType(n, TypePath::nil()) }
|
||||
|
||||
/** Provides predicates for debugging the type inference implementation. */
|
||||
private module Debug {
|
||||
private Locatable getRelevantLocatable() {
|
||||
exists(string filepath, int startline, int startcolumn, int endline, int endcolumn |
|
||||
result.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn) and
|
||||
filepath.matches("%/tauri/src/app/plugin.rs") and
|
||||
startline = 54
|
||||
)
|
||||
}
|
||||
|
||||
Type debugInferType(AstNode n, TypePath path) {
|
||||
n = getRelevantLocatable() and
|
||||
result = inferType(n, path)
|
||||
}
|
||||
|
||||
Function debugResolveMethodCallExpr(MethodCallExpr mce) {
|
||||
mce = getRelevantLocatable() and
|
||||
result = resolveMethodCallExpr(mce)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user