Rust: Remove useTreeIsGlobImport workaround

This commit is contained in:
Tom Hvitved
2025-01-31 10:10:26 +01:00
parent 9d06f80902
commit 1cb524f76f

View File

@@ -296,16 +296,8 @@ private predicate fileImportEdge(Module mod, string name, ItemNode item) {
)
}
pragma[nomagic]
private predicate useTreeIsGlobImport(UseTree use) {
// TODO: the extractor should provide this information
use.getLocation() != use.getPath().getLocation() and
not use.hasUseTreeList() and
not use.hasRename()
}
private predicate useTreeDeclares(UseTree tree, string name) {
not useTreeIsGlobImport(tree) and
not tree.isGlob() and
not exists(tree.getUseTreeList()) and
(
name = tree.getRename().getName().getText() and
@@ -455,7 +447,7 @@ private predicate useImportEdge(Use use, string name, ItemNode item) {
exists(UseTree tree, ItemNode used |
used = resolveUseTreeListItem(use, tree) and
not exists(tree.getUseTreeList()) and
if useTreeIsGlobImport(tree)
if tree.isGlob()
then
exists(ItemNode encl |
encl.getADescendant() = use and