You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes#3896. FormatArgsPieces
isn't great, but I don't see a better alternative for now.
gcc/rust/ChangeLog:
* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Visit
first argument of FormatArgs.
* ast/rust-ast.cc (FormatArgs::clone_expr_impl): Remove usage of
std::cerr for debugging.
* ast/rust-builtin-ast-nodes.h (enum class FormatArgsNewline):
New enum.
(class FormatArgsPieces): New class.
(FormatArgs::Newline): Replace with using declaration
referencing FormatArgsNewline.
(FormatArgs::FormatArgs): Accept a FormatArgsPieces instance.
(FormatArgs::get_template_arg): New member function.
(FormatArgs::get_template): Handle changes to class fields.
(FormatArgs::template_pieces): Rename to...
(FormatArgs::template_arg): ...here and change type to
FormatArgsPieces.
* expand/rust-expand-format-args.cc: Include
"rust-expand-visitor.h".
(expand_format_first_arg): New static function.
(expand_format_args): Change signature.
* expand/rust-expand-format-args.h: Include "rust-system.h" and
adjust include order.
(class ExpandVisitor): Forward declare.
(struct MacroExpander): Likewise.
(expand_format_args): Change signature.
* expand/rust-expand-visitor.cc: Include
"rust-expand-format-args.h".
(ExpandVisitor::visit): Attempt to expand FormatArgs.
* expand/rust-expand-visitor.h: Include "rust-ast-full-decls.h".
(ExpandVisitor::visit): New overload for FormatArgs.
* expand/rust-macro-builtins-format-args.cc
(FormatArgsInput::format_str): Rename to...
(FormatArgsInput::format_expr): ...here and change type to
std::unique_ptr<Expr>.
(format_args_parse_arguments): Handle change to FormatArgsInput.
(MacroBuiltin::format_args_handler): Likewise and handle changes
to FormatArgs.
gcc/testsuite/ChangeLog:
* rust/compile/format_args_concat.rs: New test.
Signed-off-by: Owen Avery <[email protected]>
0 commit comments