Skip to content

Commit f2f5739

Browse files
authored
Merge pull request #19123 from hvitved/rust/path-resolution-crate-non-source
Rust: Also resolve `crate` paths in non-source files
2 parents 2a78211 + 284df7f commit f2f5739

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

+6-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,12 @@ abstract class ItemNode extends Locatable {
187187
this = result.(ImplOrTraitItemNode).getAnItemInSelfScope()
188188
or
189189
name = "crate" and
190-
this = result.(CrateItemNode).getASourceFile()
190+
result =
191+
any(CrateItemNode crate |
192+
this = crate.getASourceFile()
193+
or
194+
this = crate.getModuleNode()
195+
)
191196
}
192197

193198
/** Gets the location of this item. */

0 commit comments

Comments
 (0)