]> 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)
committerCohenArthur <arthur.cohen@embecosm.com>
Wed, 28 Aug 2024 18:19:41 +0000 (18:19 +0000)
commit5da381ffd112693836b4532f680a5bd512552837
treeabfd755c13e22c8efc8fd6cc8f67217a03dfe687
parentaf7e8fda83d8b34170f4fdf3371b67cd6b4e72f1
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]