From patchwork Tue Feb 21 12:02:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 60041 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1841401wrn; Tue, 21 Feb 2023 04:47:43 -0800 (PST) X-Google-Smtp-Source: AK7set8jyFn0QojUmryYKJCoRir8ztdiOap8o5vCI07hF1KFxsKSzLoHedJRVRCZDorwIIql9fZs X-Received: by 2002:aa7:d957:0:b0:4ad:316:b4d9 with SMTP id l23-20020aa7d957000000b004ad0316b4d9mr4828603eds.15.1676983663479; Tue, 21 Feb 2023 04:47:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676983663; cv=none; d=google.com; s=arc-20160816; b=VtwKYNELhOmCV5LIuaA8f9u2hfmYLs3siFwptwBcjnri2WP+Ul3kgCdWYjM0FlfmjA ppyVnyJAFSEJz8xqeSsFPIh7S+fxAcBRBrw5t+Omdcb4FKxlf6FcKp7Cwj8WGmMhRQiB NnRHwKQ3u/yi+NLZkNY8dSmS1aSxmrScFAXYYcSJTyA16tEYA5auas2n+0zpoPR2uyI4 4psuZzMkY4zaTRlsxfBOpFDzC4cmmbFVbpLOQVy6pphR3d5RMsn8MqYvmJu6cC8qLGB9 +c975hddi/nMqt1qhxK/966n3JFLNv39Wzx15AwUVpBK2y3O27pbgKPULhS4PiSJ38Ip DSkw== 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=h/qxXb9N6bCVFSsK37WzwVzLis52VTRBgIBGk8Rh1AI=; b=SaK0XqPbQVgj0VetORDcMftj0vrNGu5w4i6b1vnOnT5nGGLenndVA6fXvQUhQApITG txueAFW/W1evAN/8D6nFPrV+ZKJXx5nwi/yN2ineYLFxzX5QmRPLp707W233qeZmpMPu dZ7iI4nP45Q8h9L2PPNZIZGn4QeLsgEI9C5mp2fnw0ekFlpJus/y925tBPWsO6Z6g855 aMdbmFAoRclS5TTFLgu1UqSBMMasRE27SKHgBq1qPDxFOR5RxObEsBAnE0+jMCTgPxE2 BkFzslb2h5saC0CUYha8lfr9X6j/CSsR/8nj0WUwahlRSio2I/o4jNoh8WOpnMALppuJ yKtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b="R2pp5/BR"; 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 o25-20020a056402039900b004acb480f45dsi3598515edv.263.2023.02.21.04.47.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 04:47:43 -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="R2pp5/BR"; 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 AE6C2392EA9F for ; Tue, 21 Feb 2023 12:15:47 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id 26AFA382E6A2 for ; Tue, 21 Feb 2023 12:04:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 26AFA382E6A2 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-x433.google.com with SMTP id p8so4292458wrt.12 for ; Tue, 21 Feb 2023 04:04:31 -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=h/qxXb9N6bCVFSsK37WzwVzLis52VTRBgIBGk8Rh1AI=; b=R2pp5/BR5fKno7bEWSPPVxh9r2CJUU7GGR/YvZOWvQwHdj6s1IfRastGwBWUwf9AjH cr+MCqZ689hrKNbgA3yXzVT4lJX7ctZoQdUt4Dl//x7k86STbDfV3j5m8GoMk1YxQHfQ y+YNRLRf1Wlt+f7JtiVPq2orAVTbejDcf5eVmMm4rc1h0ZKPEOJXxJj0TyG6yGMYDuac J0mR4gunDa1iEkCjKAxRYwFsD3Ron8VXjG8PGNBcBxzXjChYQl57BUd4JR57LRJJ/5oP MnmXdECy5MPXnYqQewG7o7LZrfCXhI1UiyEhqCgHchvT/AJ1hfS54S/KGOYwyK+e+r4u 5bbw== 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=h/qxXb9N6bCVFSsK37WzwVzLis52VTRBgIBGk8Rh1AI=; b=EfZh7AzaUcgW45Mboqj/bUGI0qx4hM66j1XubeLKGwohaA/VkvVey3+eYFyAnEjsba TeLfXkICZWlQu9iG7Ic64nShA7LF9dCg6PRpY0fDAFuwlX9MfwU4XEhgnRzq93J+l00B N49exUjozOTnfdBoe9xwRsSSQW9ApWdkjVtexXz0UVGURKKfQEHVS0nfAxiy43ABk/32 qna6cHL4e6KP5cH6ITOFLX+kkS7BgHUcf+sbMncKrKeGI8LImZcroacp5fQsFU0Na+cm tYVzxFPmZyZSvxwXpjVcJC05Qrrm8yGhgYIblYpoHVwZSsJkKYf4FV6jPgne2t8BOI/3 D7jQ== X-Gm-Message-State: AO0yUKUYOny8AGAhrvoXY+RAiqa56pi0eocO3Ar+5bDC9poJCapXtlQX g73fTin/j/rre+9VrMrH5r/QzyJukmL7BjaLAA== X-Received: by 2002:adf:de04:0:b0:2c5:56f7:51f0 with SMTP id b4-20020adfde04000000b002c556f751f0mr2459058wrm.49.1676981070463; Tue, 21 Feb 2023 04:04:30 -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.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 04:04:30 -0800 (PST) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Jakub Dupak Subject: [committed 083/103] gccrs: ast: Dump trait object type Date: Tue, 21 Feb 2023 13:02:13 +0100 Message-Id: <20230221120230.596966-84-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.7 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?1758444822030500640?= X-GMAIL-MSGID: =?utf-8?q?1758444822030500640?= 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 | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc index 1d593d4b749..0ae57fdb744 100644 --- a/gcc/rust/ast/rust-ast-dump.cc +++ b/gcc/rust/ast/rust-ast-dump.cc @@ -1618,12 +1618,21 @@ Dump::visit (ImplTraitType &type) // TypeParamBound ( + TypeParamBound )* +? stream << "impl "; - visit_items_joined_by_separator(type.get_type_param_bounds (), " + "); + visit_items_joined_by_separator (type.get_type_param_bounds (), " + "); } void -Dump::visit (TraitObjectType &) -{} +Dump::visit (TraitObjectType &type) +{ + // Syntax: + // dyn? TypeParamBounds + // TypeParamBounds : + // TypeParamBound ( + TypeParamBound )* +? + + if (type.is_dyn ()) + stream << "dyn "; + visit_items_joined_by_separator (type.get_type_param_bounds (), " + "); +} void Dump::visit (ParenthesisedType &) @@ -1636,7 +1645,7 @@ Dump::visit (ImplTraitTypeOneBound &type) // impl TraitBound stream << "impl "; - visit (type.get_trait_bound()); + visit (type.get_trait_bound ()); } void