]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Add typecheck for path patterns.
authorRaiki Tamura <tamaron1203@gmail.com>
Fri, 9 Aug 2024 14:56:55 +0000 (23:56 +0900)
committerArthur Cohen <arthur.cohen@embecosm.com>
Wed, 19 Mar 2025 14:32:04 +0000 (15:32 +0100)
commit4f58a20d7e27aaa63e21dba072013b496baa94d1
treef24aee86be0a05780d0854a59061242ecf169d55
parentb7e79e38fe97e9f41008f0a48bd41ffdd7a2895c
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>
gcc/rust/hir/tree/rust-hir.cc
gcc/rust/hir/tree/rust-hir.h
gcc/rust/typecheck/rust-hir-type-check-expr.cc
gcc/rust/typecheck/rust-hir-type-check-pattern.cc
gcc/testsuite/rust/compile/issue-2324-2.rs
gcc/testsuite/rust/compile/match9.rs [new file with mode: 0644]