[COMMITTED 07/77] gccrs: Merge binding map when merging nr contexts
| Newsgroups | gmane.comp.gcc.rust,gmane.comp.gcc.patches |
|---|---|
| Message-ID | <[email protected]> |
From: Pierre-Emmanuel Patry <[email protected]> Name resolution on extern crate did merge the name declarations but not their usage, this lead to return types within functions not being recognized anymore. We missed the usage binding during the merge operation. gcc/rust/ChangeLog: * resolve/rust-name-resolution-context.cc (NameResolutionContext::merge): Merge nr usage binding when merging nr contexts. Signed-off-by: Pierre-Emmanuel Patry <[email protected]> --- gcc/rust/resolve/rust-name-resolution-context.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/rust/resolve/rust-name-resolution-context.cc b/gcc/rust/resolve/rust-name-resolution-context.cc index 89c724a2f41..07b8c163c19 100644 --- a/gcc/rust/resolve/rust-name-resolution-context.cc +++ b/gcc/rust/resolve/rust-name-resolution-context.cc @@ -406,6 +406,8 @@ NameResolutionContext::merge (NameResolutionContext &other, NodeId at) extern_crate_node.rib.insert (name, def); } } + stack.resolved_nodes.insert (other_stack.resolved_nodes.begin (), + other_stack.resolved_nodes.end ()); }; merge_fstack (values, other.values); -- 2.50.1