From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id 8F968385841F; Wed, 19 Oct 2022 19:45:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8F968385841F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666208738; bh=L5QBlZedlxfTKtzO1LkjfTjBAmrMdpZz1n43eLhji0c=; h=From:To:Subject:Date:From; b=W28t2ayTpv/zfbseLsB70o9S8aDIWNZbGasF4CFkdRrCRnBDfKv8UgoPMUUrKqidy Hn1cRYU1e65UaB42g2STk1ysUSxCVtVZDI9dDTIxNg9PZcqvQlj0bkTwBlpVhC3zVe XPz0ZPyTc96wqLlQ67Mi3lVrSK0IMDor40J8ymIY= 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 #1602 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: 381e061438836b7ca360c7741e9a13ec6d643b1d X-Git-Newrev: 9ecbc9008748672b1a47fab6d40ebe5a31507969 Message-Id: <20221019194538.8F968385841F@sourceware.org> Date: Wed, 19 Oct 2022 19:45:38 +0000 (GMT) List-Id: https://gcc.gnu.org/g:9ecbc9008748672b1a47fab6d40ebe5a31507969 commit 9ecbc9008748672b1a47fab6d40ebe5a31507969 Merge: 381e0614388 0a52177612f Author: bors[bot] <26634292+bors[bot]@users.noreply.github.com> Date: Wed Oct 19 17:04:07 2022 +0000 Merge #1602 1602: Add check for recursive trait cycles r=philberty a=philberty This adds a new RAII style TraitQueryGuard so that we can manage the query lifetime when resolving a trait. This adds in a DefId into a set when we begin to resolve and then finally removes it when completed. This allows us to add in a check at the start if this DefId is already within the set which means this is a trait cycle. Fixes #1589 Co-authored-by: Philip Herron Diff: gcc/rust/typecheck/rust-hir-trait-resolve.cc | 12 +++++++++++- gcc/rust/typecheck/rust-hir-type-check.h | 29 ++++++++++++++++++++++++++++ gcc/testsuite/rust/compile/issue-1589.rs | 5 +++++ 3 files changed, 45 insertions(+), 1 deletion(-)