diff options
author | Philip Herron <philip.herron@embecosm.com> | 2021-10-15 13:01:42 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2021-10-22 10:34:23 +0100 |
commit | a80bcfc5b1cb471d904ae9135256d9d0b0d77cd4 (patch) | |
tree | 6394daac0a1a3addd6e5843adeb99ea1d30880e7 /gcc | |
parent | 649e3e074bf8306bf0eb042f10483dbd61cd040b (diff) | |
download | gcc-a80bcfc5b1cb471d904ae9135256d9d0b0d77cd4.zip gcc-a80bcfc5b1cb471d904ae9135256d9d0b0d77cd4.tar.gz gcc-a80bcfc5b1cb471d904ae9135256d9d0b0d77cd4.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/resolve/rust-ast-resolve-type.h | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/gcc/rust/resolve/rust-ast-resolve-type.h b/gcc/rust/resolve/rust-ast-resolve-type.h index 137b16a..a6d1da1 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; } |