]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Fix ICE for invalid const capacity expression handling
authorPhilip Herron <herron.philip@googlemail.com>
Wed, 17 Sep 2025 13:24:38 +0000 (14:24 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 30 Oct 2025 20:30:51 +0000 (21:30 +0100)
commit68a0e459c05aa080d8b97f5887d8f321d9749f7b
tree7b6c1c31ce3a41863a17a4be435665e03b309372
parentb65abf4b390cab58ded2fa980b0e63ba1625759f
gccrs: Fix ICE for invalid const capacity expression handling

When we have an invalid capacity expression we can't try to then also
const fold it as GCC will assert on invalid conversions.

Fixes Rust-GCC#4168

gcc/rust/ChangeLog:

* typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): check for invalid capacity

gcc/testsuite/ChangeLog:

* rust/compile/issue-4168.rs: New test.

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/typecheck/rust-hir-type-check-type.cc
gcc/testsuite/rust/compile/issue-4168.rs [new file with mode: 0644]