mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
26 lines
815 B
Plaintext
26 lines
815 B
Plaintext
import rust
|
|
import codeql.rust.internal.PathResolution
|
|
import utils.test.PathResolutionInlineExpectationsTest
|
|
import TestUtils
|
|
|
|
query predicate mod(Module m) { toBeTested(m) }
|
|
|
|
final private class ItemNodeFinal = ItemNode;
|
|
|
|
class ItemNodeLoc extends ItemNodeFinal {
|
|
predicate hasLocationInfo(
|
|
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
|
) {
|
|
exists(string file |
|
|
this.getLocation().hasLocationInfo(file, startline, startcolumn, endline, endcolumn) and
|
|
filepath =
|
|
file.regexpReplaceAll("^/.*/.rustup/toolchains/[^/]+/", "/RUSTUP_HOME/toolchain/")
|
|
.regexpReplaceAll("^/.*/tools/builtins/", "/BUILTINS/")
|
|
)
|
|
}
|
|
}
|
|
|
|
query predicate resolvePath(Path p, ItemNodeLoc i) {
|
|
toBeTested(p) and not p.isInMacroExpansion() and i = resolvePath(p)
|
|
}
|