Skip to content

Commit 0e31bf1

Browse files
authored
Merge pull request #19265 from hvitved/rust/crate-graph-self-crate-ref
2 parents a6b20d7 + fbab715 commit 0e31bf1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

rust/ql/lib/codeql/rust/internal/PathResolution.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,10 @@ private predicate crateDependencyEdge(ModuleLikeNode m, string name, CrateItemNo
784784
// entry/transitive source file
785785
m = c.getASourceFile()
786786
)
787+
or
788+
// paths inside the crate graph use the name of the crate itself as prefix,
789+
// although that is not valid in Rust
790+
dep = any(Crate c | name = c.getName() and m = c.getModule())
787791
}
788792

789793
private predicate useTreeDeclares(UseTree tree, string name) {

0 commit comments

Comments
 (0)