Skip to content

gccrs: Fix ice with invalid borrow expression#3891

Merged
philberty merged 1 commit into
masterfrom
phil/ice-fix-ast-collector
Jul 10, 2025
Merged

gccrs: Fix ice with invalid borrow expression#3891
philberty merged 1 commit into
masterfrom
phil/ice-fix-ast-collector

Conversation

@philberty

Copy link
Copy Markdown
Member

This is an invalid test case but we just need a guard for the missing borrow expression.

Fixes #3874

gcc/rust/ChangeLog:

* ast/rust-ast-collector.cc (TokenCollector::visit): check for missing borrow
* ast/rust-expr.h: add helper

gcc/testsuite/ChangeLog:

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

This is an invalid test case but we just need a guard for the missing
borrow expression.

Fixes #3874

gcc/rust/ChangeLog:

	* ast/rust-ast-collector.cc (TokenCollector::visit): check for missing borrow
	* ast/rust-expr.h: add helper

gcc/testsuite/ChangeLog:

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

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
@philberty philberty requested a review from P-E-P July 8, 2025 21:34
@philberty philberty requested a review from CohenArthur July 8, 2025 21:34
@philberty philberty added this pull request to the merge queue Jul 10, 2025
Merged via the queue into master with commit 42466ab Jul 10, 2025
13 checks passed
@philberty philberty deleted the phil/ice-fix-ast-collector branch July 10, 2025 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ICE in get_borrowed_expr, at rust/ast/rust-expr.h:394

1 participant