Message ID | 20230405140411.3016563-37-arthur.cohen@embecosm.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp349402vqo; Wed, 5 Apr 2023 07:27:44 -0700 (PDT) X-Google-Smtp-Source: AKy350YTM66A52CuF2YXG6DGLijTaihd17eYT9B89ene2aLpTHK+2qpVxjLroppvw6BgY4v53U6I X-Received: by 2002:a17:906:495:b0:930:d17b:959b with SMTP id f21-20020a170906049500b00930d17b959bmr3059841eja.22.1680704864133; Wed, 05 Apr 2023 07:27:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680704864; cv=none; d=google.com; s=arc-20160816; b=UTLaT5StiudUZHsrpoHHHj8yTwNEgKouckotBYOp83DFpF1c7FdDCD85Gx96B/5wQV rqTC8Bpw/jjvCsluh88dPC/hsqfsBk3i/WG41M+juPiVmOjLKKOkEBA62z9gCHSH4yXF IUFT7nk6RDj6iFGOxBJAbiKU26Nw6EF7IktpTV8y586KHwqaJy6e1d7LRxKF87/hxZbv gsmKK1dLOT6SD8iZhvzuTdlZLRbKCcTw0mniYsbtUX7kmfOR8epM8thP5hwvvXINqZ4Y trzuDLdE+O8nQeRE7Dbebjvv8m4qsv5TlHW1ybSRDeYQMQR3a8KjmHmGLEmG6rAhDvJW clbA== 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=TMb6dOaZEARu81vby2cyTeo9PCXn8l9sBPaHTXh8D84=; b=e7mBYR2mOVycMWaS3jR/nyh5uO3kuIFSA5XJB1Mch0KnU9tMiYmWEMethLbxkFL3o1 0U0Y5og5kDQ9PsiM7NSfD83w7IzekhQcJDVWzbcysILtS/6k/pp+tHf7AtThn2SdoWsp parX3WhEPSSfQYug80XOBdUW6kEG0Ln24B8aYoPzwL5RW0e4oBz7mtmSY4NnuqcDNHyj EX5AvlwXV6Jh2dDMy/sQBdXYlLERsLhc/gyIYm+7vAJKeoBNS3h9TmWzdAkfvJsD86TX jQekJ6r7Ol2S9VeUEVtUuAPDNhdtzIx6rv+ZxQS1DrAXSnZAfNgfZD/KyYJ9qIigPxlg mHnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=M8882M9s; 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 z25-20020a170906075900b009395b8121cesi925201ejb.178.2023.04.05.07.27.43 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 07:27:44 -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=M8882M9s; 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 7578D386C2CE for <ouuuleilei@gmail.com>; Wed, 5 Apr 2023 14:11:47 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by sourceware.org (Postfix) with ESMTPS id BCEA43851C15 for <gcc-patches@gcc.gnu.org>; Wed, 5 Apr 2023 14:05:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BCEA43851C15 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-x32f.google.com with SMTP id o32so20949536wms.1 for <gcc-patches@gcc.gnu.org>; Wed, 05 Apr 2023 07:05:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1680703553; 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=TMb6dOaZEARu81vby2cyTeo9PCXn8l9sBPaHTXh8D84=; b=M8882M9sNlp42X+pIAGNh0FK6jEwoHDEfTbepEAJ6sCA0ug1ZJzelv5xYSadjjjrNE l1kJ2S/ggFhJFHMenf5zSlbmMEkUVLXq+p0WKPL6SaEN7/uz9AIqmC759/bqsJ/uC10w JJ/YPAhmEBN13VfTnum9cX9Eb9+rVHpu4MsPpMux/pAXkkaumMiKwI8ww5HFZRDht2p0 9SnXZhu9rE/1VD0zu9Y1qqzMLearMnnBDx+eKSRy8KZXWU8ksS4+jNM61PummnH8X2v3 X2x6H3J3Aeu1eq67YDL90fg8IlFADeY4VhaJ+euFpiGapWDdBrKEbODX13eyQA353R1F ebbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680703553; 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=TMb6dOaZEARu81vby2cyTeo9PCXn8l9sBPaHTXh8D84=; b=X2ceP5zLP3sJDW/oAMfKZAQdJv1AjphDgG6iEF+A3Y5CXeqHrTPhtir4T5ZtdMYaaa Znj9gRaG913GS9UhmWGlvLm1kyiH596GIthlWa4INL46whEBLvgfNFnTNRq+HRUanX5J nZwfwTb+5f4oEr80SnTFDZokEVRIQQLMuXpWXQlesVs6rSFXK/sDVcXG7zTWt/Wo74RJ bc/eArioPxH6o15IemtwDhkTD2p+dBxb7WCdwKY+PYgczl1xXKNv5QiBBtcMk2wNZx2D hsntXRai9r/P9eqsP33DW15Iy8zwnV3fsbnTBJ58GwXZVF2lNTWfpH37FGLuOPp+aeZs +tyw== X-Gm-Message-State: AAQBX9f0D8HPNpSBtKEISzIJvOB0X+adLpvilBDtb/HMrUASGB5TA+cc chxGc8FR6pTvm96Mfyp2RP/aQuIYb5vFby+38g== X-Received: by 2002:a1c:f216:0:b0:3ee:4ff0:83d6 with SMTP id s22-20020a1cf216000000b003ee4ff083d6mr4907618wmc.40.1680703553313; Wed, 05 Apr 2023 07:05:53 -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.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 07:05:53 -0700 (PDT) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Philip Herron <herron.philip@googlemail.com> Subject: [committed 36/88] gccrs: Move TypePredicateItem impl out of the header Date: Wed, 5 Apr 2023 16:03:20 +0200 Message-Id: <20230405140411.3016563-37-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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-14.6 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Reply-To: arthur.cohen@embecosm.com Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762346783401149687?= X-GMAIL-MSGID: =?utf-8?q?1762346783401149687?= |
Series |
[committed,01/88] gccrs: fatal_error_flag: Fix typo in error message
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Arthur Cohen
April 5, 2023, 2:03 p.m. UTC
From: Philip Herron <herron.philip@googlemail.com> This moves the implementation code out of the header and into its respective cc file. Signed-off-by: Philip Herron <herron.philip@googlemail.com> gcc/rust/ChangeLog: * typecheck/rust-tyty-bounds.cc (TypeBoundPredicateItem::error): refactor (TypeBoundPredicateItem::is_error): likewise (TypeBoundPredicateItem::get_parent): likewise * typecheck/rust-tyty.h: Move the implementation for the above --- gcc/rust/typecheck/rust-tyty-bounds.cc | 24 ++++++++++++++++++++++++ gcc/rust/typecheck/rust-tyty.h | 16 ++++------------ 2 files changed, 28 insertions(+), 12 deletions(-)
diff --git a/gcc/rust/typecheck/rust-tyty-bounds.cc b/gcc/rust/typecheck/rust-tyty-bounds.cc index 30f7b0d02e3..e7eb9a760f5 100644 --- a/gcc/rust/typecheck/rust-tyty-bounds.cc +++ b/gcc/rust/typecheck/rust-tyty-bounds.cc @@ -364,6 +364,30 @@ TypeBoundPredicate::lookup_associated_item (const std::string &search) const return TypeBoundPredicateItem (this, trait_item_ref); } +TypeBoundPredicateItem::TypeBoundPredicateItem ( + const TypeBoundPredicate *parent, + const Resolver::TraitItemReference *trait_item_ref) + : parent (parent), trait_item_ref (trait_item_ref) +{} + +TypeBoundPredicateItem +TypeBoundPredicateItem::error () +{ + return TypeBoundPredicateItem (nullptr, nullptr); +} + +bool +TypeBoundPredicateItem::is_error () const +{ + return parent == nullptr || trait_item_ref == nullptr; +} + +const TypeBoundPredicate * +TypeBoundPredicateItem::get_parent () const +{ + return parent; +} + TypeBoundPredicateItem TypeBoundPredicate::lookup_associated_item ( const Resolver::TraitItemReference *ref) const diff --git a/gcc/rust/typecheck/rust-tyty.h b/gcc/rust/typecheck/rust-tyty.h index 20a243fe980..7d32ed59494 100644 --- a/gcc/rust/typecheck/rust-tyty.h +++ b/gcc/rust/typecheck/rust-tyty.h @@ -82,19 +82,11 @@ class TypeBoundPredicateItem { public: TypeBoundPredicateItem (const TypeBoundPredicate *parent, - const Resolver::TraitItemReference *trait_item_ref) - : parent (parent), trait_item_ref (trait_item_ref) - {} + const Resolver::TraitItemReference *trait_item_ref); - static TypeBoundPredicateItem error () - { - return TypeBoundPredicateItem (nullptr, nullptr); - } + static TypeBoundPredicateItem error (); - bool is_error () const - { - return parent == nullptr || trait_item_ref == nullptr; - } + bool is_error () const; BaseType *get_tyty_for_receiver (const TyTy::BaseType *receiver); @@ -102,7 +94,7 @@ public: bool needs_implementation () const; - const TypeBoundPredicate *get_parent () const { return parent; } + const TypeBoundPredicate *get_parent () const; Location get_locus () const;