You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow crates to be used as targets for glob imports, like modules and enums.
gcc/rust/ChangeLog:
* ast/rust-ast-full-decls.h (class GlobContainer): New.
* ast/rust-ast.h (class GlobContainer): New.
(struct Crate): Inherit from GlobContainer.
* ast/rust-item.h (class Module): Likewise.
(class Enum): Likewise.
* resolve/rust-finalize-imports-2.0.cc (GlobbingVisitor::go): Handle crates.
(GlobbingVisitor::visit_crate_container): New.
(GlobbingVisitor::visit): Remove privacy check as it is wrong.
* resolve/rust-finalize-imports-2.0.h: Declare new methods.
* resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::go): Handle crates.
(TopLevel::visit): Use new insert_glob_container API.
* util/rust-hir-map.cc (Mappings::get_ast_crate_by_node_id_raw): New private method.
(Mappings::get_ast_crate_by_node_id): Use it.
(Mappings::insert_glob_container): New API.
* util/rust-hir-map.h: Likewise.
* resolve/rust-early-name-resolver-2.0.cc (Early::finalize_glob_import): Likewise.
0 commit comments