Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Lishin1215
Copy link
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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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