From patchwork Wed Apr 5 14:02:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 79622 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp335660vqo; Wed, 5 Apr 2023 07:09:25 -0700 (PDT) X-Google-Smtp-Source: AKy350Y9+MnFeRnZoykVs4bevtsU5flFN+GPGRuqrL2wNaTC5WTsad99jJaOt8ps7ujHqJK9V3nP X-Received: by 2002:a17:906:a04c:b0:931:75f5:36db with SMTP id bg12-20020a170906a04c00b0093175f536dbmr2846022ejb.11.1680703764962; Wed, 05 Apr 2023 07:09:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680703764; cv=none; d=google.com; s=arc-20160816; b=RT8aZflyluZNk9n6tSLu6yGJV58wq/1pwFTmg+R5cdNV1tui6tHLdTXJqBX9VcvCOz QXE8id+r967Ow1fm4Yt+Rw0j4Dry82MI3A7sgFPJEq6UxOr7/luatcrTOyAX30O2MIiB mI5wnsOSAsnt9Pj87TnpBE7RIFX3g126te1EosmHrdxXjBfXHJRb9xy9aPowT+aiMucN 0VZpWxzAdIQGqBrn0seIOBkfFnkSMu2O0DOTdeNVEfmG92K13DT5Z/3+BH4fMT5c+Ecq XnXbFVY7oQzDHManMUGN1tUN6svVLjxOZYdh+EiIg2EFGvB5zevWGvBC2+M0F/gLdpOV 58PQ== 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=7tTXTtx8/xnSVb54wRORL/77orvdZsHkhaZekhyjbrk=; b=zRYCoOgG16S8VR+W4B9UwAjsc9htrAdZE3nziHqmvb52xU41DhlJamw2jbky1JjHZB CtDvfBX5K87+YBzc4hPNLSxrItbulUcb5/JBeAYDZmd4X5ckCgmHkyTBEys33VoNK4NN ZIzEUTERx5SkHVJPMn8r85jAgs36gAac9nzWqUz9dkf8sfRemQ5asxG3jeDp2PzO1Syy AT2UKAc2hoimooseuWRvNUpbj+IfI9EJzRT8BL85MmGARADzc7SBCsV8NXxNaAnIezS6 MVZgT8nTSjoYKgvCFb6ydx2b/ciLBKdjorS0ZuB/UHAbON7YtkDxSQhUzgKXRDypBE8f QSrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=TmIxw8+O; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id m21-20020a170906581500b00931d3414a47si4617485ejq.200.2023.04.05.07.09.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 07:09:24 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=TmIxw8+O; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 211AB388C03D for ; Wed, 5 Apr 2023 14:06:47 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by sourceware.org (Postfix) with ESMTPS id D0F123858C31 for ; Wed, 5 Apr 2023 14:05:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D0F123858C31 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-x32e.google.com with SMTP id he13so1340028wmb.2 for ; Wed, 05 Apr 2023 07:05:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1680703532; 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=7tTXTtx8/xnSVb54wRORL/77orvdZsHkhaZekhyjbrk=; b=TmIxw8+O+RtpeeZYInuh2NmgtrhZ+FUEvtWjUoCeDdsF2ft+1H8K2g7MiX/H0cQV6u e4YIGwuZ3p+f6rW8VWuyY+UChFk1B2HJNRwOiticOW9FXSUvnqCMwmxD+ZS3jqWj/NGZ Ksd7KfQlz9LbUprXLFZyPlqVMKKZnbTplZ+/GAmOAwzSj7iGe18FSgfqEPiSz2PsGVkk CsjoJT4v4HFy7I3fJXezz4H4E1tFmdO0NOqwyT8cMV3T096xPUwtBx+G6t8DeAsP8rK9 RbkWOmRl6H+HHPQwtgPuqnYLQ26PkX0k+UgSWc3AUweWIhBJKNr7b7S+Sh0XJvvsx4CD k+Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680703532; 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=7tTXTtx8/xnSVb54wRORL/77orvdZsHkhaZekhyjbrk=; b=LM6KnCReT3WueWFphcyKLEu1yL+0kyYbdvZLXYfVx7Ha43mqJEgOGj6BnhyQw/jM2r nmWZF/zr02TdfHjftBMugu0UipEf//be0rE8PMROXvk62QoxCeSnlWf2mhqDBpMpqIhV JqSDT3O0tjklVYhVs+8s1JtQ/9XgBqQcLnwe+YX0GOiRWmkQF5uJTAOw+ZrZgT6efx4Z VLVX4OvuxmbSFGLcBpsnAFYkO0kwuogfaqHAWfjNGb9pqrIEuhCHcwTuPNoWNp9nPORu 2DtJI2AmdE7hYBF682xouW+1lGSPcLSiI2sfbRQsjWmPm6EJKhS4uLj5bxfFVkJXWnsq 9wOQ== X-Gm-Message-State: AAQBX9fu0sgMDeZKY9IXCb2wYySY5BEyIKl74Tor4hOvkKoC+IciwTGo ngZL8clow4BLlwGJu8bejhEtzic5FnwVxV7Pdw== X-Received: by 2002:a05:600c:218d:b0:3ee:36f:3485 with SMTP id e13-20020a05600c218d00b003ee036f3485mr5109703wme.8.1680703532380; Wed, 05 Apr 2023 07:05:32 -0700 (PDT) Received: from platypus.localdomain ([62.23.166.218]) by smtp.gmail.com with ESMTPSA id ay8-20020a05600c1e0800b003edddae1068sm2330150wmb.9.2023.04.05.07.05.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 07:05:32 -0700 (PDT) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Philip Herron Subject: [committed 06/88] gccrs: Add name resolution to generic argument associated item bindings Date: Wed, 5 Apr 2023 16:02:50 +0200 Message-Id: <20230405140411.3016563-7-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230405140411.3016563-1-arthur.cohen@embecosm.com> References: <20230405140411.3016563-1-arthur.cohen@embecosm.com> MIME-Version: 1.0 X-Spam-Status: No, score=-14.3 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=unavailable 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?1762345630920570134?= X-GMAIL-MSGID: =?utf-8?q?1762345630920570134?= From: Philip Herron When specifying generic arguments to Traits we can also specify the associated types using `` syntax we need to add name resolution to the type argument here and rely on the type resolution pass to ensure the associated type exists and to setup the associated types accordingly. Addresses #1720 gcc/rust/ChangeLog: * resolve/rust-ast-resolve-type.cc (ResolveGenericArgs::go): Add name resolution to Trait items. Signed-off-by: Philip Herron --- gcc/rust/resolve/rust-ast-resolve-type.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gcc/rust/resolve/rust-ast-resolve-type.cc b/gcc/rust/resolve/rust-ast-resolve-type.cc index 16d05f3792b..28ab0697431 100644 --- a/gcc/rust/resolve/rust-ast-resolve-type.cc +++ b/gcc/rust/resolve/rust-ast-resolve-type.cc @@ -589,6 +589,11 @@ ResolveGenericArgs::go (AST::GenericArgs &generic_args, resolver.resolve_disambiguated_generic (arg); } + + for (auto &binding : generic_args.get_binding_args ()) + { + ResolveType::go (binding.get_type ().get ()); + } } } // namespace Resolver