Skip to content

Commit 1cb524f

Browse files
committed
Rust: Remove useTreeIsGlobImport workaround
1 parent 9d06f80 commit 1cb524f

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -296,16 +296,8 @@ private predicate fileImportEdge(Module mod, string name, ItemNode item) {
296296
)
297297
}
298298

299-
pragma[nomagic]
300-
private predicate useTreeIsGlobImport(UseTree use) {
301-
// TODO: the extractor should provide this information
302-
use.getLocation() != use.getPath().getLocation() and
303-
not use.hasUseTreeList() and
304-
not use.hasRename()
305-
}
306-
307299
private predicate useTreeDeclares(UseTree tree, string name) {
308-
not useTreeIsGlobImport(tree) and
300+
not tree.isGlob() and
309301
not exists(tree.getUseTreeList()) and
310302
(
311303
name = tree.getRename().getName().getText() and
@@ -455,7 +447,7 @@ private predicate useImportEdge(Use use, string name, ItemNode item) {
455447
exists(UseTree tree, ItemNode used |
456448
used = resolveUseTreeListItem(use, tree) and
457449
not exists(tree.getUseTreeList()) and
458-
if useTreeIsGlobImport(tree)
450+
if tree.isGlob()
459451
then
460452
exists(ItemNode encl |
461453
encl.getADescendant() = use and

0 commit comments

Comments
 (0)