From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id 099D93948A6F; Thu, 6 Oct 2022 20:06:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 099D93948A6F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665086794; bh=yrG27bfk5zMfajuxZgG9YwifG7p0qKanRpwZfhfldmA=; h=From:To:Subject:Date:From; b=cWMYo/7/4Cd8u/SlMdpciCV8UZVOWVW1P6TdmHkl5axbMesRdKv963vdWDWT7DB4o 9cR1aRTJbA83PfmN9Bm7JnjFZCGkufnAf6SJqRBrCR5+bE7UxhDD4BiJc+LrtcNNSi Hn4V3Jt9OPgpNrrNOOd6gw1oRcVVJKY84yNzhvmU= 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] Merge #1562 X-Act-Checkin: gcc X-Git-Author: bors[bot] <26634292+bors[bot]@users.noreply.github.com> X-Git-Refname: refs/heads/devel/rust/master X-Git-Oldrev: adaf4561d63f08714f8c289bef0f4c5649fb6829 X-Git-Newrev: b4096017e3b9ca499b56988b67e05667a02ca202 Message-Id: <20221006200634.099D93948A6F@sourceware.org> Date: Thu, 6 Oct 2022 20:06:34 +0000 (GMT) List-Id: https://gcc.gnu.org/g:b4096017e3b9ca499b56988b67e05667a02ca202 commit b4096017e3b9ca499b56988b67e05667a02ca202 Merge: adaf4561d63 a7d2643d9b0 Author: bors[bot] <26634292+bors[bot]@users.noreply.github.com> Date: Thu Oct 6 13:07:50 2022 +0000 Merge #1562 1562: Support looking up super trait items during path resolution r=philberty a=philberty When we lookup names in paths such as Foo::bar, foo is a type we resolve and then we lookup 'bar' based on what type Foo is which includes probing relevant bounds of this type. We currently return a vector of possible candidates and this patch changes it so that we return a vector of unique items based on DefId. Ideally we should use move to a std::set for this. The final patch actually updates the trait reference lookup functions to revert to looking up relevant super traits when required. Fixes #1555 Co-authored-by: Philip Herron Diff: gcc/rust/backend/rust-compile-expr.cc | 4 +- gcc/rust/backend/rust-compile-resolve-path.cc | 8 +- gcc/rust/typecheck/rust-hir-path-probe.h | 108 ++++++++++----------- gcc/rust/typecheck/rust-hir-trait-ref.h | 19 ++++ gcc/rust/typecheck/rust-hir-type-check-enumitem.cc | 4 + gcc/rust/typecheck/rust-hir-type-check-item.cc | 9 +- gcc/rust/typecheck/rust-hir-type-check-path.cc | 2 +- gcc/rust/typecheck/rust-hir-type-check-type.cc | 2 +- gcc/rust/typecheck/rust-tyty.h | 22 +++-- gcc/testsuite/rust/compile/torture/issue-1555.rs | 48 +++++++++ 10 files changed, 147 insertions(+), 79 deletions(-)