diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-01-29 15:00:30 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-29 15:00:30 +0000 |
commit | 631f7ae7b9dbb55ed3adce942952f93b48983a53 (patch) | |
tree | f5fc89773ab1941593f3f2230908919063679c68 /gcc/rust/resolve/rust-name-resolver.h | |
parent | bc7f518ac6f5c05f1c6edd7a1601f32753bab47d (diff) | |
parent | 2fbf9cb25e930e2df86d05e0f7f707e69bae2b1f (diff) | |
download | gcc-631f7ae7b9dbb55ed3adce942952f93b48983a53.zip gcc-631f7ae7b9dbb55ed3adce942952f93b48983a53.tar.gz gcc-631f7ae7b9dbb55ed3adce942952f93b48983a53.tar.bz2 |
Merge #894
894: Update name-resolution to build up canonical-path with the crate-name r=philberty a=philberty
The name resolver there are two types of canonical-path object.
1. The relative canonical path to a type for name resolution
2. The full canonical-path including the crate-name (this-was-missing)
The lack of the crate-name being present in the canonical-path meant the
symbol mangling system was required to append it where appropriate but this
was going to be too messy to handle all cases. Such as module blocks
containing impl blocks requires a ```prefix::<impl crate::path>::item``` and
similarly for trait impl blocks.
Co-authored-by: Philip Herron <philip.herron@embecosm.com>
Diffstat (limited to 'gcc/rust/resolve/rust-name-resolver.h')
-rw-r--r-- | gcc/rust/resolve/rust-name-resolver.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/rust/resolve/rust-name-resolver.h b/gcc/rust/resolve/rust-name-resolver.h index ac00d58..199b0f9 100644 --- a/gcc/rust/resolve/rust-name-resolver.h +++ b/gcc/rust/resolve/rust-name-resolver.h @@ -39,6 +39,7 @@ public: ~Rib () {} + // this takes the relative paths of items within a compilation unit for lookup void insert_name ( const CanonicalPath &path, NodeId id, Location locus, bool shadow, std::function<void (const CanonicalPath &, NodeId, Location)> dup_cb) @@ -60,7 +61,6 @@ public: reverse_path_mappings.insert (std::pair<NodeId, CanonicalPath> (id, path)); decls_within_rib.insert (std::pair<NodeId, Location> (id, locus)); references[id] = {}; - mappings->insert_canonical_path (mappings->get_current_crate (), id, path); } bool lookup_name (const CanonicalPath &ident, NodeId *id) |