diff options
author | Philip Herron <herron.philip@googlemail.com> | 2023-03-29 15:57:56 +0100 |
---|---|---|
committer | Philip Herron <herron.philip@googlemail.com> | 2023-03-30 14:43:04 +0100 |
commit | bb035c384a08ef25dceadc33b11d2fb990209cb0 (patch) | |
tree | 0895ebf57ed4628e1c267e8f4c73d7888df24044 /gcc/rust/ast | |
parent | 649833b71ae3594e697f8ef91d5d4e09375627ce (diff) | |
download | gcc-bb035c384a08ef25dceadc33b11d2fb990209cb0.zip gcc-bb035c384a08ef25dceadc33b11d2fb990209cb0.tar.gz gcc-bb035c384a08ef25dceadc33b11d2fb990209cb0.tar.bz2 |
gccrs: fix ICE with bad match arm type
We expect to get some kind of ADT or Tuple type when computing this kind of
match arms this adds a new diagnostic to check for this case instead of
an assertion.
Fixes #2029
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): return early on bad type
* typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::TypeCheckPattern):
remove assertion in favor of check
(TypeCheckPattern::visit): likewise
gcc/testsuite/ChangeLog:
* rust/compile/issue-2029.rs: New test.
Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Diffstat (limited to 'gcc/rust/ast')
0 files changed, 0 insertions, 0 deletions