Rust: Exclude macro call paths from resolvePath

This commit is contained in:
Tom Hvitved
2025-03-19 13:38:29 +01:00
parent 7c2bafeb17
commit 8044b0d03c
2 changed files with 3 additions and 1 deletions

View File

@@ -822,7 +822,8 @@ ItemNode resolvePath(RelevantPath path) {
exists(Namespace ns | result = resolvePath0(path, ns) |
pathUsesNamespace(path, ns)
or
not pathUsesNamespace(path, _)
not pathUsesNamespace(path, _) and
not path = any(MacroCall mc).getPath()
)
}

View File

@@ -7,6 +7,7 @@ private import PathResolution
/** Holds if `p` may resolve to multiple items including `i`. */
query predicate multiplePathResolutions(Path p, ItemNode i) {
p.fromSource() and
i = resolvePath(p) and
// `use foo::bar` may use both a type `bar` and a value `bar`
not p =