From patchwork Tue Feb 21 12:02:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 60057 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1845226wrn; Tue, 21 Feb 2023 04:56:31 -0800 (PST) X-Google-Smtp-Source: AK7set9QG/vzFogkjoSSl2MbEPD/WLdF6YUV72KuQsDDSNyawPc/08MEkYhCVIi3X99f7I89d7Al X-Received: by 2002:a05:6402:1012:b0:4ac:c12b:8ef1 with SMTP id c18-20020a056402101200b004acc12b8ef1mr5408175edu.17.1676984191381; Tue, 21 Feb 2023 04:56:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676984191; cv=none; d=google.com; s=arc-20160816; b=UU8m7HSTTqFom5/cI+nBiKdDDkaix7BRPYGYtP16io4yH8YJaj/92AtrjbEIst1bXl tB6COmgdO9Jceoqaf0EoNjQITSrCwc1MVHMlx9VvfotS4/UsiofevBxvKWknx6a+aun0 Lmq1+4ZGGNYh0XrBgUlcaSfaRheMfAvH3LesvFOwynSgB8Q1VTafGRct4bAlhfcwS0Yo v+aUjpEdztz/JB3EWBfsLj3Nze7gu7XFttVjEx3vqNJwQA89TM3TmVW5h9PvhbFiiN4k MYDlMGX9WtVvtoeNgSTUFEqN7UnrKwksbp39K/tJvxPp0mob3F63ILJKXcuZrsdjrwb7 M47Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dmarc-filter :delivered-to; bh=3rXwqVcU6PweinMQaeTHlbgL76U7nK1bDRHb738wDlU=; b=CxOD7NSORlNCzCqqQzfpoiKhIeBim8rJ+hqLDRRZMoa5Hzd5CU4RJZI1sMZDYbVvU5 /ZCCL3ff8hz1fxkwsCAAMhn9OU6gmSeSvU1YUyOLIhjRxlpYRbIXNnsEwyF79gErhJPw acmojrC54yRt++vDi+2nH/9cLSptZJG+vfCFn0fwRUJc+I2FGQq+QeBZhSMnodPH4emP 2AhrLWd7mr9bnV3T6pxNNxj5Med6ck+0XRk2u/nzO2QlxRuyn4yg/Wl47VgcjOLkwzBk PJNVYE0aDW5mRffWuVzCejKlGxRxlk05O22TvLUmN8DxZDnaYc5rrVtxjJJjqRzOT5ah JMpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=DbQ795Uv; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id v14-20020aa7cd4e000000b004ab498f69c4si9452578edw.242.2023.02.21.04.56.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 04:56:31 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=DbQ795Uv; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BF6A3383FDDA for ; Tue, 21 Feb 2023 12:19:36 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by sourceware.org (Postfix) with ESMTPS id E62C9382CD6A for ; Tue, 21 Feb 2023 12:04:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E62C9382CD6A 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-wm1-x32d.google.com with SMTP id m14-20020a7bce0e000000b003e00c739ce4so2889696wmc.5 for ; Tue, 21 Feb 2023 04:04:33 -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=3rXwqVcU6PweinMQaeTHlbgL76U7nK1bDRHb738wDlU=; b=DbQ795UvI/gfLjUAUB36HXtc5zCvYFUCQX5GS6UhmiVbeu5rcFIC7izZC0+RvJlJh5 Mts8f72iCYLrClRj7kKzVcAVypRUg7Qb/u2Wy/O/MCNi9KhUBRI2swnJ34qX17nZANgO YiyAnqGVXIYJED9HFInmrbj/2komgtqZeM4LKiUqsdeT04cF/SRDR/lImFmXR09lSKBX kTrfNT2x3fBEii9yzfB4FkRw2Yj1ajhdOIax3pdvCpsm3XWTdqm3liSLZlpCH1m+YGuY n/Va8e7GoneAtFO+eNbhav/yBcsbP6TMihkWZVJ5dJNlLVlG2w1bMqnB5nYTdo5io4F9 Qqzw== 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=3rXwqVcU6PweinMQaeTHlbgL76U7nK1bDRHb738wDlU=; b=QfnOfVgpyCOGB2ZDMwTfpvL/hk1kpS+TP8vSmSlR8CDe/k5L8a0g31pbq+aZUGOsaS rv8Vx00Wrfq72q4hPv9ziDeUSAL9lDkmbABueqTxy7da1I+cR73R1WJIqD0uUtiCoVwM bRtDEktwSfXpVEAtE8I5zutNHIE54SFeM/CJU4bxgITCB8mO2dHdEF9GoUNZ8fSO7ghH kTYkBZ3/PFQ5UeaJ5QSbKQqVQTKYfDAdKSMKZDYwPW4Kbr2oFZpamcPxS8iXCR+mvpUZ nRQvJ2Ay0nyRd1mcQ4j87Fwb7hJI4d08UjjhQ8w3wEeqrcTKWheffY5//1+J05gxZtyl l/dQ== X-Gm-Message-State: AO0yUKXrZQnbF2h6L2c8NpJUmJ/uJa6Ua49meafM9JzU+CQh6+FVGhG7 wNT8fL5LVB7VL7be8GuwIri9+LroDgJNR7uG3Q== X-Received: by 2002:a05:600c:2e93:b0:3e1:f8af:8ef1 with SMTP id p19-20020a05600c2e9300b003e1f8af8ef1mr2762643wmn.22.1676981072505; Tue, 21 Feb 2023 04:04:32 -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.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 04:04:32 -0800 (PST) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Jakub Dupak Subject: [committed 086/103] gccrs: ast: Dump type param type Date: Tue, 21 Feb 2023 13:02:16 +0100 Message-Id: <20230221120230.596966-87-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> MIME-Version: 1.0 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: arthur.cohen@embecosm.com Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758445375136935371?= X-GMAIL-MSGID: =?utf-8?q?1758445375136935371?= From: Jakub Dupak gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor. Signed-off-by: Jakub Dupak --- gcc/rust/ast/rust-ast-dump.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc index 7d62571b778..216f0a43dc3 100644 --- a/gcc/rust/ast/rust-ast-dump.cc +++ b/gcc/rust/ast/rust-ast-dump.cc @@ -892,7 +892,19 @@ Dump::visit (AsyncBlockExpr &) void Dump::visit (TypeParam ¶m) { + // Syntax: + // IDENTIFIER( : TypeParamBounds? )? ( = Type )? + // TypeParamBounds : + // TypeParamBound ( + TypeParamBound )* +? + + // FIXME this outputs things like "Ambiguous: String" - this comes from + // Token::str stream << param.get_type_representation (); + if (param.has_type_param_bounds ()) + { + stream << ": "; + visit_items_joined_by_separator (param.get_type_param_bounds (), " + "); + } if (param.has_type ()) { stream << " = "; @@ -1663,7 +1675,7 @@ Dump::visit (TraitObjectTypeOneBound &type) if (type.is_dyn ()) stream << "dyn "; - visit(type.get_trait_bound()); + visit (type.get_trait_bound ()); } void