Skip to content

Commit 284df7f

Browse files
committed
Rust: Also resolve crate paths in non-source files
1 parent df721f8 commit 284df7f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
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)