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]>
---
This change was merged into the gccrs repository and is posted here for
upstream visibility and potential drive-by review, as requested by GCC
release managers.
Each commit email contains a link to its details on github from where you can
find the Pull-Request and associated discussions.
Commit on github:
https://github.com/Rust-GCC/gccrs/commit/5c412c7bc36539b33727cf2113196b6b16b329cc
The commit has NOT been mentioned in any issue.
The commit has been mentioned in the following pull-request(s):
- https://github.com/Rust-GCC/gccrs/pull/4588
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 89c724a2f..07b8c163c 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.54.0