Skip to content

Commit fbab715

Browse files
committed
Rust: Allow for crate self-references in crate graph paths
1 parent 8d467c7 commit fbab715

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
@@ -764,6 +764,10 @@ private predicate crateDependencyEdge(ModuleLikeNode m, string name, CrateItemNo
764764
// entry/transitive source file
765765
m = c.getASourceFile()
766766
)
767+
or
768+
// paths inside the crate graph use the name of the crate itself as prefix,
769+
// although that is not valid in Rust
770+
dep = any(Crate c | name = c.getName() and m = c.getModule())
767771
}
768772

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

0 commit comments

Comments
 (0)