Skip to content

Commit 202a271

Browse files
committed
Rust: use getAnItemInScope instead of getAnItem
This should handle cases where items are declared inside `extern` blocks
1 parent a834f35 commit 202a271

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ class TypeParamItemNode extends ItemNode instanceof TypeParam {
946946

947947
/** Holds if `item` has the name `name` and is a top-level item inside `f`. */
948948
private predicate sourceFileEdge(SourceFile f, string name, ItemNode item) {
949-
item = f.getAnItem() and
949+
item = f.(ModuleLikeNode).getAnItemInScope() and
950950
name = item.getName()
951951
}
952952

0 commit comments

Comments
 (0)