Skip to content

Eagerly expand format_args macro #4089

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

powerboat9
Copy link
Collaborator

This is a simpler version of #4064. I think I'll probably revisit this latter, to try to improve eager expansion -- it seems like we do a lot of unnecessary tokens -> AST -> tokens -> AST conversions.

This allows format_args!(some_macro!(...), ...) to compile.

gcc/rust/ChangeLog:

	* expand/rust-macro-builtins-format-args.cc
	(format_args_parse_arguments): Split format expression parsing
	into...
	(format_args_parse_expr): ...a new function here, while handling
	eager expansion.
	(MacroBuiltin::format_args_handler): Use format_args_parse_expr.

gcc/testsuite/ChangeLog:

	* rust/compile/format_args_concat.rs: New test.

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

1 participant