aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/resolve/rust-name-resolution-context.h
diff options
context:
space:
mode:
authorOwen Avery <powerboat9.gamer@gmail.com>2025-01-22 20:12:46 -0500
committerP-E-P <32375388+P-E-P@users.noreply.github.com>2025-02-04 14:55:12 +0000
commitca227ed872e9a7b8ab9a170a2a8bbe4dc8dfd31e (patch)
tree6ab5fdb17d0c4e5b2ba6634bb16a1f39c2fd2c1f /gcc/rust/resolve/rust-name-resolution-context.h
parente7306a931281ab3d61504a99a46d1b82bda197f8 (diff)
downloadgcc-ca227ed872e9a7b8ab9a170a2a8bbe4dc8dfd31e.zip
gcc-ca227ed872e9a7b8ab9a170a2a8bbe4dc8dfd31e.tar.gz
gcc-ca227ed872e9a7b8ab9a170a2a8bbe4dc8dfd31e.tar.bz2
nr2.0: Resolve instances of TypePath more accurately
gcc/rust/ChangeLog: * util/rust-unwrap-segment.cc: New file. * util/rust-unwrap-segment.h: New file. * Make-lang.in: Add rust-unwrap-segment.o to the object list. * resolve/rust-forever-stack.hxx: Include rust-unwrap-segment.h. (ForeverStack::find_starting_point): Use unwrap_type_segment. (ForeverStack::resolve_segments): Likewise. (ForeverStack::resolve_path): Likewise. * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Resolve type paths using NameResolutionContext::resolve_path. * resolve/rust-name-resolution-context.h (NameResolutionContext::resolve_path): Use unwrap_segment_node_id. gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove entries. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
Diffstat (limited to 'gcc/rust/resolve/rust-name-resolution-context.h')
-rw-r--r--gcc/rust/resolve/rust-name-resolution-context.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/rust/resolve/rust-name-resolution-context.h b/gcc/rust/resolve/rust-name-resolution-context.h
index bd03ff9..19b9436 100644
--- a/gcc/rust/resolve/rust-name-resolution-context.h
+++ b/gcc/rust/resolve/rust-name-resolution-context.h
@@ -222,9 +222,9 @@ public:
{
std::function<void (const S &, NodeId)> insert_segment_resolution
= [this] (const S &seg, NodeId id) {
- if (resolved_nodes.find (Usage (seg.get_node_id ()))
- == resolved_nodes.end ())
- map_usage (Usage (seg.get_node_id ()), Definition (id));
+ auto seg_id = unwrap_segment_node_id (seg);
+ if (resolved_nodes.find (Usage (seg_id)) == resolved_nodes.end ())
+ map_usage (Usage (seg_id), Definition (id));
};
switch (ns)
{