public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] resolver: Allow SimplePath to resolve to their root segment
@ 2023-03-30 6:46 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2023-03-30 6:46 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:ff4d4570b44baf6a106cb0cfde3a1fe9ff0ed09f
commit ff4d4570b44baf6a106cb0cfde3a1fe9ff0ed09f
Author: Arthur Cohen <arthur.cohen@embecosm.com>
Date: Tue Mar 28 13:55:19 2023 +0200
resolver: Allow SimplePath to resolve to their root segment
SimplePath are allowed to resolve to their root segment even if it is `crate`
or `super` when checking visibilities. We now have to make sure that this
is allowed everywhere a SimplePath is kept.
gcc/rust/ChangeLog:
* resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): Set
resolved_node_id when visiting root segment of SimplePath.
Diff:
---
gcc/rust/resolve/rust-ast-resolve-path.cc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/gcc/rust/resolve/rust-ast-resolve-path.cc b/gcc/rust/resolve/rust-ast-resolve-path.cc
index d8e6f90a9a6..ab93333d770 100644
--- a/gcc/rust/resolve/rust-ast-resolve-path.cc
+++ b/gcc/rust/resolve/rust-ast-resolve-path.cc
@@ -283,6 +283,8 @@ ResolvePath::resolve_path (AST::SimplePath *expr)
previous_resolved_node_id = module_scope_id;
resolver->insert_resolved_name (segment.get_node_id (),
module_scope_id);
+ resolved_node_id = module_scope_id;
+
continue;
}
else if (segment.is_super_path_seg ())
@@ -298,6 +300,8 @@ ResolvePath::resolve_path (AST::SimplePath *expr)
previous_resolved_node_id = module_scope_id;
resolver->insert_resolved_name (segment.get_node_id (),
module_scope_id);
+ resolved_node_id = module_scope_id;
+
continue;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-03-30 6:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-30 6:46 [gcc/devel/rust/master] resolver: Allow SimplePath to resolve to their root segment Thomas Schwinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).