diff options
Diffstat (limited to 'gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h')
-rw-r--r-- | gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h index fabcb5b..3ff37ed 100644 --- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h +++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h @@ -108,15 +108,19 @@ public: {} }; - std::unordered_map<NodeId, std::vector<ImportKind>> && - get_imports_to_resolve () + std::unordered_map<NodeId, std::vector<ImportKind>> &get_imports_to_resolve () { - return std::move (imports_to_resolve); + return imports_to_resolve; } + void check_multiple_insertion_error ( + tl::expected<NodeId, DuplicateNameError> result, + const Identifier &identifier, const location_t &locus, + const NodeId node_id); + /** - * Insert a new definition or error out if a definition with the same name was - * already present in the same namespace in the same scope. + * Insert a new definition or error out if a definition with the same name + * was already present in the same namespace in the same scope. * * @param identifier The identifier of the definition to add. * @param node A reference to the node, so we can get its `NodeId` and @@ -130,6 +134,14 @@ public: const location_t &locus, const NodeId &id, Namespace ns); + template <typename T> + void insert_enum_variant_or_error_out (const Identifier &identifier, + const T &node); + + void insert_enum_variant_or_error_out (const Identifier &identifier, + const location_t &locus, + const NodeId node_id); + private: // If a new export has been defined whilst visiting the visitor is considered // dirty |