Skip to content

gccrs: fix ICE in convert_tree for tuple destructuring with ref #4059

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

gcc/rust/ChangeLog:

* backend/rust-compile-pattern.cc (CompilePatternLet::visit): Handle tuple destructuring containing by-ref.

gcc/testsuite/ChangeLog:

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

gcc/rust/ChangeLog:

	* backend/rust-compile-pattern.cc (CompilePatternLet::visit):
	Handle tuple destructuring containing by-ref.

gcc/testsuite/ChangeLog:

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

Signed-off-by: lishin <[email protected]>
@powerboat9
Copy link
Collaborator

Really, all matching should operate on a place/lvalue/etc

https://doc.rust-lang.org/reference/expressions/match-expr.html
https://doc.rust-lang.org/reference/patterns.html#binding-modes

our current handling of binding modes leaves much to be desired.

@CohenArthur CohenArthur requested a review from philberty August 11, 2025 08:48
@Lishin1215
Copy link
Contributor Author

@powerboat9 I see. Thanks for pointing that out!
I’ll take a closer look to understand how the binding modes work better.
For now, I’m happy to follow up or adjust this PR if there’s a better way to address it in the larger context.

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 convert_tree, at rust/rust-gcc.cc:1922 tupel destruct w ref
2 participants