mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
Rust: Exclude macro call paths from resolvePath
This commit is contained in:
@@ -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()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user