Skip to content

Conversation

powerboat9
Copy link
Collaborator

@powerboat9 powerboat9 commented Aug 9, 2025

This should prevent issues like #3444 from affecting compilation of libcore 1.49

(when applied after #4052 at least, so that should be merged first to make the commit messages correct)

@powerboat9 powerboat9 marked this pull request as draft August 10, 2025 02:13
@powerboat9 powerboat9 changed the title Properly expand macro in ErrorPropagationExpr Improve macro expansion for libcore Aug 10, 2025
@powerboat9 powerboat9 marked this pull request as ready for review August 10, 2025 14:40
This should prevent issues like
Rust-GCC#3444 from affecting compilation
of libcore 1.49.

gcc/rust/ChangeLog:

	* ast/rust-expr.h (BorrowExpr::get_borrowed_expr_ptr): New
	member function.
	(ErrorPropagationExpr::get_propagating_expr_ptr): Likewise.
	(MethodCallExpr::get_receiver_expr_ptr): Likewise.
	(MatchExpr::get_scrutinee_expr_ptr): Likewise.
	* expand/rust-expand-visitor.cc (ExpandVisitor::visit): Improve
	handling of expression child nodes.
	* expand/rust-expand-visitor.h (ExpandVisitor::visit): Add
	overloads.

Signed-off-by: Owen Avery <[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.

LGTM, do we need to add testcases for this?

@powerboat9 powerboat9 marked this pull request as draft August 12, 2025 01:10
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