Skip to content

Commit 0f72015

Browse files
committed
wip
1 parent 61c81f3 commit 0f72015

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,14 @@ class CrateItemNode extends ItemNode instanceof Crate {
320320

321321
override TypeParam getTypeParam(int i) { none() }
322322

323-
override string getCanonicalPath(Crate c) { c = this and result = Crate.super.getName() }
323+
override string getCanonicalPath(Crate c) {
324+
c = this and
325+
result = Crate.super.getName() and
326+
not exists(FunctionItemNode main |
327+
main.getImmediateParent() = this.getModuleNode() and
328+
main.getName() = "main"
329+
)
330+
}
324331

325332
override string getCanonicalPathPrefixFor(Crate c, ItemNode child) {
326333
exists(ModuleLikeNode m |

0 commit comments

Comments
 (0)