Skip to content

Conversation

philberty
Copy link
Member

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 #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.

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 #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 <[email protected]>
@philberty philberty added this to the Typecheck issues 16.1 milestone Sep 21, 2025
@philberty philberty added this pull request to the merge queue Sep 21, 2025
Merged via the queue into master with commit 7e44c93 Sep 21, 2025
13 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in libcore 1.49 Sep 21, 2025
@philberty philberty deleted the phil/const-crash branch September 22, 2025 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

segfault in tree_truth_valued_p const array cmp

1 participant