public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] Remove bad prefix from RelativeTypePath resolution
@ 2022-06-08 11:41 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-06-08 11:41 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:a80bcfc5b1cb471d904ae9135256d9d0b0d77cd4
commit a80bcfc5b1cb471d904ae9135256d9d0b0d77cd4
Author: Philip Herron <philip.herron@embecosm.com>
Date: Fri Oct 15 13:01:42 2021 +0100
Remove bad prefix from RelativeTypePath resolution
The TypePath resolver is a naieve and assumes all paths are fully
resolveable at name resolution time. This is the first patch to update
this to resolve each segement in turn.
Addresses #746
Diff:
---
gcc/rust/resolve/rust-ast-resolve-type.h | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/gcc/rust/resolve/rust-ast-resolve-type.h b/gcc/rust/resolve/rust-ast-resolve-type.h
index 137b16aced6..a6d1da14b8b 100644
--- a/gcc/rust/resolve/rust-ast-resolve-type.h
+++ b/gcc/rust/resolve/rust-ast-resolve-type.h
@@ -189,7 +189,6 @@ class ResolveRelativeTypePath : public ResolveTypeToCanonicalPath
public:
static NodeId go (AST::TypePath &path, NodeId parent,
- const CanonicalPath &prefix,
bool canonicalize_type_with_generics)
{
CanonicalPath canonical_path
@@ -203,10 +202,6 @@ public:
return UNKNOWN_NODEID;
}
- CanonicalPath lookup = canonical_path;
- if (!prefix.is_empty ())
- lookup = prefix.append (canonical_path);
-
auto resolver = Resolver::get ();
NodeId resolved_node = UNKNOWN_NODEID;
@@ -223,11 +218,10 @@ public:
}
static NodeId go (AST::QualifiedPathInType &path, NodeId parent,
- const CanonicalPath &prefix,
bool canonicalize_type_with_generics)
{
auto &qualified_path = path.get_qualified_path_type ();
- CanonicalPath result = prefix;
+ CanonicalPath result = CanonicalPath::create_empty ();
if (!resolve_qual_seg (qualified_path, result))
return UNKNOWN_NODEID;
@@ -324,7 +318,6 @@ public:
{
resolved_node
= ResolveRelativeTypePath::go (path, parent,
- CanonicalPath::create_empty (),
canonicalize_type_with_generics);
ok = resolved_node != UNKNOWN_NODEID;
if (ok)
@@ -340,7 +333,6 @@ public:
{
resolved_node
= ResolveRelativeTypePath::go (path, parent,
- CanonicalPath::create_empty (),
canonicalize_type_with_generics);
ok = resolved_node != UNKNOWN_NODEID;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-06-08 11:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 11:41 [gcc/devel/rust/master] Remove bad prefix from RelativeTypePath resolution 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).