From patchwork Wed Apr 5 14:04:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 79735 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp369498vqo; Wed, 5 Apr 2023 07:58:39 -0700 (PDT) X-Google-Smtp-Source: AKy350bqGzYCqTGIaSR5QAe6TUYnrONV/b2GPYqYsg1P01bOrPuhug8afQCzzxO2gdpxkJXs8bK3 X-Received: by 2002:a05:6402:3da:b0:4fb:6357:f393 with SMTP id t26-20020a05640203da00b004fb6357f393mr1964646edw.1.1680706719578; Wed, 05 Apr 2023 07:58:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680706719; cv=none; d=google.com; s=arc-20160816; b=fs2HlxFn5tPqvaAX2OOUIS6Jd3VD0tFvpGRF1uicT6Z+rNJPa2UI1twu/kDZexoTHf Hfp5Hy3ZjeA8oGOOoAgRBXsap3TTuCHLat3MyGo9urazdUxxiClWwLhl4bgVcTFplmDC GrbL4JJPoHCRqBThNYOgRmBPUnvMbaxa9IdYmsSh3ZW/G1iPtDPXijSlqCc5OKWNHX8g uxht5OM5MdwHbrCsnIymPs/hLqHcnEQ3uIata/LI1712HnvUFJdN0VlHWErPCg6m3p3g Ro+/tEA7OuKwBY3mcRj6Wm1ZOW2JqxGpIK/0PhxfMTb8GvrzZndfn83i/i4+lNHsVACl EGbA== 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=kLznMUDJawxqb6N37scjNOdNKXOyNzghs6Adhm0FgLY=; b=S4GljMk49eZaJ66Spd9bNFPNKdCgYGgRSi+bXkuLK26AyLB+k5YekyQL/n687vAKyX qRAfNm+362pa7jHvWKgsjyk6IaI+qAetint+9aWAl/NdSPaNM1VHLPFNKucey+BQ3dfU 9LvrSgmvs4rHwhkKY4S8yKFiVYoM0w9Y5YxyrjYDsrSIZghqtzJDYM+GVrStyuoMhWhV zawA2eBxiDS+0fOOmlQNVNQur+H0jDsnxEwytPE6OPbRkcyTKntyKLWqTbEp31e4Fgp7 aBYReYnWW37A5WlXwBXPI90gYrUvRNaNh9u88DrGI0RBaZCe3dMBiOE0EGpg6Up1KGJ9 44+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=YL0UXBe4; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id y22-20020a50e616000000b004c007c7905asi1083516edm.484.2023.04.05.07.58.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 07:58:39 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=YL0UXBe4; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 4565F38CA3D9 for ; Wed, 5 Apr 2023 14:21:56 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by sourceware.org (Postfix) with ESMTPS id 6143B3877020 for ; Wed, 5 Apr 2023 14:06:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6143B3877020 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-x32c.google.com with SMTP id p34so20959298wms.3 for ; Wed, 05 Apr 2023 07:06:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1680703583; 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=kLznMUDJawxqb6N37scjNOdNKXOyNzghs6Adhm0FgLY=; b=YL0UXBe4rI0jOTOj7itvZ1+xA+P+XfVGpiqTXQN8uhcWU17t8lNql2pmpeIsdDbN0v VrhD438aMuBFpTVd7x5Bm/TPeEuWy5AvT1ouycGswr+KDNP42TS8hBfJz45JihGEZ/jm KiZXdd0Ipr4SN8tKDQKYnTXqQQgvUua6EbfcKgIYLLE/KWefg1eOOi/v227arJFLCX/7 Cl9EiGgALyePuIVJ8kN9dbZs0dAWStNg+pG4TBxIFR0otT92xNQRsUdUPPnNFdec657R 7EhjJ5vI/i17xK1ZZ1sliU1iAdI5iB93vMLGSUlAc6cwLCpDqfjV9DFz6IshxUh/IBle 8e0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680703583; 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=kLznMUDJawxqb6N37scjNOdNKXOyNzghs6Adhm0FgLY=; b=qPuHShkbRDURyLYcVxDlKqsSmm+HmU1aeWtiRyYzOYfSVzn1RW3K4S7AEFpXl0oTHf 42xx1qMH4nf9AFl54G5UefEVFJ/Wjj3KSXkMpm7rQyQSw8khzP4omlDRYwP8/tu5BXgn 0oZ/UHWLBnHKgCtsSeWeVdPtkzE02w/cBSiAt3AAyjIoLODqp1ac3zd4exH7ncw1+dPf DKHdNfTBz8BdPdcerRfc/If8CHZQ0AYPGJEuDtHAP44aEubVAGvBV3Dw1VVJu22v/tZ3 lkM1O3qHGzzpmzXX/Omt/shK1AIuhsESEmC5SVueWmBa5U92iREhYevPoR/2KTlq3Kie FEYg== X-Gm-Message-State: AAQBX9fi3Ytbr4dVT4j481JNtrrk9pVyBy+RHkaROOSN106kb4F+B0Ke t2gaBH0hoQqhr/Q9pD33tYSc5nZCTppy0ID3EQ== X-Received: by 2002:a7b:cb97:0:b0:3ed:5d41:f9a7 with SMTP id m23-20020a7bcb97000000b003ed5d41f9a7mr5103611wmi.2.1680703583661; Wed, 05 Apr 2023 07:06:23 -0700 (PDT) Received: from platypus.localdomain ([62.23.166.218]) by smtp.gmail.com with ESMTPSA id ay8-20020a05600c1e0800b003edddae1068sm2330150wmb.9.2023.04.05.07.06.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 07:06:23 -0700 (PDT) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Owen Avery Subject: [committed 79/88] gccrs: Fix formatting Date: Wed, 5 Apr 2023 16:04:03 +0200 Message-Id: <20230405140411.3016563-80-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.2 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?1762348729306859147?= X-GMAIL-MSGID: =?utf-8?q?1762348729306859147?= From: Owen Avery gcc/rust/ChangeLog: * ast/rust-pattern.h: Fix formatting. Signed-off-by: Owen Avery --- gcc/rust/ast/rust-pattern.h | 70 ++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 36 deletions(-) diff --git a/gcc/rust/ast/rust-pattern.h b/gcc/rust/ast/rust-pattern.h index cf5d2ead10d..0e2f56e3216 100644 --- a/gcc/rust/ast/rust-pattern.h +++ b/gcc/rust/ast/rust-pattern.h @@ -763,7 +763,7 @@ struct StructPatternElements { private: // bool has_struct_pattern_fields; - std::vector > fields; + std::vector> fields; bool has_struct_pattern_etc; std::vector struct_pattern_etc_attrs; @@ -788,7 +788,7 @@ public: // Constructor for StructPatternElements with both (potentially) StructPatternElements ( - std::vector > fields, + std::vector> fields, std::vector etc_attrs) : fields (std::move (fields)), has_struct_pattern_etc (true), struct_pattern_etc_attrs (std::move (etc_attrs)) @@ -796,7 +796,7 @@ public: // Constructor for StructPatternElements with no StructPatternEtc StructPatternElements ( - std::vector > fields) + std::vector> fields) : fields (std::move (fields)), has_struct_pattern_etc (false), struct_pattern_etc_attrs () {} @@ -832,18 +832,17 @@ public: static StructPatternElements create_empty () { return StructPatternElements ( - std::vector > ()); + std::vector> ()); } std::string as_string () const; // TODO: seems kinda dodgy. Think of better way. - std::vector > & - get_struct_pattern_fields () + std::vector> &get_struct_pattern_fields () { return fields; } - const std::vector > & + const std::vector> & get_struct_pattern_fields () const { return fields; @@ -956,10 +955,10 @@ protected: // Class for non-ranged tuple struct pattern patterns class TupleStructItemsNoRange : public TupleStructItems { - std::vector > patterns; + std::vector> patterns; public: - TupleStructItemsNoRange (std::vector > patterns) + TupleStructItemsNoRange (std::vector> patterns) : patterns (std::move (patterns)) {} @@ -991,8 +990,8 @@ public: void accept_vis (ASTVisitor &vis) override; // TODO: seems kinda dodgy. Think of better way. - std::vector > &get_patterns () { return patterns; } - const std::vector > &get_patterns () const + std::vector> &get_patterns () { return patterns; } + const std::vector> &get_patterns () const { return patterns; } @@ -1011,12 +1010,12 @@ protected: // Class for ranged tuple struct pattern patterns class TupleStructItemsRange : public TupleStructItems { - std::vector > lower_patterns; - std::vector > upper_patterns; + std::vector> lower_patterns; + std::vector> upper_patterns; public: - TupleStructItemsRange (std::vector > lower_patterns, - std::vector > upper_patterns) + TupleStructItemsRange (std::vector> lower_patterns, + std::vector> upper_patterns) : lower_patterns (std::move (lower_patterns)), upper_patterns (std::move (upper_patterns)) {} @@ -1056,21 +1055,21 @@ public: void accept_vis (ASTVisitor &vis) override; // TODO: seems kinda dodgy. Think of better way. - std::vector > &get_lower_patterns () + std::vector> &get_lower_patterns () { return lower_patterns; } - const std::vector > &get_lower_patterns () const + const std::vector> &get_lower_patterns () const { return lower_patterns; } // TODO: seems kinda dodgy. Think of better way. - std::vector > &get_upper_patterns () + std::vector> &get_upper_patterns () { return upper_patterns; } - const std::vector > &get_upper_patterns () const + const std::vector> &get_upper_patterns () const { return upper_patterns; } @@ -1233,10 +1232,10 @@ TuplePatternItemsSingle(*this); // Class representing TuplePattern patterns where there are multiple patterns class TuplePatternItemsMultiple : public TuplePatternItems { - std::vector > patterns; + std::vector> patterns; public: - TuplePatternItemsMultiple (std::vector > patterns) + TuplePatternItemsMultiple (std::vector> patterns) : patterns (std::move (patterns)) {} @@ -1268,8 +1267,8 @@ public: void accept_vis (ASTVisitor &vis) override; // TODO: seems kinda dodgy. Think of better way. - std::vector > &get_patterns () { return patterns; } - const std::vector > &get_patterns () const + std::vector> &get_patterns () { return patterns; } + const std::vector> &get_patterns () const { return patterns; } @@ -1291,13 +1290,12 @@ protected: // Class representing TuplePattern patterns where there are a range of patterns class TuplePatternItemsRanged : public TuplePatternItems { - std::vector > lower_patterns; - std::vector > upper_patterns; + std::vector> lower_patterns; + std::vector> upper_patterns; public: - TuplePatternItemsRanged ( - std::vector > lower_patterns, - std::vector > upper_patterns) + TuplePatternItemsRanged (std::vector> lower_patterns, + std::vector> upper_patterns) : lower_patterns (std::move (lower_patterns)), upper_patterns (std::move (upper_patterns)) {} @@ -1338,21 +1336,21 @@ public: void accept_vis (ASTVisitor &vis) override; // TODO: seems kinda dodgy. Think of better way. - std::vector > &get_lower_patterns () + std::vector> &get_lower_patterns () { return lower_patterns; } - const std::vector > &get_lower_patterns () const + const std::vector> &get_lower_patterns () const { return lower_patterns; } // TODO: seems kinda dodgy. Think of better way. - std::vector > &get_upper_patterns () + std::vector> &get_upper_patterns () { return upper_patterns; } - const std::vector > &get_upper_patterns () const + const std::vector> &get_upper_patterns () const { return upper_patterns; } @@ -1503,14 +1501,14 @@ protected: // AST node representing patterns that can match slices and arrays class SlicePattern : public Pattern { - std::vector > items; + std::vector> items; Location locus; NodeId node_id; public: std::string as_string () const override; - SlicePattern (std::vector > items, Location locus) + SlicePattern (std::vector> items, Location locus) : items (std::move (items)), locus (locus), node_id (Analysis::Mappings::get ()->get_next_node_id ()) {} @@ -1546,8 +1544,8 @@ public: void accept_vis (ASTVisitor &vis) override; // TODO: seems kinda dodgy. Think of better way. - std::vector > &get_items () { return items; } - const std::vector > &get_items () const + std::vector> &get_items () { return items; } + const std::vector> &get_items () const { return items; }