File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
rust/ql/lib/codeql/rust/internal Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -173,6 +173,7 @@ abstract class ItemNode extends Locatable {
173173 crateDefEdge ( this , name , result , kind )
174174 or
175175 crateDependencyEdge ( this , name , result ) and
176+ not declares ( this , TTypeNamespace ( ) , name ) and
176177 kind .isInternal ( )
177178 or
178179 externCrateEdge ( this , name , result ) and
@@ -1138,6 +1139,11 @@ private class BuiltinSourceFile extends SourceFileItemNode {
11381139pragma [ nomagic]
11391140private predicate crateDependencyEdge ( SourceFileItemNode file , string name , CrateItemNode dep ) {
11401141 exists ( CrateItemNode c | dep = c .( Crate ) .getDependency ( name ) | file = c .getASourceFile ( ) )
1142+ or
1143+ // All files _should_ belong to a crate, but for those where we cannot identify the crate,
1144+ // give access to all crates as a fallback.
1145+ not file = any ( Crate c ) .getASourceFile ( ) and
1146+ name = dep .getName ( )
11411147}
11421148
11431149private predicate useTreeDeclares ( UseTree tree , string name ) {
You can’t perform that action at this time.
0 commit comments