[committed 16/88] gccrs: Add get_item method for HIR::GroupedPattern

arthur.cohen@embecosm.com arthur.cohen@embecosm.com
Wed Apr 5 14:03:00 GMT 2023


From: Owen Avery <powerboat9.gamer@gmail.com>

gcc/rust/ChangeLog:

	* hir/tree/rust-hir-pattern.h: Add get_item method.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
---
 gcc/rust/hir/tree/rust-hir-pattern.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gcc/rust/hir/tree/rust-hir-pattern.h b/gcc/rust/hir/tree/rust-hir-pattern.h
index 80fa9b791a7..b7a230c526f 100644
--- a/gcc/rust/hir/tree/rust-hir-pattern.h
+++ b/gcc/rust/hir/tree/rust-hir-pattern.h
@@ -1269,6 +1269,12 @@ public:
     return PatternType::GROUPED;
   }
 
+  std::unique_ptr<Pattern> &get_item () { return pattern_in_parens; }
+  const std::unique_ptr<Pattern> &get_item () const
+  {
+    return pattern_in_parens;
+  }
+
 protected:
   /* Use covariance to implement clone function as returning this object rather
    * than base */
-- 
2.40.0



More information about the Gcc-rust mailing list