From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id 34B14385222B; Fri, 18 Nov 2022 23:34:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 34B14385222B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668814460; bh=JZL2BeXSX1wghbXKuIANQRbtYcNGoSwddJ97e8+hNsY=; h=From:To:Subject:Date:From; b=S70bb9nbHFa0/Zh//p8+awNHGCKf4XZfX35Os3jB6+X8e1jl4OjUnlWmRmWAPWQzn nj6zRv0zA5mPlv8r4ZxOKgCHikAJjPjC1XS/TDqIUI4y4+oq1zMCCNgPZmb2zt2vQB PTJe/4FUtd6V1V4+yQSi5XL9YQox3SpUD9cVg9yg= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Thomas Schwinge To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/rust/master] ast: Dump type param type X-Act-Checkin: gcc X-Git-Author: Jakub Dupak X-Git-Refname: refs/heads/devel/rust/master X-Git-Oldrev: 5c943bf43888f9dd1a5934f678de8b8435f1199a X-Git-Newrev: a3dfe962eb96380d0382dfb5fa243e36591ff6fc Message-Id: <20221118233420.34B14385222B@sourceware.org> Date: Fri, 18 Nov 2022 23:34:20 +0000 (GMT) List-Id: https://gcc.gnu.org/g:a3dfe962eb96380d0382dfb5fa243e36591ff6fc commit a3dfe962eb96380d0382dfb5fa243e36591ff6fc Author: Jakub Dupak Date: Tue Nov 15 18:39:41 2022 +0100 ast: Dump type param type Signed-off-by: Jakub Dupak Diff: --- 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