We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c12bbc6 commit 059c126Copy full SHA for 059c126
1 file changed
rust/ql/lib/codeql/rust/internal/PathResolution.qll
@@ -303,7 +303,14 @@ class CrateItemNode extends ItemNode instanceof Crate {
303
304
override TypeParam getTypeParam(int i) { none() }
305
306
- override string getCanonicalPath(Crate c) { c = this and result = Crate.super.getName() }
+ 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
+ }
314
315
override string getCanonicalPathPrefixFor(Crate c, ItemNode child) {
316
exists(ModuleLikeNode m |
0 commit comments