We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 61c81f3 commit 0f72015Copy full SHA for 0f72015
rust/ql/lib/codeql/rust/internal/PathResolution.qll
@@ -320,7 +320,14 @@ class CrateItemNode extends ItemNode instanceof Crate {
320
321
override TypeParam getTypeParam(int i) { none() }
322
323
- override string getCanonicalPath(Crate c) { c = this and result = Crate.super.getName() }
+ 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
+ }
331
332
override string getCanonicalPathPrefixFor(Crate c, ItemNode child) {
333
exists(ModuleLikeNode m |
0 commit comments