Skip to content

Commit 059c126

Browse files
committed
wip
1 parent c12bbc6 commit 059c126

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,14 @@ class CrateItemNode extends ItemNode instanceof Crate {
303303

304304
override TypeParam getTypeParam(int i) { none() }
305305

306-
override string getCanonicalPath(Crate c) { c = this and result = Crate.super.getName() }
306+
override string getCanonicalPath(Crate c) {
307+
c = this and
308+
result = Crate.super.getName() and
309+
not exists(FunctionItemNode main |
310+
main.getImmediateParent() = this.getModuleNode() and
311+
main.getName() = "main"
312+
)
313+
}
307314

308315
override string getCanonicalPathPrefixFor(Crate c, ItemNode child) {
309316
exists(ModuleLikeNode m |

0 commit comments

Comments
 (0)