diff --git a/rust/ql/lib/codeql/rust/internal/TypeInference.qll b/rust/ql/lib/codeql/rust/internal/TypeInference.qll index 2fae9ef1f5b8..0f0c92306d12 100644 --- a/rust/ql/lib/codeql/rust/internal/TypeInference.qll +++ b/rust/ql/lib/codeql/rust/internal/TypeInference.qll @@ -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) + } +}