diff options
author | Muhammad Mahad <mahadtxt@gmail.com> | 2023-08-16 17:40:09 +0500 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2023-08-17 10:00:47 +0000 |
commit | 294c5906d7b6e9f7a89e58c334f0072f98b679c6 (patch) | |
tree | 7c25d54307ecc276d83dbb9413e2855e0dac82be /gcc/rust/backend | |
parent | b9ae3541a16fef4f60daeee90dbbc7861f1b9584 (diff) | |
download | gcc-294c5906d7b6e9f7a89e58c334f0072f98b679c6.zip gcc-294c5906d7b6e9f7a89e58c334f0072f98b679c6.tar.gz gcc-294c5906d7b6e9f7a89e58c334f0072f98b679c6.tar.bz2 |
gccrs: [E0164] Neither tuple struct nor tuple variant used as a pattern
Checking if pattern has items, before returing solves ICE.
Added error code and rich location.
Also, fixes https://github.com/Rust-GCC/gccrs/issues/2430
gcc/rust/ChangeLog:
* ast/rust-pattern.h: No need of assertion, we are handling it.
* resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit):
Added check which emits error instead of using assertion.
* typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit):
Added rich location and error code.
gcc/testsuite/ChangeLog:
* rust/compile/match5.rs:
Updated comment for dejagnu.
* rust/compile/pattern-struct.rs: New test for ICE.
Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
Diffstat (limited to 'gcc/rust/backend')
0 files changed, 0 insertions, 0 deletions