From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by sourceware.org (Postfix) with ESMTPS id CDC1C384693F for ; Tue, 21 Feb 2023 12:04:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CDC1C384693F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wr1-x429.google.com with SMTP id 6so3758843wrb.11 for ; Tue, 21 Feb 2023 04:04:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=JPkBa+BNYndGOynndtqfRq+B1aNIjnVFvgpJGhbl9nI=; b=Xvz0eroKyhDk+kmqYiHbPGhgCLlgbQESfIXGWE1ZTsyeYJ6Yp0P0CRgQ4BQPqdGNaR /V/TQVeYRNQFLOOKF+PUV1O5JO1N3pEmbRf9igotl7+msNI2d8GUZA41FwmFGjWtQcsy CWAwc2WWDQX/4DMaepTi5YdeXe/cohke1lPqbIRuoB5+3dLvZMmcYH3ZYtKwvxIOhSwU XB902a4P9v1VCO1S6Y434y+Vz/Z7BKv4z9WuSF6mDMphxH7xq2jn4rmSXuhbYg7/YoAW g0e88NK75xmdomdVqG8lm0x5lY4kdb5V22LTl3hvWuhUVoFwyZ8p96rgoHR2m4cKHqzO dIPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=JPkBa+BNYndGOynndtqfRq+B1aNIjnVFvgpJGhbl9nI=; b=dpMGV/rWYhw4jbgTxpoyVCdrntumXlYK1kiwLJIKzU8XkX7GsnCrWTc/BPOLdphXjD azFOiBOow/sq9DMu5hU5VgUXU+i4NUJ5nUCvAn+tLBXFTqcQKfLFtIOn7EjSUSK0n8Cb McIDQCouSqEPoYNoE9HQ92iDRDzQ/KY2ZhX9A5rL8tM8RkAIBz6Nlqs9wRnwfrMZs/ta E925O9mUPVuLUUfTh3uqWnHl31wkajpvyFyE3xsi7uL3iaRKM1nRdrook6Mku/0y7b0r NXFE13OnfKsOA0AL46vhiG0l1v+bfACl3An3tTz/c3g+iCyPXeLMKI3x2NL+epE9hQtF pYLQ== X-Gm-Message-State: AO0yUKUtK8kN/JexjZRC1647R4B6GqLmxWubFV1zBd1dBYoRHi9EdjZ6 Et22esLYewpzv/Kj0gkv4TYH2MRoy6KNzTOtNA== X-Google-Smtp-Source: AK7set+ANf3zjXe5n27x02UT7xrclQDZKLG0FD5hGpEDYurG5qB/07O6pOObCMt5Esb5FVJfkWkgYQ== X-Received: by 2002:a5d:4ccf:0:b0:2c6:5972:cd13 with SMTP id c15-20020a5d4ccf000000b002c65972cd13mr4762336wrt.26.1676981059438; Tue, 21 Feb 2023 04:04:19 -0800 (PST) Received: from platypus.localdomain ([62.23.166.218]) by smtp.gmail.com with ESMTPSA id c15-20020adffb4f000000b002c55b0e6ef1sm5013811wrs.4.2023.02.21.04.04.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 04:04:18 -0800 (PST) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Jakub Dupak Subject: [committed 068/103] gccrs: ast: Dump unit struct Date: Tue, 21 Feb 2023 13:01:58 +0100 Message-Id: <20230221120230.596966-69-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230221120230.596966-1-arthur.cohen@embecosm.com> References: <20230221120230.596966-1-arthur.cohen@embecosm.com> Reply-To: arthur.cohen@embecosm.com MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-14.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: From: Jakub Dupak gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add handling for unit structures. Signed-off-by: Jakub Dupak --- gcc/rust/ast/rust-ast-dump.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc index 191e328b134..df42481c248 100644 --- a/gcc/rust/ast/rust-ast-dump.cc +++ b/gcc/rust/ast/rust-ast-dump.cc @@ -945,7 +945,10 @@ Dump::visit (StructStruct &struct_item) // FIXME: where-clause - visit_items_as_block (struct_item.get_fields (), ","); + if (struct_item.is_unit_struct ()) + stream << ";\n"; + else + visit_items_as_block (struct_item.get_fields (), ","); } void -- 2.39.1