aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast/rust-pattern.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/ast/rust-pattern.h')
-rw-r--r--gcc/rust/ast/rust-pattern.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/rust/ast/rust-pattern.h b/gcc/rust/ast/rust-pattern.h
index e89fc62..049aaf0 100644
--- a/gcc/rust/ast/rust-pattern.h
+++ b/gcc/rust/ast/rust-pattern.h
@@ -78,7 +78,7 @@ class IdentifierPattern : public Pattern
Location locus;
public:
- std::string as_string () const;
+ std::string as_string () const override;
// Returns whether the IdentifierPattern has a pattern to bind.
bool has_pattern_to_bind () const { return to_bind != nullptr; }
@@ -91,6 +91,15 @@ public:
is_mut (is_mut), to_bind (std::move (to_bind)), locus (locus)
{}
+ IdentifierPattern (NodeId node_id, Identifier ident, Location locus,
+ bool is_ref = false, bool is_mut = false,
+ std::unique_ptr<Pattern> to_bind = nullptr)
+ : Pattern (), variable_ident (std::move (ident)), is_ref (is_ref),
+ is_mut (is_mut), to_bind (std::move (to_bind)), locus (locus)
+ {
+ this->node_id = node_id;
+ }
+
// Copy constructor with clone
IdentifierPattern (IdentifierPattern const &other)
: variable_ident (other.variable_ident), is_ref (other.is_ref),