From: Pierre-Emmanuel Patry <[email protected]>
We did not assign any node id to neither extern and lang prelude nodes
and this was confusing and could lead to unexpected behaviors (duplicate
ids).
gcc/rust/ChangeLog:
* resolve/rust-forever-stack.h: Assign a node id to extern and lang
nodes.
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/d46d7b66fb48c9d1c6f54aa3e0cab510275dea05
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/4758
gcc/rust/resolve/rust-forever-stack.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gcc/rust/resolve/rust-forever-stack.h
b/gcc/rust/resolve/rust-forever-stack.h
index 80ac7a45e..33680141a 100644
--- a/gcc/rust/resolve/rust-forever-stack.h
+++ b/gcc/rust/resolve/rust-forever-stack.h
@@ -597,9 +597,12 @@ public:
// TODO: Should we be using the forever stack root as the crate scope?
// TODO: Is this how we should be getting the crate node id?
- auto &crate_mappings = Analysis::Mappings::get ().crate;
+ auto &mappings = Analysis::Mappings::get ();
+ auto &crate_mappings = mappings.crate;
root.id = *crate_mappings.crate_num_to_nodeid (
crate_mappings.get_current_crate ());
+ extern_prelude.id = mappings.get_next_node_id ();
+ lang_prelude.id = mappings.get_next_node_id ();
}
/**
--
2.55.0