diff options
Diffstat (limited to 'gcc/rust/hir/tree/rust-hir-pattern.h')
-rw-r--r-- | gcc/rust/hir/tree/rust-hir-pattern.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/gcc/rust/hir/tree/rust-hir-pattern.h b/gcc/rust/hir/tree/rust-hir-pattern.h index e5d8371..5cc5c95 100644 --- a/gcc/rust/hir/tree/rust-hir-pattern.h +++ b/gcc/rust/hir/tree/rust-hir-pattern.h @@ -19,12 +19,13 @@ #ifndef RUST_HIR_PATTERN_H #define RUST_HIR_PATTERN_H +#include "rust-hir-pattern-abstract.h" #include "rust-common.h" -#include "rust-hir.h" +#include "rust-hir-literal.h" +#include "rust-hir-path.h" namespace Rust { namespace HIR { - // Literal pattern HIR node (comparing to a literal) class LiteralPattern : public Pattern { @@ -132,7 +133,7 @@ public: bool is_mut () const { return mut == Mutability::Mut; } bool get_is_ref () const { return is_ref; } - std::unique_ptr<Pattern> &get_to_bind () { return to_bind; } + Pattern &get_to_bind () { return *to_bind; } void accept_vis (HIRFullVisitor &vis) override; void accept_vis (HIRPatternVisitor &vis) override; @@ -405,9 +406,9 @@ public: return PatternType::RANGE; } - std::unique_ptr<RangePatternBound> &get_lower_bound () { return lower; } + RangePatternBound &get_lower_bound () { return *lower; } - std::unique_ptr<RangePatternBound> &get_upper_bound () { return upper; } + RangePatternBound &get_upper_bound () { return *upper; } protected: /* Use covariance to implement clone function as returning this object rather @@ -476,7 +477,7 @@ public: return PatternType::REFERENCE; } - std::unique_ptr<Pattern> &get_referenced_pattern () { return pattern; } + Pattern &get_referenced_pattern () { return *pattern; } protected: /* Use covariance to implement clone function as returning this object rather @@ -572,7 +573,7 @@ public: void accept_vis (HIRFullVisitor &vis) override; TupleIndex get_index () { return index; } - std::unique_ptr<Pattern> &get_tuple_pattern () { return tuple_pattern; } + Pattern &get_tuple_pattern () { return *tuple_pattern; } ItemType get_item_type () const override final { return ItemType::TUPLE_PAT; } @@ -630,7 +631,7 @@ public: Identifier get_identifier () const { return ident; } - std::unique_ptr<Pattern> &get_pattern () { return ident_pattern; } + Pattern &get_pattern () { return *ident_pattern; } protected: /* Use covariance to implement clone function as returning this object rather @@ -1002,7 +1003,7 @@ public: PathInExpression &get_path () { return path; } - std::unique_ptr<TupleStructItems> &get_items () { return items; } + TupleStructItems &get_items () { return *items; } const Analysis::NodeMapping &get_mappings () const override final { @@ -1221,8 +1222,8 @@ public: return PatternType::TUPLE; } - std::unique_ptr<TuplePatternItems> &get_items () { return items; } - const std::unique_ptr<TuplePatternItems> &get_items () const { return items; } + TuplePatternItems &get_items () { return *items; } + const TuplePatternItems &get_items () const { return *items; } protected: /* Use covariance to implement clone function as returning this object rather |