From 246b6316c0e1320cba90bae676675686890168a8 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Thu, 22 Feb 2024 16:26:40 +0100 Subject: format-args: Start storing string in Rust memory gcc/rust/ChangeLog: * ast/rust-fmt.cc (ffi::RustHamster::to_string): New. (Pieces::collect): Adapt to use new handle API. (Pieces::~Pieces): Likewise. (Pieces::Pieces): Likewise. (Pieces::operator=): Likewise. * ast/rust-fmt.h (struct RustString): Add members. (struct FormatArgsHandle): New. (clone_pieces): Adapt for new FFI API. (destroy_pieces): Likewise. (struct Pieces): Store new FormatArgsHandle type. * expand/rust-expand-format-args.cc (expand_format_args): Use proper namespace. * resolve/rust-ast-resolve-base.cc (ResolverBase::visit): FormatArgs nodes are already resolved, so do nothing. libgrust/ChangeLog: * libformat_parser/src/lib.rs: Use new Handle struct and expose it. --- gcc/rust/expand/rust-expand-format-args.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/rust/expand') diff --git a/gcc/rust/expand/rust-expand-format-args.cc b/gcc/rust/expand/rust-expand-format-args.cc index 52249cb..276ffd5 100644 --- a/gcc/rust/expand/rust-expand-format-args.cc +++ b/gcc/rust/expand/rust-expand-format-args.cc @@ -28,10 +28,10 @@ expand_format_args (AST::FormatArgs &fmt) { switch (node.tag) { - case Fmt::Piece::Tag::String: + case Fmt::ffi::Piece::Tag::String: // rust_debug ("[ARTHUR]: %s", node.string._0.c_str ()); - case Fmt::Piece::Tag::NextArgument: + case Fmt::ffi::Piece::Tag::NextArgument: rust_debug ("[ARTHUR]: NextArgument"); break; } -- cgit v1.1