gnu/gcc/954ff2f1d0844557fc70eedbc77936f63b9dc378 gccrs: nr: Add modules to types NS
gcc/rust/ChangeLog:
* util/rust-hir-map.cc (Mappings::insert_module_id): New function.
(Mappings::is_module): Likewise.
* util/rust-hir-map.h: Store a set of AST modules, declare functions for adding and
retrieving them.
* resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Insert modules in the type
namespace and store them in mappings.
* resolve/rust-late-name-resolver-2.0.cc (resolve_type_path_like): Error out when an
expected type resolves to a module.
* resolve/rust-name-resolution.h: Add empty Definition constructor.
* resolve/rust-resolve-builtins.cc (find_builtin_node_id): New function.
* resolve/rust-resolve-builtins.h: Declare it.
gcc/testsuite/ChangeLog:
* rust/compile/mod_in_types_ns.rs: New test.
* rust/compile/mod_in_types_ns2.rs: New test.
9 files changed