diff --git a/rust/ql/lib/codeql/rust/internal/PathResolution.qll b/rust/ql/lib/codeql/rust/internal/PathResolution.qll index 91d7e87704c6..00257238f213 100644 --- a/rust/ql/lib/codeql/rust/internal/PathResolution.qll +++ b/rust/ql/lib/codeql/rust/internal/PathResolution.qll @@ -764,6 +764,10 @@ private predicate crateDependencyEdge(ModuleLikeNode m, string name, CrateItemNo // entry/transitive source file m = c.getASourceFile() ) + or + // paths inside the crate graph use the name of the crate itself as prefix, + // although that is not valid in Rust + dep = any(Crate c | name = c.getName() and m = c.getModule()) } private predicate useTreeDeclares(UseTree tree, string name) {