Skip to content

gccrs: fix ICE by skipping invalid (non-FNDEF) candidates - #4078

Merged
philberty merged 1 commit into
Rust-GCC:masterfrom
Lishin1215:3958
Aug 17, 2025
Merged

gccrs: fix ICE by skipping invalid (non-FNDEF) candidates#4078
philberty merged 1 commit into
Rust-GCC:masterfrom
Lishin1215:3958

Conversation

@Lishin1215

Copy link
Copy Markdown
Contributor

Fixes #3958
gcc/rust/ChangeLog:

* typecheck/rust-hir-dot-operator.cc (MethodResolver::Select): 
(MethodResolver::try_select_predicate_candidates): 
Skip invalid candidates and skip asserts with early-continue.

gcc/testsuite/ChangeLog:

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

@powerboat9
powerboat9 requested a review from philberty August 13, 2025 18:50
gcc/rust/ChangeLog:

	* typecheck/rust-hir-dot-operator.cc (MethodResolver::Select):
	Skip asserts by checking candidate type and using early-continue.
	(MethodResolver::try_select_predicate_candidates):
	Skip invalid candidates.

gcc/testsuite/ChangeLog:

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

Signed-off-by: lishin <lishin1008@gmail.com>

@philberty philberty left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@philberty
philberty added this pull request to the merge queue Aug 17, 2025
Merged via the queue into Rust-GCC:master with commit c8fcb33 Aug 17, 2025
13 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in libcore 1.49 Aug 17, 2025
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.

ICE in operator(), at rust/typecheck/rust-hir-dot-operator.cc:285

2 participants