aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/hir/tree/rust-hir.h
diff options
context:
space:
mode:
authorRaiki Tamura <tamaron1203@gmail.com>2024-08-09 23:56:55 +0900
committerArthur Cohen <arthur.cohen@embecosm.com>2025-03-19 15:32:04 +0100
commit4f58a20d7e27aaa63e21dba072013b496baa94d1 (patch)
treef24aee86be0a05780d0854a59061242ecf169d55 /gcc/rust/hir/tree/rust-hir.h
parentb7e79e38fe97e9f41008f0a48bd41ffdd7a2895c (diff)
downloadgcc-4f58a20d7e27aaa63e21dba072013b496baa94d1.zip
gcc-4f58a20d7e27aaa63e21dba072013b496baa94d1.tar.gz
gcc-4f58a20d7e27aaa63e21dba072013b496baa94d1.tar.bz2
gccrs: Add typecheck for path patterns.
gcc/rust/ChangeLog: * hir/tree/rust-hir.cc (Item::item_kind_string): New function. * hir/tree/rust-hir.h: New function. * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Modify to check all arms in match expressions even if some of them has errors. * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Add and fix check for path patterns. gcc/testsuite/ChangeLog: * rust/compile/issue-2324-2.rs: Fix error message. * rust/compile/match9.rs: New test. Signed-off-by: Raiki Tamura <tamaron1203@gmail.com>
Diffstat (limited to 'gcc/rust/hir/tree/rust-hir.h')
-rw-r--r--gcc/rust/hir/tree/rust-hir.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/rust/hir/tree/rust-hir.h b/gcc/rust/hir/tree/rust-hir.h
index 8a27161..f8eb22d 100644
--- a/gcc/rust/hir/tree/rust-hir.h
+++ b/gcc/rust/hir/tree/rust-hir.h
@@ -220,6 +220,8 @@ public:
Module,
};
+ static std::string item_kind_string (ItemKind kind);
+
virtual ItemKind get_item_kind () const = 0;
// Unique pointer custom clone function