aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/resolve/rust-rib.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/resolve/rust-rib.h')
-rw-r--r--gcc/rust/resolve/rust-rib.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/rust/resolve/rust-rib.h b/gcc/rust/resolve/rust-rib.h
index ea69cc7..37bd90f 100644
--- a/gcc/rust/resolve/rust-rib.h
+++ b/gcc/rust/resolve/rust-rib.h
@@ -93,7 +93,7 @@ public:
ForwardTypeParamBan,
/* Const generic, as in the following example: fn foo<T, const X: T>() {} */
ConstParamType,
- };
+ } kind;
Rib (Kind kind);
Rib (Kind kind, std::string identifier, NodeId id);
@@ -107,12 +107,14 @@ public:
*
* @param name The name associated with the AST node
* @param id Its NodeId
+ * @param can_shadow If the newly inserted value can shadow an existing one
*
* @return `DuplicateNameError` if the node is already present in the rib. The
* `DuplicateNameError` class contains the NodeId of the existing
* node. Returns the new NodeId on success.
*/
- tl::expected<NodeId, DuplicateNameError> insert (std::string name, NodeId id);
+ tl::expected<NodeId, DuplicateNameError> insert (std::string name, NodeId id,
+ bool can_shadow = false);
/**
* Access an inserted NodeId.
@@ -125,7 +127,6 @@ public:
const std::unordered_map<std::string, NodeId> &get_values () const;
private:
- Kind kind;
std::unordered_map<std::string, NodeId> values;
};