Skip to content

Improve macro expansion for libcore #4053

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

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

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