Skip to content

Conversation

@Pasta-coder
Copy link
Contributor

This patch introduces a local helper to clone
PathInExpression objects. This allows removing duplicate calls to , fulfilling the TODOs in EnumMatchBuilder.
This ensures the self and other paths are identical without reconstructing them from strings twice.

gcc/rust/ChangeLog:

* expand/rust-derive-cmp-common.cc (reconstruct_path): New helper.
(EnumMatchBuilder::tuple): Use reconstruct_path.
(EnumMatchBuilder::strukt): Use reconstruct_path.

This patch introduces a local helper  to clone
PathInExpression objects. This allows removing duplicate calls to
, fulfilling the TODOs in EnumMatchBuilder.
This ensures the self and other paths are identical without reconstructing
them from strings twice.

gcc/rust/ChangeLog:

	* expand/rust-derive-cmp-common.cc (reconstruct_path): New helper.
	(EnumMatchBuilder::tuple): Use reconstruct_path.
	(EnumMatchBuilder::strukt): Use reconstruct_path.

Signed-off-by: Jayant Chauhan <[email protected]>
Copy link
Member

@CohenArthur CohenArthur left a comment

Choose a reason for hiding this comment

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

So I'm not necessarily against these changes, but the goal with this comment here was to do something like #3799 but for other base classes. I think we can merge this but I'd rather see the entire thing being implemented

@Pasta-coder
Copy link
Contributor Author

thank you for the review .

will modify accordingly .

@Pasta-coder Pasta-coder marked this pull request as draft January 18, 2026 05:21
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.

2 participants