Merge binding map when merging name resolution contexts.
Fixes issues with recognizing return types in functions after merging name resolution contexts for extern crates.
This commit addresses an issue in gccrs where merging name resolution contexts for extern crates did not correctly merge usage bindings. Previously, only name declarations were merged, leading to problems such as return types within functions not being recognized. By ensuring usage bindings are also merged, the compiler can now correctly resolve these types.
In Details
The NameResolutionContext::merge function in gccrs now correctly merges usage bindings in addition to name declarations when processing extern crates. This resolves a bug where return types in function signatures could be unresolved if they depended on items from an extern crate whose context was merged without its full usage information.
- name resolution
- The process of determining which identifier in source code refers to which declaration, such as a function, variable, or type.
- extern crate
- In Rust, a keyword used to declare that a crate (a compilation unit) is external to the current one and should be made available for use.
- binding map
- A data structure used during name resolution to store the mapping between identifiers and the declarations they refer to.