]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Fix ICE on copied array expressions
authorPhilip Herron <herron.philip@googlemail.com>
Sun, 21 Sep 2025 17:56:55 +0000 (18:56 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 30 Oct 2025 20:30:52 +0000 (21:30 +0100)
commitcca063c47059a6c4475356a9eee5559262c89d21
treeef533934bdb099bfc374df5eba7f86820d2c1828
parent87d05676048a3ae0b38912652a002c8493a7e631
gccrs: Fix ICE on copied array expressions

We need to check for errors on the number of copies expression before
trying to const fold it otherwise it will just fail in the const evaluator.

Fixes Rust-GCC#4165

gcc/rust/ChangeLog:

* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): check for error

gcc/testsuite/ChangeLog:

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

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