From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by sourceware.org (Postfix) with ESMTPS id CEF253858D34 for ; Thu, 26 Aug 2021 02:31:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CEF253858D34 Received: by mail-pj1-x102d.google.com with SMTP id 28-20020a17090a031cb0290178dcd8a4d1so5083676pje.0 for ; Wed, 25 Aug 2021 19:31:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:mime-version:subject :from:in-reply-to:cc:date:message-id:references:to; bh=MzbYC2CqUUT+Bst0+0UG1jEIjTEfAaE53K7huQOdiAo=; b=b+kJmCQjF84RhkwZ72QV/EZE2WIlDit5/ZfLofulnUFUAd/Ox8hdwEAV1zwiFr+u32 ZJrDtLoSwJFXA3oa4nBDcNkuKJy+skQ7gbAaDhVetY51grNCBa23JE4pUN/PRDGQLAhe W0DAUXj5I1wlyLfY4ZVUfaaxGVTfQBA8rRgCvisUPneuAnGUooZa8ze13KCnwuUeMnlw eZvGO8yV9uy/Do8t5pHPQAgXXyDnkA/RZFXr1ra2WaHi2GI6RgZFTjBDCahKt2w23DFu I39XUvI01ZAWOjV1tLzisGmr9k23wVVlCht0RzfBkPL7vTv5kYEF6GM5RE5RK0S3aYcF Bl5A== X-Gm-Message-State: AOAM530pCMXz00l+e6ywvLLy6DZ/P5+5CtSJhJWD2hnAubM4XSKS92ma 3ELAoNu6JoSjIjTE64r/jP0LIgl2w/M= X-Google-Smtp-Source: ABdhPJxQ+6CoesYgxfPQr2Fb4yagOtrwBoN1iEDytSgL4JJkzi3Q1Oxz4FZL9NlsMWrFGqOdylIxgQ== X-Received: by 2002:a17:90a:cf90:: with SMTP id i16mr13800013pju.155.1629945071239; Wed, 25 Aug 2021 19:31:11 -0700 (PDT) Received: from smtpclient.apple ([203.63.207.195]) by smtp.gmail.com with ESMTPSA id f5sm762376pjm.9.2021.08.25.19.31.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Aug 2021 19:31:10 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) Subject: Re: [PATCH] Get rid of get_locus_slow From: The Other In-Reply-To: <20210826000927.104493-1-mark@klomp.org> Cc: gcc-rust@gcc.gnu.org Date: Thu, 26 Aug 2021 10:31:06 +0800 Message-Id: <12501AC4-F3A0-4A4E-8984-7F3318009241@gmail.com> References: <20210826000927.104493-1-mark@klomp.org> To: Mark Wielaard X-Mailer: iPhone Mail (18G82) X-Spam-Status: No, score=-10.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-rust@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: gcc-rust mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2021 02:31:25 -0000 The original point of the distinction between get_locus_slow() and get_locus= () was to avoid the overhead of virtual function calls whenever possible, bu= t still have a way to access locations from abstract base classes like Expr.= =20 As such, I=E2=80=99d at least make the overridden calls =E2=80=98final overr= ide=E2=80=99 in the hope that the compiler can optimise out the virtual call= .=20 > On 26 Aug 2021, at 8:10 am, Mark Wielaard wrote: > =EF=BB=BFIn various places there was the following hack: >=20 > /* HACK: slow way of getting location from base expression through > virtual methods. */ > virtual Location get_locus_slow () const { return Location (); } >=20 > The problem with get_locus_slow () is that if a subclass didn't > override it then there was no real location. get_locus_slow was > missing for Module, ExternCrate, UseDeclaration, Function, TypeAlias, > StructStruct, TupleStruct, Enum, Union, ConstantItem, StaticItem, > Trait, ImplBlock, ExternBlock, EmptyStmt, ExprStmtWithoutBlock and > ExprStmtWithBlock. All do have a get_locus () function. >=20 > Simply replace the get_locus_slow virtual method with a real virtual > Location get_locus () const =3D 0 method so we know if something > really doesn't have a location. This was only the case for > MacroRulesDefinition. > --- >=20 > https://code.wildebeest.org/git/user/mjw/gccrs/commit/?h=3Dno-get-locus-sl= ow >=20 > gcc/rust/ast/rust-ast.h | 27 +- > gcc/rust/ast/rust-expr.h | 39 +-- > gcc/rust/ast/rust-item.h | 10 - > gcc/rust/ast/rust-macro.h | 3 +- > gcc/rust/ast/rust-path.h | 4 - > gcc/rust/ast/rust-pattern.h | 10 - > gcc/rust/ast/rust-stmt.h | 6 - > gcc/rust/ast/rust-type.h | 15 - > gcc/rust/backend/rust-compile-expr.h | 4 +- > gcc/rust/backend/rust-compile.cc | 4 +- > gcc/rust/expand/rust-macro-expand.cc | 299 +++++++++--------- > gcc/rust/hir/rust-ast-lower-expr.h | 5 +- > gcc/rust/hir/rust-ast-lower-item.h | 2 +- > .../hir/rust-ast-lower-struct-field-expr.h | 3 +- > gcc/rust/hir/rust-ast-lower-type.h | 8 +- > gcc/rust/hir/rust-ast-lower.cc | 4 +- > gcc/rust/hir/tree/rust-hir-expr.h | 31 +- > gcc/rust/hir/tree/rust-hir-item.h | 2 - > gcc/rust/hir/tree/rust-hir-path.h | 2 - > gcc/rust/hir/tree/rust-hir-stmt.h | 2 - > gcc/rust/hir/tree/rust-hir-type.h | 2 - > gcc/rust/hir/tree/rust-hir.h | 17 +- > gcc/rust/lint/rust-lint-marklive.cc | 4 +- > gcc/rust/parse/rust-parse-impl.h | 88 +++--- > gcc/rust/resolve/rust-ast-resolve-item.h | 12 +- > gcc/rust/resolve/rust-ast-resolve-type.h | 8 +- > gcc/rust/resolve/rust-ast-verify-assignee.h | 2 +- > gcc/rust/typecheck/rust-hir-const-fold.h | 4 +- > gcc/rust/typecheck/rust-hir-type-check-expr.h | 19 +- > gcc/rust/typecheck/rust-hir-type-check-type.h | 2 +- > gcc/rust/typecheck/rust-hir-type-check.cc | 11 +- > gcc/rust/typecheck/rust-tyty.cc | 14 +- > gcc/rust/util/rust-hir-map.cc | 4 +- > 33 files changed, 256 insertions(+), 411 deletions(-) >=20 > diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h > index e376488de8c..2b34b201970 100644 > --- a/gcc/rust/ast/rust-ast.h > +++ b/gcc/rust/ast/rust-ast.h > @@ -816,9 +816,7 @@ public: >=20 > virtual void accept_vis (ASTVisitor &vis) =3D 0; >=20 > - /* HACK: slow way of getting location from base expression through virt= ual > - * methods. */ > - virtual Location get_locus_slow () const { return Location (); } > + virtual Location get_locus () const =3D 0; >=20 > virtual void mark_for_strip () =3D 0; > virtual bool is_marked_for_strip () const =3D 0; > @@ -885,9 +883,7 @@ public: >=20 > virtual ~Expr () {} >=20 > - /* HACK: slow way of getting location from base expression through virt= ual > - * methods. */ > - virtual Location get_locus_slow () const { return Location (); } > + virtual Location get_locus () const =3D 0; >=20 > // HACK: strictly not needed, but faster than full downcast clone > virtual bool is_expr_without_block () const =3D 0; > @@ -967,7 +963,6 @@ public: > std::string as_string () const override { return ident; } >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > Identifier get_ident () const { return ident; } >=20 > @@ -1026,9 +1021,7 @@ public: > virtual void mark_for_strip () {} > virtual bool is_marked_for_strip () const { return false; } >=20 > - /* HACK: slow way of getting location from base expression through virt= ual > - * methods. */ > - virtual Location get_locus_slow () const =3D 0; > + virtual Location get_locus () const =3D 0; >=20 > virtual NodeId get_node_id () const { return node_id; } >=20 > @@ -1071,7 +1064,7 @@ public: > virtual void mark_for_strip () {} > virtual bool is_marked_for_strip () const { return false; } >=20 > - virtual Location get_locus_slow () const =3D 0; > + virtual Location get_locus () const =3D 0; >=20 > NodeId get_node_id () const { return node_id; } >=20 > @@ -1128,7 +1121,7 @@ public: >=20 > NodeId get_node_id () const { return node_id; } >=20 > - virtual Location get_locus_slow () const =3D 0; > + virtual Location get_locus () const =3D 0; >=20 > protected: > // Clone function implementation as pure virtual method > @@ -1187,8 +1180,6 @@ public: >=20 > Location get_locus () const { return locus; } >=20 > - Location get_locus_slow () const override final { return get_locus (); }= > - > std::string get_lifetime_name () const { return lifetime_name; } >=20 > protected: > @@ -1217,7 +1208,7 @@ public: >=20 > virtual void accept_vis (ASTVisitor &vis) =3D 0; >=20 > - virtual Location get_locus_slow () const =3D 0; > + virtual Location get_locus () const =3D 0; >=20 > NodeId get_node_id () { return node_id; } >=20 > @@ -1272,8 +1263,6 @@ public: >=20 > Location get_locus () const { return locus; } >=20 > - Location get_locus_slow () const override final { return get_locus (); }= > - > protected: > /* Use covariance to implement clone function as returning this object r= ather > * than base */ > @@ -1342,7 +1331,7 @@ public: > virtual void mark_for_strip () =3D 0; > virtual bool is_marked_for_strip () const =3D 0; >=20 > - virtual Location get_locus_slow () const =3D 0; > + virtual Location get_locus () const =3D 0; > }; >=20 > // Abstract base class for items used in a trait impl > @@ -1519,8 +1508,6 @@ public: >=20 > Location get_locus () const { return locus; } >=20 > - Location get_locus_slow () const override { return get_locus (); } > - > protected: > MacroInvocationSemi *clone_macro_invocation_semi_impl () const > { > diff --git a/gcc/rust/ast/rust-expr.h b/gcc/rust/ast/rust-expr.h > index 4bb35570676..644b3cc60db 100644 > --- a/gcc/rust/ast/rust-expr.h > +++ b/gcc/rust/ast/rust-expr.h > @@ -66,7 +66,6 @@ public: > } >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > Literal get_literal () const { return literal; } >=20 > @@ -244,7 +243,6 @@ protected: >=20 > public: > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > // Invalid if expr is null, so base stripping on that. > void mark_for_strip () override { main_or_left_expr =3D nullptr; } > @@ -896,7 +894,6 @@ public: > GroupedExpr &operator=3D (GroupedExpr &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -1140,7 +1137,6 @@ public: > ArrayExpr &operator=3D (ArrayExpr &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -1224,7 +1220,6 @@ public: > ArrayIndexExpr &operator=3D (ArrayIndexExpr &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -1338,7 +1333,6 @@ public: > * comma, i.e. (0,) rather than (0) */ >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -1423,7 +1417,6 @@ public: > TupleIndexExpr &operator=3D (TupleIndexExpr &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -1513,7 +1506,6 @@ public: > {} >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -1600,7 +1592,7 @@ public: >=20 > virtual void accept_vis (ASTVisitor &vis) =3D 0; >=20 > - virtual Location get_locus_slow () const =3D 0; > + virtual Location get_locus () const =3D 0; >=20 > NodeId get_node_id () const { return node_id; } >=20 > @@ -1629,7 +1621,6 @@ public: > std::string as_string () const override { return field_name; } >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -1704,7 +1695,6 @@ public: > std::string get_field_name () const { return field_name; } >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > protected: > /* Use covariance to implement clone function as returning this object r= ather > @@ -1735,7 +1725,6 @@ public: > TupleIndex get_index () const { return index; } >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > protected: > /* Use covariance to implement clone function as returning this object r= ather > @@ -1914,7 +1903,6 @@ public: > StructExprTuple &operator=3D (StructExprTuple &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -1951,7 +1939,6 @@ public: > {} >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -2022,7 +2009,7 @@ public: >=20 > virtual void accept_vis (ASTVisitor &vis) =3D 0; >=20 > - virtual Location get_locus_slow () const =3D 0; > + virtual Location get_locus () const =3D 0; >=20 > protected: > // Clone function implementation as pure virtual method > @@ -2045,7 +2032,6 @@ public: > std::string as_string () const override { return field_name; } >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > protected: > /* Use covariance to implement clone function as returning this object r= ather > @@ -2114,7 +2100,6 @@ public: > void accept_vis (ASTVisitor &vis) override; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > protected: > /* Use covariance to implement clone function as returning this object r= ather > @@ -2145,7 +2130,6 @@ public: > void accept_vis (ASTVisitor &vis) override; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > protected: > /* Use covariance to implement clone function as returning this object r= ather > @@ -2200,7 +2184,6 @@ public: > EnumExprStruct &operator=3D (EnumExprStruct &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -2264,7 +2247,6 @@ public: > EnumExprTuple &operator=3D (EnumExprTuple &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -2303,7 +2285,6 @@ public: > {} >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -2382,7 +2363,6 @@ public: > bool has_params () const { return !params.empty (); } >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -2492,7 +2472,6 @@ public: > MethodCallExpr &operator=3D (MethodCallExpr &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -2595,7 +2574,6 @@ public: > FieldAccessExpr &operator=3D (FieldAccessExpr &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -2734,7 +2712,6 @@ public: > std::string as_string () const override; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > // TODO: this mutable getter seems really dodgy. Think up better way. > const std::vector &get_params () const { return params; } > @@ -2899,7 +2876,6 @@ public: > } >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -3076,7 +3052,6 @@ public: > {} >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -3166,7 +3141,6 @@ public: > BreakExpr &operator=3D (BreakExpr &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -3211,7 +3185,6 @@ protected: >=20 > public: > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > // should never be called - error if called > void set_outer_attrs (std::vector /* new_attrs */) override > @@ -3658,7 +3631,6 @@ public: > ReturnExpr &operator=3D (ReturnExpr &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -3741,7 +3713,6 @@ public: > UnsafeBlockExpr &operator=3D (UnsafeBlockExpr &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -3863,7 +3834,6 @@ public: > LoopLabel &get_loop_label () { return loop_label; } >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > // Invalid if loop block is null, so base stripping on that. > void mark_for_strip () override { loop_block =3D nullptr; } > @@ -4188,7 +4158,6 @@ public: > * better approach? or does it not parse correctly and have downsides? *= / >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -4431,7 +4400,6 @@ public: > } >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -5050,7 +5018,6 @@ public: > MatchExpr &operator=3D (MatchExpr &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -5137,7 +5104,6 @@ public: > std::string as_string () const override; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -5219,7 +5185,6 @@ public: > std::string as_string () const override; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > diff --git a/gcc/rust/ast/rust-item.h b/gcc/rust/ast/rust-item.h > index b996e173d6c..ba1df80b2ca 100644 > --- a/gcc/rust/ast/rust-item.h > +++ b/gcc/rust/ast/rust-item.h > @@ -132,8 +132,6 @@ public: >=20 > Location get_locus () const { return locus; } >=20 > - Location get_locus_slow () const override final { return get_locus (); }= > - > void accept_vis (ASTVisitor &vis) override; >=20 > // TODO: is this better? Or is a "vis_block" better? > @@ -891,8 +889,6 @@ public: >=20 > Location get_locus () const { return locus; } >=20 > - Location get_locus_slow () const override { return get_locus (); } > - > protected: > /* Use covariance to implement clone function as returning this object > * rather than base */ > @@ -1538,8 +1534,6 @@ public: >=20 > Location get_locus () const { return locus; } >=20 > - Location get_locus_slow () const override { return get_locus (); } > - > void accept_vis (ASTVisitor &vis) override; >=20 > // Invalid if block is null, so base stripping on that. > @@ -1762,8 +1756,6 @@ public: >=20 > Location get_locus () const { return locus; } >=20 > - Location get_locus_slow () const final { return get_locus (); }; > - > // Invalid if name is empty, so base stripping on that. > void mark_for_strip () override { struct_name =3D ""; } > bool is_marked_for_strip () const override { return struct_name.empty ()= ; } > @@ -2594,8 +2586,6 @@ public: >=20 > Location get_locus () const { return locus; } >=20 > - Location get_locus_slow () const override { return get_locus (); } > - > void accept_vis (ASTVisitor &vis) override; >=20 > // Invalid if type or expression are null, so base stripping on that. > diff --git a/gcc/rust/ast/rust-macro.h b/gcc/rust/ast/rust-macro.h > index 51220e47003..620451b768f 100644 > --- a/gcc/rust/ast/rust-macro.h > +++ b/gcc/rust/ast/rust-macro.h > @@ -345,6 +345,8 @@ public: > std::vector &get_macro_rules () { return rules; } > const std::vector &get_macro_rules () const { return rules; }= >=20 > + Location get_locus () const { return locus; } > + > protected: > /* Use covariance to implement clone function as returning this object r= ather > * than base */ > @@ -374,7 +376,6 @@ public: > {} >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > diff --git a/gcc/rust/ast/rust-path.h b/gcc/rust/ast/rust-path.h > index 74ea79528af..be4b127c396 100644 > --- a/gcc/rust/ast/rust-path.h > +++ b/gcc/rust/ast/rust-path.h > @@ -358,7 +358,6 @@ public: > } >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -741,7 +740,6 @@ public: > TraitBound *to_trait_bound (bool in_parens) const override; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -886,7 +884,6 @@ public: > } >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -1024,7 +1021,6 @@ public: > } >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= > }; > } // namespace AST > } // namespace Rust > diff --git a/gcc/rust/ast/rust-pattern.h b/gcc/rust/ast/rust-pattern.h > index 049aaf00448..46f2b1551d2 100644 > --- a/gcc/rust/ast/rust-pattern.h > +++ b/gcc/rust/ast/rust-pattern.h > @@ -52,7 +52,6 @@ public: > {} >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -135,7 +134,6 @@ public: > IdentifierPattern &operator=3D (IdentifierPattern &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -171,7 +169,6 @@ public: > WildcardPattern (Location locus) : locus (locus) {} >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -348,7 +345,6 @@ public: > RangePattern &operator=3D (RangePattern &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -413,7 +409,6 @@ public: > ReferencePattern &operator=3D (ReferencePattern &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -806,7 +801,6 @@ public: > bool has_struct_pattern_elems () const { return !elems.is_empty (); } >=20 > Location get_locus () const { return path.get_locus (); } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -1028,7 +1022,6 @@ public: > TupleStructPattern &operator=3D (TupleStructPattern &&other) =3D default= ; >=20 > Location get_locus () const { return path.get_locus (); } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -1281,7 +1274,6 @@ public: > } >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -1337,7 +1329,6 @@ public: > GroupedPattern &operator=3D (GroupedPattern &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -1395,7 +1386,6 @@ public: > SlicePattern &operator=3D (SlicePattern &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > diff --git a/gcc/rust/ast/rust-stmt.h b/gcc/rust/ast/rust-stmt.h > index 61854a07cef..43162964a61 100644 > --- a/gcc/rust/ast/rust-stmt.h > +++ b/gcc/rust/ast/rust-stmt.h > @@ -38,8 +38,6 @@ public: >=20 > EmptyStmt (Location locus) : locus (locus) {} >=20 > - Location get_locus_slow () const final override { return get_locus (); }= > - > Location get_locus () const { return locus; } >=20 > void accept_vis (ASTVisitor &vis) override; > @@ -137,8 +135,6 @@ public: > LetStmt (LetStmt &&other) =3D default; > LetStmt &operator=3D (LetStmt &&other) =3D default; >=20 > - Location get_locus_slow () const final override { return get_locus (); }= > - > Location get_locus () const { return locus; } >=20 > void accept_vis (ASTVisitor &vis) override; > @@ -188,8 +184,6 @@ class ExprStmt : public Stmt > Location locus; >=20 > public: > - Location get_locus_slow () const final override { return get_locus (); }= > - > Location get_locus () const { return locus; } >=20 > protected: > diff --git a/gcc/rust/ast/rust-type.h b/gcc/rust/ast/rust-type.h > index b658a532b98..c87ed9bc038 100644 > --- a/gcc/rust/ast/rust-type.h > +++ b/gcc/rust/ast/rust-type.h > @@ -70,8 +70,6 @@ public: >=20 > Location get_locus () const { return locus; } >=20 > - Location get_locus_slow () const override final { return get_locus (); }= > - > void accept_vis (ASTVisitor &vis) override; >=20 > // TODO: this mutable getter seems kinda dodgy > @@ -145,7 +143,6 @@ public: > std::string as_string () const override; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -215,7 +212,6 @@ public: > std::string as_string () const override; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -284,7 +280,6 @@ public: > } >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -318,7 +313,6 @@ public: > std::string as_string () const override; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -364,7 +358,6 @@ public: > } >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -420,7 +413,6 @@ public: > std::string as_string () const override; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -461,7 +453,6 @@ public: > std::string as_string () const override { return "! (never type)"; } >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; > }; > @@ -514,7 +505,6 @@ public: > std::string as_string () const override; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -582,7 +572,6 @@ public: > std::string as_string () const override; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -644,7 +633,6 @@ public: > std::string as_string () const override; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -705,7 +693,6 @@ public: > std::string as_string () const override; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > @@ -746,7 +733,6 @@ public: > std::string as_string () const override; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; > }; > @@ -924,7 +910,6 @@ public: > std::string as_string () const override; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const final override { return get_locus (); }= >=20 > void accept_vis (ASTVisitor &vis) override; >=20 > diff --git a/gcc/rust/backend/rust-compile-expr.h b/gcc/rust/backend/rust-= compile-expr.h > index 80cdc5eaeb4..ac33ccd247d 100644 > --- a/gcc/rust/backend/rust-compile-expr.h > +++ b/gcc/rust/backend/rust-compile-expr.h > @@ -611,7 +611,7 @@ public: > if (!ctx->get_tyctx ()->lookup_type ( > expr.get_receiver_expr ()->get_mappings ().get_hirid (), &receiver)) > { > - rust_error_at (expr.get_receiver_expr ()->get_locus_slow (), > + rust_error_at (expr.get_receiver_expr ()->get_locus (), > "unresolved type for receiver"); > return; > } > @@ -772,7 +772,7 @@ public: >=20 > Bvariable *loop_result_holder =3D ctx->peek_loop_context (); > Bexpression *result_reference =3D ctx->get_backend ()->var_expression (= > - loop_result_holder, expr.get_expr ()->get_locus_slow ()); > + loop_result_holder, expr.get_expr ()->get_locus ()); >=20 > Bstatement *assignment =3D ctx->get_backend ()->assignment_statement ( > fnctx.fndecl, result_reference, compiled_expr, expr.get_locus ()); > diff --git a/gcc/rust/backend/rust-compile.cc b/gcc/rust/backend/rust-comp= ile.cc > index baaccf06c10..0a65b155e1d 100644 > --- a/gcc/rust/backend/rust-compile.cc > +++ b/gcc/rust/backend/rust-compile.cc > @@ -352,7 +352,7 @@ CompileBlock::visit (HIR::BlockExpr &expr) > { > Bexpression *result_reference > =3D ctx->get_backend ()->var_expression ( > - result, expr.get_final_expr ()->get_locus_slow ()); > + result, expr.get_final_expr ()->get_locus ()); >=20 > Bstatement *assignment > =3D ctx->get_backend ()->assignment_statement (fnctx.fndecl, > @@ -490,7 +490,7 @@ HIRCompileBase::compile_function_body ( >=20 > auto ret =3D ctx->get_backend ()->return_statement ( > fndecl, retstmts, > - function_body->get_final_expr ()->get_locus_slow ()); > + function_body->get_final_expr ()->get_locus ()); > ctx->add_statement (ret); > } > else > diff --git a/gcc/rust/expand/rust-macro-expand.cc b/gcc/rust/expand/rust-m= acro-expand.cc > index 4998dc8441f..407992d828f 100644 > --- a/gcc/rust/expand/rust-macro-expand.cc > +++ b/gcc/rust/expand/rust-macro-expand.cc > @@ -49,7 +49,7 @@ public: > auto &type =3D field.get_field_type (); > type->accept_vis (*this); > if (type->is_marked_for_strip ()) > - rust_error_at (type->get_locus_slow (), > + rust_error_at (type->get_locus (), > "cannot strip type in this position"); >=20 > // if nothing else happens, increment > @@ -75,7 +75,7 @@ public: > auto &type =3D field.get_field_type (); > type->accept_vis (*this); > if (type->is_marked_for_strip ()) > - rust_error_at (type->get_locus_slow (), > + rust_error_at (type->get_locus (), > "cannot strip type in this position"); >=20 > // if nothing else happens, increment > @@ -101,13 +101,13 @@ public: > auto &pattern =3D param.get_pattern (); > pattern->accept_vis (*this); > if (pattern->is_marked_for_strip ()) > - rust_error_at (pattern->get_locus_slow (), > + rust_error_at (pattern->get_locus (), > "cannot strip pattern in this position"); >=20 > auto &type =3D param.get_type (); > type->accept_vis (*this); > if (type->is_marked_for_strip ()) > - rust_error_at (type->get_locus_slow (), > + rust_error_at (type->get_locus (), > "cannot strip type in this position"); >=20 > // increment > @@ -124,7 +124,7 @@ public: > { > type->accept_vis (*this); > if (type->is_marked_for_strip ()) > - rust_error_at (type->get_locus_slow (), > + rust_error_at (type->get_locus (), > "cannot strip type in this position"); > } >=20 > @@ -134,7 +134,7 @@ public: > auto &type =3D binding.get_type (); > type->accept_vis (*this); > if (type->is_marked_for_strip ()) > - rust_error_at (type->get_locus_slow (), > + rust_error_at (type->get_locus (), > "cannot strip type in this position"); > } > } > @@ -144,8 +144,7 @@ public: > auto &type =3D path_type.get_type (); > type->accept_vis (*this); > if (type->is_marked_for_strip ()) > - rust_error_at (type->get_locus_slow (), > - "cannot strip type in this position"); > + rust_error_at (type->get_locus (), "cannot strip type in this posit= ion"); >=20 > if (path_type.has_as_clause ()) > { > @@ -174,7 +173,7 @@ public: > auto &pattern =3D param.get_pattern (); > pattern->accept_vis (*this); > if (pattern->is_marked_for_strip ()) > - rust_error_at (pattern->get_locus_slow (), > + rust_error_at (pattern->get_locus (), > "cannot strip pattern in this position"); >=20 > if (param.has_type_given ()) > @@ -182,7 +181,7 @@ public: > auto &type =3D param.get_type (); > type->accept_vis (*this); > if (type->is_marked_for_strip ()) > - rust_error_at (type->get_locus_slow (), > + rust_error_at (type->get_locus (), > "cannot strip type in this position"); > } >=20 > @@ -198,7 +197,7 @@ public: > auto &type =3D self_param.get_type (); > type->accept_vis (*this); > if (type->is_marked_for_strip ()) > - rust_error_at (type->get_locus_slow (), > + rust_error_at (type->get_locus (), > "cannot strip type in this position"); > } > /* TODO: maybe check for invariants being violated - e.g. both type an= d > @@ -227,7 +226,7 @@ public: > auto &return_type =3D decl.get_return_type (); > return_type->accept_vis (*this); > if (return_type->is_marked_for_strip ()) > - rust_error_at (return_type->get_locus_slow (), > + rust_error_at (return_type->get_locus (), > "cannot strip type in this position"); > } >=20 > @@ -255,7 +254,7 @@ public: > auto &return_type =3D decl.get_return_type (); > return_type->accept_vis (*this); > if (return_type->is_marked_for_strip ()) > - rust_error_at (return_type->get_locus_slow (), > + rust_error_at (return_type->get_locus (), > "cannot strip type in this position"); > } >=20 > @@ -363,7 +362,7 @@ public: > { > type->accept_vis (*this); > if (type->is_marked_for_strip ()) > - rust_error_at (type->get_locus_slow (), > + rust_error_at (type->get_locus (), > "cannot strip type in this position"); > } >=20 > @@ -372,7 +371,7 @@ public: > auto &return_type =3D type_path_function.get_return_type (); > return_type->accept_vis (*this); > if (return_type->is_marked_for_strip ()) > - rust_error_at (return_type->get_locus_slow (), > + rust_error_at (return_type->get_locus (), > "cannot strip type in this position"); > } > } > @@ -447,7 +446,7 @@ public: > auto &borrowed_expr =3D expr.get_borrowed_expr (); > borrowed_expr->accept_vis (*this); > if (borrowed_expr->is_marked_for_strip ()) > - rust_error_at (borrowed_expr->get_locus_slow (), > + rust_error_at (borrowed_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -467,7 +466,7 @@ public: > auto &dereferenced_expr =3D expr.get_dereferenced_expr (); > dereferenced_expr->accept_vis (*this); > if (dereferenced_expr->is_marked_for_strip ()) > - rust_error_at (dereferenced_expr->get_locus_slow (), > + rust_error_at (dereferenced_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -487,7 +486,7 @@ public: > auto &propagating_expr =3D expr.get_propagating_expr (); > propagating_expr->accept_vis (*this); > if (propagating_expr->is_marked_for_strip ()) > - rust_error_at (propagating_expr->get_locus_slow (), > + rust_error_at (propagating_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -507,7 +506,7 @@ public: > auto &negated_expr =3D expr.get_negated_expr (); > negated_expr->accept_vis (*this); > if (negated_expr->is_marked_for_strip ()) > - rust_error_at (negated_expr->get_locus_slow (), > + rust_error_at (negated_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -525,12 +524,12 @@ public: >=20 > // ensure that they are not marked for strip > if (expr.get_left_expr ()->is_marked_for_strip ()) > - rust_error_at (expr.get_left_expr ()->get_locus_slow (), > + rust_error_at (expr.get_left_expr ()->get_locus (), > "cannot strip expression in this position - outer " > "attributes are never allowed " > "before binary op exprs"); > if (expr.get_right_expr ()->is_marked_for_strip ()) > - rust_error_at (expr.get_right_expr ()->get_locus_slow (), > + rust_error_at (expr.get_right_expr ()->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -548,12 +547,12 @@ public: >=20 > // ensure that they are not marked for strip > if (expr.get_left_expr ()->is_marked_for_strip ()) > - rust_error_at (expr.get_left_expr ()->get_locus_slow (), > + rust_error_at (expr.get_left_expr ()->get_locus (), > "cannot strip expression in this position - outer " > "attributes are never allowed " > "before binary op exprs"); > if (expr.get_right_expr ()->is_marked_for_strip ()) > - rust_error_at (expr.get_right_expr ()->get_locus_slow (), > + rust_error_at (expr.get_right_expr ()->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -571,12 +570,12 @@ public: >=20 > // ensure that they are not marked for strip > if (expr.get_left_expr ()->is_marked_for_strip ()) > - rust_error_at (expr.get_left_expr ()->get_locus_slow (), > + rust_error_at (expr.get_left_expr ()->get_locus (), > "cannot strip expression in this position - outer " > "attributes are never allowed " > "before binary op exprs"); > if (expr.get_right_expr ()->is_marked_for_strip ()) > - rust_error_at (expr.get_right_expr ()->get_locus_slow (), > + rust_error_at (expr.get_right_expr ()->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -592,7 +591,7 @@ public: >=20 > // ensure that they are not marked for strip > if (casted_expr->is_marked_for_strip ()) > - rust_error_at (casted_expr->get_locus_slow (), > + rust_error_at (casted_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes are never allowed before cast exprs"); >=20 > @@ -600,8 +599,7 @@ public: > auto &type =3D expr.get_type_to_cast_to (); > type->accept_vis (*this); > if (type->is_marked_for_strip ()) > - rust_error_at (type->get_locus_slow (), > - "cannot strip type in this position"); > + rust_error_at (type->get_locus (), "cannot strip type in this posit= ion"); > } > void visit (AST::AssignmentExpr &expr) override > { > @@ -617,12 +615,12 @@ public: >=20 > // ensure that they are not marked for strip > if (expr.get_left_expr ()->is_marked_for_strip ()) > - rust_error_at (expr.get_left_expr ()->get_locus_slow (), > + rust_error_at (expr.get_left_expr ()->get_locus (), > "cannot strip expression in this position - outer " > "attributes are never allowed " > "before binary op exprs"); > if (expr.get_right_expr ()->is_marked_for_strip ()) > - rust_error_at (expr.get_right_expr ()->get_locus_slow (), > + rust_error_at (expr.get_right_expr ()->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -640,12 +638,12 @@ public: >=20 > // ensure that they are not marked for strip > if (expr.get_left_expr ()->is_marked_for_strip ()) > - rust_error_at (expr.get_left_expr ()->get_locus_slow (), > + rust_error_at (expr.get_left_expr ()->get_locus (), > "cannot strip expression in this position - outer " > "attributes are never allowed " > "before binary op exprs"); > if (expr.get_right_expr ()->is_marked_for_strip ()) > - rust_error_at (expr.get_right_expr ()->get_locus_slow (), > + rust_error_at (expr.get_right_expr ()->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -674,7 +672,7 @@ public: > auto &inner_expr =3D expr.get_expr_in_parens (); > inner_expr->accept_vis (*this); > if (inner_expr->is_marked_for_strip ()) > - rust_error_at (inner_expr->get_locus_slow (), > + rust_error_at (inner_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -695,14 +693,14 @@ public: > auto &copied_expr =3D elems.get_elem_to_copy (); > copied_expr->accept_vis (*this); > if (copied_expr->is_marked_for_strip ()) > - rust_error_at (copied_expr->get_locus_slow (), > + rust_error_at (copied_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); >=20 > auto ©_count =3D elems.get_num_copies (); > copy_count->accept_vis (*this); > if (copy_count->is_marked_for_strip ()) > - rust_error_at (copy_count->get_locus_slow (), > + rust_error_at (copy_count->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -748,14 +746,14 @@ public: > auto &array_expr =3D expr.get_array_expr (); > array_expr->accept_vis (*this); > if (array_expr->is_marked_for_strip ()) > - rust_error_at (array_expr->get_locus_slow (), > + rust_error_at (array_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); >=20 > auto &index_expr =3D expr.get_index_expr (); > index_expr->accept_vis (*this); > if (index_expr->is_marked_for_strip ()) > - rust_error_at (index_expr->get_locus_slow (), > + rust_error_at (index_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -801,7 +799,7 @@ public: > auto &tuple_expr =3D expr.get_tuple_expr (); > tuple_expr->accept_vis (*this); > if (tuple_expr->is_marked_for_strip ()) > - rust_error_at (tuple_expr->get_locus_slow (), > + rust_error_at (tuple_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -842,7 +840,7 @@ public: > auto &value =3D field.get_value (); > value->accept_vis (*this); > if (value->is_marked_for_strip ()) > - rust_error_at (value->get_locus_slow (), > + rust_error_at (value->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -853,7 +851,7 @@ public: > auto &value =3D field.get_value (); > value->accept_vis (*this); > if (value->is_marked_for_strip ()) > - rust_error_at (value->get_locus_slow (), > + rust_error_at (value->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -900,7 +898,7 @@ public: > auto &base_struct_expr =3D expr.get_struct_base ().get_base_struct (); > base_struct_expr->accept_vis (*this); > if (base_struct_expr->is_marked_for_strip ()) > - rust_error_at (base_struct_expr->get_locus_slow (), > + rust_error_at (base_struct_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -937,7 +935,7 @@ public: > auto &base_struct_expr =3D expr.get_struct_base ().get_base_struct ();= > base_struct_expr->accept_vis (*this); > if (base_struct_expr->is_marked_for_strip ()) > - rust_error_at (base_struct_expr->get_locus_slow (), > + rust_error_at (base_struct_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -999,7 +997,7 @@ public: > auto &value =3D field.get_value (); > value->accept_vis (*this); > if (value->is_marked_for_strip ()) > - rust_error_at (value->get_locus_slow (), > + rust_error_at (value->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -1010,7 +1008,7 @@ public: > auto &value =3D field.get_value (); > value->accept_vis (*this); > if (value->is_marked_for_strip ()) > - rust_error_at (value->get_locus_slow (), > + rust_error_at (value->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -1093,7 +1091,7 @@ public: > auto &function =3D expr.get_function_expr (); > function->accept_vis (*this); > if (function->is_marked_for_strip ()) > - rust_error_at (function->get_locus_slow (), > + rust_error_at (function->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); >=20 > @@ -1117,7 +1115,7 @@ public: > auto &receiver =3D expr.get_receiver_expr (); > receiver->accept_vis (*this); > if (receiver->is_marked_for_strip ()) > - rust_error_at (receiver->get_locus_slow (), > + rust_error_at (receiver->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); >=20 > @@ -1145,7 +1143,7 @@ public: > auto &receiver =3D expr.get_receiver_expr (); > receiver->accept_vis (*this); > if (receiver->is_marked_for_strip ()) > - rust_error_at (receiver->get_locus_slow (), > + rust_error_at (receiver->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -1167,7 +1165,7 @@ public: > auto &definition_expr =3D expr.get_definition_expr (); > definition_expr->accept_vis (*this); > if (definition_expr->is_marked_for_strip ()) > - rust_error_at (definition_expr->get_locus_slow (), > + rust_error_at (definition_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -1222,14 +1220,13 @@ public: > auto &type =3D expr.get_return_type (); > type->accept_vis (*this); > if (type->is_marked_for_strip ()) > - rust_error_at (type->get_locus_slow (), > - "cannot strip type in this position"); > + rust_error_at (type->get_locus (), "cannot strip type in this posit= ion"); >=20 > // can't strip expression itself, but can strip sub-expressions > auto &definition_block =3D expr.get_definition_block (); > definition_block->accept_vis (*this); > if (definition_block->is_marked_for_strip ()) > - rust_error_at (definition_block->get_locus_slow (), > + rust_error_at (definition_block->get_locus (), > "cannot strip block expression in this position - outer " > "attributes not allowed"); > } > @@ -1263,7 +1260,7 @@ public: > break_expr->accept_vis (*this); >=20 > if (break_expr->is_marked_for_strip ()) > - rust_error_at (break_expr->get_locus_slow (), > + rust_error_at (break_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -1282,12 +1279,12 @@ public: >=20 > // ensure that they are not marked for strip > if (expr.get_from_expr ()->is_marked_for_strip ()) > - rust_error_at (expr.get_from_expr ()->get_locus_slow (), > + rust_error_at (expr.get_from_expr ()->get_locus (), > "cannot strip expression in this position - outer " > "attributes are never allowed " > "before range exprs"); > if (expr.get_to_expr ()->is_marked_for_strip ()) > - rust_error_at (expr.get_to_expr ()->get_locus_slow (), > + rust_error_at (expr.get_to_expr ()->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -1303,7 +1300,7 @@ public: > from_expr->accept_vis (*this); >=20 > if (from_expr->is_marked_for_strip ()) > - rust_error_at (from_expr->get_locus_slow (), > + rust_error_at (from_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes are never allowed before range exprs"); > } > @@ -1319,7 +1316,7 @@ public: > to_expr->accept_vis (*this); >=20 > if (to_expr->is_marked_for_strip ()) > - rust_error_at (to_expr->get_locus_slow (), > + rust_error_at (to_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -1341,12 +1338,12 @@ public: >=20 > // ensure that they are not marked for strip > if (expr.get_from_expr ()->is_marked_for_strip ()) > - rust_error_at (expr.get_from_expr ()->get_locus_slow (), > + rust_error_at (expr.get_from_expr ()->get_locus (), > "cannot strip expression in this position - outer " > "attributes are never allowed " > "before range exprs"); > if (expr.get_to_expr ()->is_marked_for_strip ()) > - rust_error_at (expr.get_to_expr ()->get_locus_slow (), > + rust_error_at (expr.get_to_expr ()->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -1362,7 +1359,7 @@ public: > to_expr->accept_vis (*this); >=20 > if (to_expr->is_marked_for_strip ()) > - rust_error_at (to_expr->get_locus_slow (), > + rust_error_at (to_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -1386,7 +1383,7 @@ public: > returned_expr->accept_vis (*this); >=20 > if (returned_expr->is_marked_for_strip ()) > - rust_error_at (returned_expr->get_locus_slow (), > + rust_error_at (returned_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -1410,7 +1407,7 @@ public: > auto &block_expr =3D expr.get_block_expr (); > block_expr->accept_vis (*this); > if (block_expr->is_marked_for_strip ()) > - rust_error_at (block_expr->get_locus_slow (), > + rust_error_at (block_expr->get_locus (), > "cannot strip block expression in this position - outer " > "attributes not allowed"); > } > @@ -1428,7 +1425,7 @@ public: > auto &loop_block =3D expr.get_loop_block (); > loop_block->accept_vis (*this); > if (loop_block->is_marked_for_strip ()) > - rust_error_at (loop_block->get_locus_slow (), > + rust_error_at (loop_block->get_locus (), > "cannot strip block expression in this position - outer " > "attributes not allowed"); > } > @@ -1446,7 +1443,7 @@ public: > auto &predicate_expr =3D expr.get_predicate_expr (); > predicate_expr->accept_vis (*this); > if (predicate_expr->is_marked_for_strip ()) > - rust_error_at (predicate_expr->get_locus_slow (), > + rust_error_at (predicate_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); >=20 > @@ -1454,7 +1451,7 @@ public: > auto &loop_block =3D expr.get_loop_block (); > loop_block->accept_vis (*this); > if (loop_block->is_marked_for_strip ()) > - rust_error_at (loop_block->get_locus_slow (), > + rust_error_at (loop_block->get_locus (), > "cannot strip block expression in this position - outer " > "attributes not allowed"); > } > @@ -1472,7 +1469,7 @@ public: > { > pattern->accept_vis (*this); > if (pattern->is_marked_for_strip ()) > - rust_error_at (pattern->get_locus_slow (), > + rust_error_at (pattern->get_locus (), > "cannot strip pattern in this position"); > } >=20 > @@ -1480,7 +1477,7 @@ public: > auto &scrutinee_expr =3D expr.get_scrutinee_expr (); > scrutinee_expr->accept_vis (*this); > if (scrutinee_expr->is_marked_for_strip ()) > - rust_error_at (scrutinee_expr->get_locus_slow (), > + rust_error_at (scrutinee_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); >=20 > @@ -1488,7 +1485,7 @@ public: > auto &loop_block =3D expr.get_loop_block (); > loop_block->accept_vis (*this); > if (loop_block->is_marked_for_strip ()) > - rust_error_at (loop_block->get_locus_slow (), > + rust_error_at (loop_block->get_locus (), > "cannot strip block expression in this position - outer " > "attributes not allowed"); > } > @@ -1506,14 +1503,14 @@ public: > auto &pattern =3D expr.get_pattern (); > pattern->accept_vis (*this); > if (pattern->is_marked_for_strip ()) > - rust_error_at (pattern->get_locus_slow (), > + rust_error_at (pattern->get_locus (), > "cannot strip pattern in this position"); >=20 > // can't strip scrutinee expr itself, but can strip sub-expressions > auto &iterator_expr =3D expr.get_iterator_expr (); > iterator_expr->accept_vis (*this); > if (iterator_expr->is_marked_for_strip ()) > - rust_error_at (iterator_expr->get_locus_slow (), > + rust_error_at (iterator_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); >=20 > @@ -1521,7 +1518,7 @@ public: > auto &loop_block =3D expr.get_loop_block (); > loop_block->accept_vis (*this); > if (loop_block->is_marked_for_strip ()) > - rust_error_at (loop_block->get_locus_slow (), > + rust_error_at (loop_block->get_locus (), > "cannot strip block expression in this position - outer " > "attributes not allowed"); > } > @@ -1542,7 +1539,7 @@ public: > auto &condition_expr =3D expr.get_condition_expr (); > condition_expr->accept_vis (*this); > if (condition_expr->is_marked_for_strip ()) > - rust_error_at (condition_expr->get_locus_slow (), > + rust_error_at (condition_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); >=20 > @@ -1550,7 +1547,7 @@ public: > auto &if_block =3D expr.get_if_block (); > if_block->accept_vis (*this); > if (if_block->is_marked_for_strip ()) > - rust_error_at (if_block->get_locus_slow (), > + rust_error_at (if_block->get_locus (), > "cannot strip block expression in this position - outer " > "attributes not allowed"); > } > @@ -1568,7 +1565,7 @@ public: > auto &condition_expr =3D expr.get_condition_expr (); > condition_expr->accept_vis (*this); > if (condition_expr->is_marked_for_strip ()) > - rust_error_at (condition_expr->get_locus_slow (), > + rust_error_at (condition_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); >=20 > @@ -1576,7 +1573,7 @@ public: > auto &if_block =3D expr.get_if_block (); > if_block->accept_vis (*this); > if (if_block->is_marked_for_strip ()) > - rust_error_at (if_block->get_locus_slow (), > + rust_error_at (if_block->get_locus (), > "cannot strip block expression in this position - outer " > "attributes not allowed"); >=20 > @@ -1584,7 +1581,7 @@ public: > auto &else_block =3D expr.get_else_block (); > else_block->accept_vis (*this); > if (else_block->is_marked_for_strip ()) > - rust_error_at (else_block->get_locus_slow (), > + rust_error_at (else_block->get_locus (), > "cannot strip block expression in this position - outer " > "attributes not allowed"); > } > @@ -1602,7 +1599,7 @@ public: > auto &condition_expr =3D expr.get_condition_expr (); > condition_expr->accept_vis (*this); > if (condition_expr->is_marked_for_strip ()) > - rust_error_at (condition_expr->get_locus_slow (), > + rust_error_at (condition_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); >=20 > @@ -1610,7 +1607,7 @@ public: > auto &if_block =3D expr.get_if_block (); > if_block->accept_vis (*this); > if (if_block->is_marked_for_strip ()) > - rust_error_at (if_block->get_locus_slow (), > + rust_error_at (if_block->get_locus (), > "cannot strip block expression in this position - outer " > "attributes not allowed"); >=20 > @@ -1618,7 +1615,7 @@ public: > auto &conseq_if_expr =3D expr.get_conseq_if_expr (); > conseq_if_expr->accept_vis (*this); > if (conseq_if_expr->is_marked_for_strip ()) > - rust_error_at (conseq_if_expr->get_locus_slow (), > + rust_error_at (conseq_if_expr->get_locus (), > "cannot strip consequent if expression in this " > "position - outer attributes not allowed"); > } > @@ -1636,7 +1633,7 @@ public: > auto &condition_expr =3D expr.get_condition_expr (); > condition_expr->accept_vis (*this); > if (condition_expr->is_marked_for_strip ()) > - rust_error_at (condition_expr->get_locus_slow (), > + rust_error_at (condition_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); >=20 > @@ -1644,7 +1641,7 @@ public: > auto &if_block =3D expr.get_if_block (); > if_block->accept_vis (*this); > if (if_block->is_marked_for_strip ()) > - rust_error_at (if_block->get_locus_slow (), > + rust_error_at (if_block->get_locus (), > "cannot strip block expression in this position - outer " > "attributes not allowed"); >=20 > @@ -1652,7 +1649,7 @@ public: > auto &conseq_if_let_expr =3D expr.get_conseq_if_let_expr (); > conseq_if_let_expr->accept_vis (*this); > if (conseq_if_let_expr->is_marked_for_strip ()) > - rust_error_at (conseq_if_let_expr->get_locus_slow (), > + rust_error_at (conseq_if_let_expr->get_locus (), > "cannot strip consequent if let expression in this " > "position - outer attributes not " > "allowed"); > @@ -1671,7 +1668,7 @@ public: > { > pattern->accept_vis (*this); > if (pattern->is_marked_for_strip ()) > - rust_error_at (pattern->get_locus_slow (), > + rust_error_at (pattern->get_locus (), > "cannot strip pattern in this position"); > } >=20 > @@ -1679,7 +1676,7 @@ public: > auto &value_expr =3D expr.get_value_expr (); > value_expr->accept_vis (*this); > if (value_expr->is_marked_for_strip ()) > - rust_error_at (value_expr->get_locus_slow (), > + rust_error_at (value_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); >=20 > @@ -1687,7 +1684,7 @@ public: > auto &if_block =3D expr.get_if_block (); > if_block->accept_vis (*this); > if (if_block->is_marked_for_strip ()) > - rust_error_at (if_block->get_locus_slow (), > + rust_error_at (if_block->get_locus (), > "cannot strip block expression in this position - outer " > "attributes not allowed"); > } > @@ -1705,7 +1702,7 @@ public: > { > pattern->accept_vis (*this); > if (pattern->is_marked_for_strip ()) > - rust_error_at (pattern->get_locus_slow (), > + rust_error_at (pattern->get_locus (), > "cannot strip pattern in this position"); > } >=20 > @@ -1713,7 +1710,7 @@ public: > auto &value_expr =3D expr.get_value_expr (); > value_expr->accept_vis (*this); > if (value_expr->is_marked_for_strip ()) > - rust_error_at (value_expr->get_locus_slow (), > + rust_error_at (value_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); >=20 > @@ -1721,7 +1718,7 @@ public: > auto &if_block =3D expr.get_if_block (); > if_block->accept_vis (*this); > if (if_block->is_marked_for_strip ()) > - rust_error_at (if_block->get_locus_slow (), > + rust_error_at (if_block->get_locus (), > "cannot strip block expression in this position - outer " > "attributes not allowed"); >=20 > @@ -1729,7 +1726,7 @@ public: > auto &else_block =3D expr.get_else_block (); > else_block->accept_vis (*this); > if (else_block->is_marked_for_strip ()) > - rust_error_at (else_block->get_locus_slow (), > + rust_error_at (else_block->get_locus (), > "cannot strip block expression in this position - outer " > "attributes not allowed"); > } > @@ -1747,7 +1744,7 @@ public: > { > pattern->accept_vis (*this); > if (pattern->is_marked_for_strip ()) > - rust_error_at (pattern->get_locus_slow (), > + rust_error_at (pattern->get_locus (), > "cannot strip pattern in this position"); > } >=20 > @@ -1755,7 +1752,7 @@ public: > auto &value_expr =3D expr.get_value_expr (); > value_expr->accept_vis (*this); > if (value_expr->is_marked_for_strip ()) > - rust_error_at (value_expr->get_locus_slow (), > + rust_error_at (value_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); >=20 > @@ -1763,7 +1760,7 @@ public: > auto &if_block =3D expr.get_if_block (); > if_block->accept_vis (*this); > if (if_block->is_marked_for_strip ()) > - rust_error_at (if_block->get_locus_slow (), > + rust_error_at (if_block->get_locus (), > "cannot strip block expression in this position - outer " > "attributes not allowed"); >=20 > @@ -1771,7 +1768,7 @@ public: > auto &conseq_if_expr =3D expr.get_conseq_if_expr (); > conseq_if_expr->accept_vis (*this); > if (conseq_if_expr->is_marked_for_strip ()) > - rust_error_at (conseq_if_expr->get_locus_slow (), > + rust_error_at (conseq_if_expr->get_locus (), > "cannot strip consequent if expression in this " > "position - outer attributes not allowed"); > } > @@ -1789,7 +1786,7 @@ public: > { > pattern->accept_vis (*this); > if (pattern->is_marked_for_strip ()) > - rust_error_at (pattern->get_locus_slow (), > + rust_error_at (pattern->get_locus (), > "cannot strip pattern in this position"); > } >=20 > @@ -1797,7 +1794,7 @@ public: > auto &value_expr =3D expr.get_value_expr (); > value_expr->accept_vis (*this); > if (value_expr->is_marked_for_strip ()) > - rust_error_at (value_expr->get_locus_slow (), > + rust_error_at (value_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); >=20 > @@ -1805,7 +1802,7 @@ public: > auto &if_block =3D expr.get_if_block (); > if_block->accept_vis (*this); > if (if_block->is_marked_for_strip ()) > - rust_error_at (if_block->get_locus_slow (), > + rust_error_at (if_block->get_locus (), > "cannot strip block expression in this position - outer " > "attributes not allowed"); >=20 > @@ -1813,7 +1810,7 @@ public: > auto &conseq_if_let_expr =3D expr.get_conseq_if_let_expr (); > conseq_if_let_expr->accept_vis (*this); > if (conseq_if_let_expr->is_marked_for_strip ()) > - rust_error_at (conseq_if_let_expr->get_locus_slow (), > + rust_error_at (conseq_if_let_expr->get_locus (), > "cannot strip consequent if let expression in this " > "position - outer attributes not " > "allowed"); > @@ -1840,7 +1837,7 @@ public: > auto &scrutinee_expr =3D expr.get_scrutinee_expr (); > scrutinee_expr->accept_vis (*this); > if (scrutinee_expr->is_marked_for_strip ()) > - rust_error_at (scrutinee_expr->get_locus_slow (), > + rust_error_at (scrutinee_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); >=20 > @@ -1864,7 +1861,7 @@ public: > { > pattern->accept_vis (*this); > if (pattern->is_marked_for_strip ()) > - rust_error_at (pattern->get_locus_slow (), > + rust_error_at (pattern->get_locus (), > "cannot strip pattern in this position"); > } >=20 > @@ -1877,7 +1874,7 @@ public: > auto &guard_expr =3D match_arm.get_guard_expr (); > guard_expr->accept_vis (*this); > if (guard_expr->is_marked_for_strip ()) > - rust_error_at (guard_expr->get_locus_slow (), > + rust_error_at (guard_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -1886,7 +1883,7 @@ public: > auto &case_expr =3D match_case.get_expr (); > case_expr->accept_vis (*this); > if (case_expr->is_marked_for_strip ()) > - rust_error_at (case_expr->get_locus_slow (), > + rust_error_at (case_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); >=20 > @@ -1909,7 +1906,7 @@ public: > auto &awaited_expr =3D expr.get_awaited_expr (); > awaited_expr->accept_vis (*this); > if (awaited_expr->is_marked_for_strip ()) > - rust_error_at (awaited_expr->get_locus_slow (), > + rust_error_at (awaited_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -1927,7 +1924,7 @@ public: > auto &block_expr =3D expr.get_block_expr (); > block_expr->accept_vis (*this); > if (block_expr->is_marked_for_strip ()) > - rust_error_at (block_expr->get_locus_slow (), > + rust_error_at (block_expr->get_locus (), > "cannot strip block expression in this position - outer " > "attributes not allowed"); > } > @@ -1948,7 +1945,7 @@ public: > auto &type =3D param.get_type (); > type->accept_vis (*this); > if (type->is_marked_for_strip ()) > - rust_error_at (type->get_locus_slow (), > + rust_error_at (type->get_locus (), > "cannot strip type in this position"); > } > } > @@ -1963,8 +1960,7 @@ public: > auto &type =3D item.get_type (); > type->accept_vis (*this); > if (type->is_marked_for_strip ()) > - rust_error_at (type->get_locus_slow (), > - "cannot strip type in this position"); > + rust_error_at (type->get_locus (), "cannot strip type in this posit= ion"); >=20 > // don't strip directly, only components of bounds > for (auto &bound : item.get_type_param_bounds ()) > @@ -1998,7 +1994,7 @@ public: > auto &return_type =3D method.get_return_type (); > return_type->accept_vis (*this); > if (return_type->is_marked_for_strip ()) > - rust_error_at (return_type->get_locus_slow (), > + rust_error_at (return_type->get_locus (), > "cannot strip type in this position"); > } >=20 > @@ -2011,7 +2007,7 @@ public: > auto &block_expr =3D method.get_definition (); > block_expr->accept_vis (*this); > if (block_expr->is_marked_for_strip ()) > - rust_error_at (block_expr->get_locus_slow (), > + rust_error_at (block_expr->get_locus (), > "cannot strip block expression in this position - outer " > "attributes not allowed"); > } > @@ -2099,7 +2095,7 @@ public: > auto &return_type =3D function.get_return_type (); > return_type->accept_vis (*this); > if (return_type->is_marked_for_strip ()) > - rust_error_at (return_type->get_locus_slow (), > + rust_error_at (return_type->get_locus (), > "cannot strip type in this position"); > } >=20 > @@ -2112,7 +2108,7 @@ public: > auto &block_expr =3D function.get_definition (); > block_expr->accept_vis (*this); > if (block_expr->is_marked_for_strip ()) > - rust_error_at (block_expr->get_locus_slow (), > + rust_error_at (block_expr->get_locus (), > "cannot strip block expression in this position - outer " > "attributes not allowed"); > } > @@ -2136,8 +2132,7 @@ public: > auto &type =3D type_alias.get_type_aliased (); > type->accept_vis (*this); > if (type->is_marked_for_strip ()) > - rust_error_at (type->get_locus_slow (), > - "cannot strip type in this position"); > + rust_error_at (type->get_locus (), "cannot strip type in this posit= ion"); > } > void visit (AST::StructStruct &struct_item) override > { > @@ -2235,7 +2230,7 @@ public: > auto &expr =3D item.get_expr (); > expr->accept_vis (*this); > if (expr->is_marked_for_strip ()) > - rust_error_at (expr->get_locus_slow (), > + rust_error_at (expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -2295,8 +2290,7 @@ public: > auto &type =3D const_item.get_type (); > type->accept_vis (*this); > if (type->is_marked_for_strip ()) > - rust_error_at (type->get_locus_slow (), > - "cannot strip type in this position"); > + rust_error_at (type->get_locus (), "cannot strip type in this posit= ion"); >=20 > /* strip any internal sub-expressions - expression itself isn't > * allowed to have external attributes in this position so can't be > @@ -2304,7 +2298,7 @@ public: > auto &expr =3D const_item.get_expr (); > expr->accept_vis (*this); > if (expr->is_marked_for_strip ()) > - rust_error_at (expr->get_locus_slow (), > + rust_error_at (expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -2322,8 +2316,7 @@ public: > auto &type =3D static_item.get_type (); > type->accept_vis (*this); > if (type->is_marked_for_strip ()) > - rust_error_at (type->get_locus_slow (), > - "cannot strip type in this position"); > + rust_error_at (type->get_locus (), "cannot strip type in this posit= ion"); >=20 > /* strip any internal sub-expressions - expression itself isn't > * allowed to have external attributes in this position so can't be > @@ -2331,7 +2324,7 @@ public: > auto &expr =3D static_item.get_expr (); > expr->accept_vis (*this); > if (expr->is_marked_for_strip ()) > - rust_error_at (expr->get_locus_slow (), > + rust_error_at (expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -2355,7 +2348,7 @@ public: > auto &block =3D item.get_definition (); > block->accept_vis (*this); > if (block->is_marked_for_strip ()) > - rust_error_at (block->get_locus_slow (), > + rust_error_at (block->get_locus (), > "cannot strip block expression in this " > "position - outer attributes not allowed"); > } > @@ -2380,7 +2373,7 @@ public: > auto &block =3D item.get_definition (); > block->accept_vis (*this); > if (block->is_marked_for_strip ()) > - rust_error_at (block->get_locus_slow (), > + rust_error_at (block->get_locus (), > "cannot strip block expression in this " > "position - outer attributes not allowed"); > } > @@ -2399,8 +2392,7 @@ public: > auto &type =3D item.get_type (); > type->accept_vis (*this); > if (type->is_marked_for_strip ()) > - rust_error_at (type->get_locus_slow (), > - "cannot strip type in this position"); > + rust_error_at (type->get_locus (), "cannot strip type in this posit= ion"); >=20 > /* strip any internal sub-expressions - expression itself isn't > * allowed to have external attributes in this position so can't be > @@ -2410,7 +2402,7 @@ public: > auto &expr =3D item.get_expr (); > expr->accept_vis (*this); > if (expr->is_marked_for_strip ()) > - rust_error_at (expr->get_locus_slow (), > + rust_error_at (expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -2492,8 +2484,7 @@ public: > auto &type =3D impl.get_type (); > type->accept_vis (*this); > if (type->is_marked_for_strip ()) > - rust_error_at (type->get_locus_slow (), > - "cannot strip type in this position"); > + rust_error_at (type->get_locus (), "cannot strip type in this posit= ion"); >=20 > if (impl.has_where_clause ()) > expand_where_clause (impl.get_where_clause ()); > @@ -2526,8 +2517,7 @@ public: > auto &type =3D impl.get_type (); > type->accept_vis (*this); > if (type->is_marked_for_strip ()) > - rust_error_at (type->get_locus_slow (), > - "cannot strip type in this position"); > + rust_error_at (type->get_locus (), "cannot strip type in this posit= ion"); >=20 > auto &trait_path =3D impl.get_trait_path (); > visit (trait_path); > @@ -2554,8 +2544,7 @@ public: > auto &type =3D item.get_type (); > type->accept_vis (*this); > if (type->is_marked_for_strip ()) > - rust_error_at (type->get_locus_slow (), > - "cannot strip type in this position"); > + rust_error_at (type->get_locus (), "cannot strip type in this posit= ion"); > } > void visit (AST::ExternalFunctionItem &item) override > { > @@ -2589,7 +2578,7 @@ public: > auto &type =3D param.get_type (); > type->accept_vis (*this); > if (type->is_marked_for_strip ()) > - rust_error_at (type->get_locus_slow (), > + rust_error_at (type->get_locus (), > "cannot strip type in this position"); >=20 > // increment if nothing else happens > @@ -2607,7 +2596,7 @@ public: > auto &return_type =3D item.get_return_type (); > return_type->accept_vis (*this); > if (return_type->is_marked_for_strip ()) > - rust_error_at (return_type->get_locus_slow (), > + rust_error_at (return_type->get_locus (), > "cannot strip type in this position"); > } >=20 > @@ -2686,7 +2675,7 @@ public: > auto &sub_pattern =3D pattern.get_pattern_to_bind (); > sub_pattern->accept_vis (*this); > if (sub_pattern->is_marked_for_strip ()) > - rust_error_at (sub_pattern->get_locus_slow (), > + rust_error_at (sub_pattern->get_locus (), > "cannot strip pattern in this position"); > } > void visit (AST::WildcardPattern &) override > @@ -2724,7 +2713,7 @@ public: > auto &sub_pattern =3D pattern.get_referenced_pattern (); > sub_pattern->accept_vis (*this); > if (sub_pattern->is_marked_for_strip ()) > - rust_error_at (sub_pattern->get_locus_slow (), > + rust_error_at (sub_pattern->get_locus (), > "cannot strip pattern in this position"); > } > void visit (AST::StructPatternFieldTuplePat &field) override > @@ -2741,7 +2730,7 @@ public: > auto &sub_pattern =3D field.get_index_pattern (); > sub_pattern->accept_vis (*this); > if (sub_pattern->is_marked_for_strip ()) > - rust_error_at (sub_pattern->get_locus_slow (), > + rust_error_at (sub_pattern->get_locus (), > "cannot strip pattern in this position"); > } > void visit (AST::StructPatternFieldIdentPat &field) override > @@ -2758,7 +2747,7 @@ public: > auto &sub_pattern =3D field.get_ident_pattern (); > sub_pattern->accept_vis (*this); > if (sub_pattern->is_marked_for_strip ()) > - rust_error_at (sub_pattern->get_locus_slow (), > + rust_error_at (sub_pattern->get_locus (), > "cannot strip pattern in this position"); > } > void visit (AST::StructPatternFieldIdent &field) override > @@ -2805,7 +2794,7 @@ public: > pattern->accept_vis (*this); >=20 > if (pattern->is_marked_for_strip ()) > - rust_error_at (pattern->get_locus_slow (), > + rust_error_at (pattern->get_locus (), > "cannot strip pattern in this position"); > // TODO: quit stripping now? or keep going? > } > @@ -2818,7 +2807,7 @@ public: > lower_pattern->accept_vis (*this); >=20 > if (lower_pattern->is_marked_for_strip ()) > - rust_error_at (lower_pattern->get_locus_slow (), > + rust_error_at (lower_pattern->get_locus (), > "cannot strip pattern in this position"); > // TODO: quit stripping now? or keep going? > } > @@ -2827,7 +2816,7 @@ public: > upper_pattern->accept_vis (*this); >=20 > if (upper_pattern->is_marked_for_strip ()) > - rust_error_at (upper_pattern->get_locus_slow (), > + rust_error_at (upper_pattern->get_locus (), > "cannot strip pattern in this position"); > // TODO: quit stripping now? or keep going? > } > @@ -2851,7 +2840,7 @@ public: > pattern->accept_vis (*this); >=20 > if (pattern->is_marked_for_strip ()) > - rust_error_at (pattern->get_locus_slow (), > + rust_error_at (pattern->get_locus (), > "cannot strip pattern in this position"); > // TODO: quit stripping now? or keep going? > } > @@ -2864,7 +2853,7 @@ public: > lower_pattern->accept_vis (*this); >=20 > if (lower_pattern->is_marked_for_strip ()) > - rust_error_at (lower_pattern->get_locus_slow (), > + rust_error_at (lower_pattern->get_locus (), > "cannot strip pattern in this position"); > // TODO: quit stripping now? or keep going? > } > @@ -2873,7 +2862,7 @@ public: > upper_pattern->accept_vis (*this); >=20 > if (upper_pattern->is_marked_for_strip ()) > - rust_error_at (upper_pattern->get_locus_slow (), > + rust_error_at (upper_pattern->get_locus (), > "cannot strip pattern in this position"); > // TODO: quit stripping now? or keep going? > } > @@ -2891,7 +2880,7 @@ public: > pattern_in_parens->accept_vis (*this); >=20 > if (pattern_in_parens->is_marked_for_strip ()) > - rust_error_at (pattern_in_parens->get_locus_slow (), > + rust_error_at (pattern_in_parens->get_locus (), > "cannot strip pattern in this position"); > } > void visit (AST::SlicePattern &pattern) override > @@ -2902,7 +2891,7 @@ public: > item->accept_vis (*this); >=20 > if (item->is_marked_for_strip ()) > - rust_error_at (item->get_locus_slow (), > + rust_error_at (item->get_locus (), > "cannot strip pattern in this position"); > // TODO: quit stripping now? or keep going? > } > @@ -2926,7 +2915,7 @@ public: > auto &pattern =3D stmt.get_pattern (); > pattern->accept_vis (*this); > if (pattern->is_marked_for_strip ()) > - rust_error_at (pattern->get_locus_slow (), > + rust_error_at (pattern->get_locus (), > "cannot strip pattern in this position"); >=20 > // similar for type > @@ -2935,7 +2924,7 @@ public: > auto &type =3D stmt.get_type (); > type->accept_vis (*this); > if (type->is_marked_for_strip ()) > - rust_error_at (type->get_locus_slow (), > + rust_error_at (type->get_locus (), > "cannot strip type in this position"); > } >=20 > @@ -2947,7 +2936,7 @@ public: > auto &init_expr =3D stmt.get_init_expr (); > init_expr->accept_vis (*this); > if (init_expr->is_marked_for_strip ()) > - rust_error_at (init_expr->get_locus_slow (), > + rust_error_at (init_expr->get_locus (), > "cannot strip expression in this position - outer " > "attributes not allowed"); > } > @@ -3016,7 +3005,7 @@ public: > auto &inner_type =3D type.get_type_in_parens (); > inner_type->accept_vis (*this); > if (inner_type->is_marked_for_strip ()) > - rust_error_at (inner_type->get_locus_slow (), > + rust_error_at (inner_type->get_locus (), > "cannot strip type in this position"); > } > void visit (AST::ImplTraitTypeOneBound &type) override > @@ -3037,7 +3026,7 @@ public: > { > elem_type->accept_vis (*this); > if (elem_type->is_marked_for_strip ()) > - rust_error_at (elem_type->get_locus_slow (), > + rust_error_at (elem_type->get_locus (), > "cannot strip type in this position"); > } > } > @@ -3051,7 +3040,7 @@ public: > auto &pointed_type =3D type.get_type_pointed_to (); > pointed_type->accept_vis (*this); > if (pointed_type->is_marked_for_strip ()) > - rust_error_at (pointed_type->get_locus_slow (), > + rust_error_at (pointed_type->get_locus (), > "cannot strip type in this position"); > } > void visit (AST::ReferenceType &type) override > @@ -3060,7 +3049,7 @@ public: > auto &referenced_type =3D type.get_type_referenced (); > referenced_type->accept_vis (*this); > if (referenced_type->is_marked_for_strip ()) > - rust_error_at (referenced_type->get_locus_slow (), > + rust_error_at (referenced_type->get_locus (), > "cannot strip type in this position"); > } > void visit (AST::ArrayType &type) override > @@ -3069,14 +3058,14 @@ public: > auto &base_type =3D type.get_elem_type (); > base_type->accept_vis (*this); > if (base_type->is_marked_for_strip ()) > - rust_error_at (base_type->get_locus_slow (), > + rust_error_at (base_type->get_locus (), > "cannot strip type in this position"); >=20 > // same for expression > auto &size_expr =3D type.get_size_expr (); > size_expr->accept_vis (*this); > if (size_expr->is_marked_for_strip ()) > - rust_error_at (size_expr->get_locus_slow (), > + rust_error_at (size_expr->get_locus (), > "cannot strip expression in this position"); > } > void visit (AST::SliceType &type) override > @@ -3085,7 +3074,7 @@ public: > auto &elem_type =3D type.get_elem_type (); > elem_type->accept_vis (*this); > if (elem_type->is_marked_for_strip ()) > - rust_error_at (elem_type->get_locus_slow (), > + rust_error_at (elem_type->get_locus (), > "cannot strip type in this position"); > } > void visit (AST::InferredType &) override > @@ -3113,7 +3102,7 @@ public: > auto &type =3D param.get_type (); > type->accept_vis (*this); > if (type->is_marked_for_strip ()) > - rust_error_at (type->get_locus_slow (), > + rust_error_at (type->get_locus (), > "cannot strip type in this position"); >=20 > // increment if nothing else happens > @@ -3128,7 +3117,7 @@ public: > auto &return_type =3D type.get_return_type (); > return_type->accept_vis (*this); > if (return_type->is_marked_for_strip ()) > - rust_error_at (return_type->get_locus_slow (), > + rust_error_at (return_type->get_locus (), > "cannot strip type in this position"); > } >=20 > diff --git a/gcc/rust/hir/rust-ast-lower-expr.h b/gcc/rust/hir/rust-ast-lo= wer-expr.h > index 3415567c86b..ff4c181d0e2 100644 > --- a/gcc/rust/hir/rust-ast-lower-expr.h > +++ b/gcc/rust/hir/rust-ast-lower-expr.h > @@ -81,7 +81,7 @@ public: > expr->accept_vis (resolver); > if (resolver.translated =3D=3D nullptr) > { > - rust_fatal_error (expr->get_locus_slow (), "Failed to lower expr: [%s= ]", > + rust_fatal_error (expr->get_locus (), "Failed to lower expr: [%s]", > expr->as_string ().c_str ()); > return nullptr; > } > @@ -91,8 +91,7 @@ public: > resolver.translated->get_mappings ().get_hirid (), resolver.translat= ed); > resolver.mappings->insert_location ( > resolver.translated->get_mappings ().get_crate_num (), > - resolver.translated->get_mappings ().get_hirid (), > - expr->get_locus_slow ()); > + resolver.translated->get_mappings ().get_hirid (), expr->get_locus (= )); >=20 > if (terminated !=3D nullptr) > *terminated =3D resolver.terminated; > diff --git a/gcc/rust/hir/rust-ast-lower-item.h b/gcc/rust/hir/rust-ast-lo= wer-item.h > index c7f874d1dc9..7efcffaf05b 100644 > --- a/gcc/rust/hir/rust-ast-lower-item.h > +++ b/gcc/rust/hir/rust-ast-lower-item.h > @@ -47,7 +47,7 @@ public: > // this is useful for debugging > // if (resolver.translated =3D=3D nullptr) > // { > - // rust_fatal_error (item->get_locus_slow (), "failed to lower: %= s", > + // rust_fatal_error (item->get_locus (), "failed to lower: %s", > // item->as_string ().c_str ()); > // return nullptr; > // } > diff --git a/gcc/rust/hir/rust-ast-lower-struct-field-expr.h b/gcc/rust/hi= r/rust-ast-lower-struct-field-expr.h > index 3b313a78476..e6322dbb514 100644 > --- a/gcc/rust/hir/rust-ast-lower-struct-field-expr.h > +++ b/gcc/rust/hir/rust-ast-lower-struct-field-expr.h > @@ -41,8 +41,7 @@ public: > compiler.translated->get_mappings ().get_hirid (), compiler.translat= ed); > compiler.mappings->insert_location ( > compiler.translated->get_mappings ().get_crate_num (), > - compiler.translated->get_mappings ().get_hirid (), > - field->get_locus_slow ()); > + compiler.translated->get_mappings ().get_hirid (), field->get_locus= ()); >=20 > return compiler.translated; > } > diff --git a/gcc/rust/hir/rust-ast-lower-type.h b/gcc/rust/hir/rust-ast-lo= wer-type.h > index 9b5ec0a4df7..c16025d137b 100644 > --- a/gcc/rust/hir/rust-ast-lower-type.h > +++ b/gcc/rust/hir/rust-ast-lower-type.h > @@ -106,8 +106,7 @@ public: > rust_assert (resolver.translated !=3D nullptr); > resolver.mappings->insert_location ( > resolver.translated->get_mappings ().get_crate_num (), > - resolver.translated->get_mappings ().get_hirid (), > - type->get_locus_slow ()); > + resolver.translated->get_mappings ().get_hirid (), type->get_locus (= )); >=20 > return resolver.translated; > } > @@ -282,8 +281,7 @@ public: > rust_assert (resolver.translated !=3D nullptr); > resolver.mappings->insert_location ( > resolver.translated->get_mappings ().get_crate_num (), > - resolver.translated->get_mappings ().get_hirid (), > - param->get_locus_slow ()); > + resolver.translated->get_mappings ().get_hirid (), param->get_locus= ()); > resolver.mappings->insert_hir_generic_param ( > resolver.translated->get_mappings ().get_crate_num (), > resolver.translated->get_mappings ().get_hirid (), resolver.translat= ed); > @@ -356,7 +354,7 @@ public: > resolver.mappings->insert_location ( > resolver.translated->get_mappings ().get_crate_num (), > resolver.translated->get_mappings ().get_hirid (), > - resolver.translated->get_locus_slow ()); > + resolver.translated->get_locus ()); >=20 > return resolver.translated; > } > diff --git a/gcc/rust/hir/rust-ast-lower.cc b/gcc/rust/hir/rust-ast-lower.= cc > index e693799d4b5..d5138fd64ac 100644 > --- a/gcc/rust/hir/rust-ast-lower.cc > +++ b/gcc/rust/hir/rust-ast-lower.cc > @@ -66,7 +66,7 @@ ASTLoweringBlock::visit (AST::BlockExpr &expr) > bool block_did_terminate =3D false; > expr.iterate_stmts ([&] (AST::Stmt *s) mutable -> bool { > if (block_did_terminate) > - rust_warning_at (s->get_locus_slow (), 0, "unreachable statement");= > + rust_warning_at (s->get_locus (), 0, "unreachable statement"); >=20 > bool terminated =3D false; > auto translated_stmt =3D ASTLoweringStmt::translate (s, &terminated); > @@ -78,7 +78,7 @@ ASTLoweringBlock::visit (AST::BlockExpr &expr) > if (expr.has_tail_expr () && block_did_terminate) > { > // warning unreachable tail expressions > - rust_warning_at (expr.get_tail_expr ()->get_locus_slow (), 0, > + rust_warning_at (expr.get_tail_expr ()->get_locus (), 0, > "unreachable expression"); > } >=20 > diff --git a/gcc/rust/hir/tree/rust-hir-expr.h b/gcc/rust/hir/tree/rust-hi= r-expr.h > index 8d815c5adc6..233e015110c 100644 > --- a/gcc/rust/hir/tree/rust-hir-expr.h > +++ b/gcc/rust/hir/tree/rust-hir-expr.h > @@ -91,7 +91,6 @@ public: > } >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > void accept_vis (HIRVisitor &vis) override; >=20 > @@ -164,7 +163,6 @@ protected: >=20 > public: > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > std::unique_ptr &get_expr () { return main_or_left_expr; } > }; > @@ -711,7 +709,6 @@ public: > GroupedExpr &operator=3D (GroupedExpr &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > void accept_vis (HIRVisitor &vis) override; >=20 > @@ -916,7 +913,6 @@ public: > ArrayExpr &operator=3D (ArrayExpr &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > void accept_vis (HIRVisitor &vis) override; >=20 > @@ -982,7 +978,6 @@ public: > ArrayIndexExpr &operator=3D (ArrayIndexExpr &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > void accept_vis (HIRVisitor &vis) override; >=20 > @@ -1061,7 +1056,6 @@ public: > * comma, i.e. (0,) rather than (0) */ >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > void accept_vis (HIRVisitor &vis) override; >=20 > @@ -1145,7 +1139,6 @@ public: > TupleIndexExpr &operator=3D (TupleIndexExpr &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > void accept_vis (HIRVisitor &vis) override; >=20 > @@ -1212,7 +1205,6 @@ public: > {} >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > void accept_vis (HIRVisitor &vis) override; >=20 > @@ -1641,7 +1633,6 @@ public: > StructExprTuple &operator=3D (StructExprTuple &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > void accept_vis (HIRVisitor &vis) override; >=20 > @@ -1677,7 +1668,6 @@ public: > {} >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > void accept_vis (HIRVisitor &vis) override; >=20 > @@ -1895,7 +1885,6 @@ public: > EnumExprStruct &operator=3D (EnumExprStruct &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > void accept_vis (HIRVisitor &vis) override; >=20 > @@ -1965,7 +1954,6 @@ public: > EnumExprTuple &operator=3D (EnumExprTuple &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > void accept_vis (HIRVisitor &vis) override; >=20 > @@ -2006,7 +1994,6 @@ public: > {} >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > void accept_vis (HIRVisitor &vis) override; >=20 > @@ -2083,7 +2070,6 @@ public: > bool has_params () const { return !params.empty (); } >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > void accept_vis (HIRVisitor &vis) override; >=20 > @@ -2173,7 +2159,6 @@ public: > MethodCallExpr &operator=3D (MethodCallExpr &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > void accept_vis (HIRVisitor &vis) override; >=20 > @@ -2258,7 +2243,6 @@ public: > FieldAccessExpr &operator=3D (FieldAccessExpr &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > void accept_vis (HIRVisitor &vis) override; >=20 > @@ -2362,7 +2346,6 @@ public: > std::string as_string () const override; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } > }; >=20 > // Represents a non-type-specified closure expression HIR node > @@ -2498,7 +2481,6 @@ public: > } >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > void accept_vis (HIRVisitor &vis) override; >=20 > @@ -2518,7 +2500,7 @@ public: > if (statements.size () =3D=3D 0) > return get_locus (); >=20 > - return statements[statements.size () - 1]->get_locus_slow (); > + return statements[statements.size () - 1]->get_locus (); > } >=20 > std::unique_ptr &get_final_expr () { return expr; } > @@ -2633,7 +2615,6 @@ public: > {} >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > void accept_vis (HIRVisitor &vis) override; >=20 > @@ -2713,7 +2694,6 @@ public: > BreakExpr &operator=3D (BreakExpr &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > void accept_vis (HIRVisitor &vis) override; >=20 > @@ -2747,7 +2727,6 @@ protected: >=20 > public: > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } > }; >=20 > // Range from (inclusive) and to (exclusive) expression HIR node object > @@ -3090,7 +3069,6 @@ public: > ReturnExpr &operator=3D (ReturnExpr &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > void accept_vis (HIRVisitor &vis) override; >=20 > @@ -3152,7 +3130,6 @@ public: > UnsafeBlockExpr &operator=3D (UnsafeBlockExpr &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > void accept_vis (HIRVisitor &vis) override; >=20 > @@ -3251,7 +3228,6 @@ public: > bool has_loop_label () const { return !loop_label.is_error (); } >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > std::unique_ptr &get_loop_block () { return loop_block; }= ; >=20 > @@ -3541,7 +3517,6 @@ public: > * better approach? or does it not parse correctly and have downsides? *= / >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > void accept_vis (HIRVisitor &vis) override; >=20 > @@ -3766,7 +3741,6 @@ public: > } >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > void accept_vis (HIRVisitor &vis) override; >=20 > @@ -4342,7 +4316,6 @@ public: > MatchExpr &operator=3D (MatchExpr &&other) =3D default; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > void accept_vis (HIRVisitor &vis) override; >=20 > @@ -4397,7 +4370,6 @@ public: > std::string as_string () const override; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > void accept_vis (HIRVisitor &vis) override; >=20 > @@ -4451,7 +4423,6 @@ public: > std::string as_string () const override; >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > void accept_vis (HIRVisitor &vis) override; >=20 > diff --git a/gcc/rust/hir/tree/rust-hir-item.h b/gcc/rust/hir/tree/rust-hi= r-item.h > index 7a05f02067b..90b6820e64d 100644 > --- a/gcc/rust/hir/tree/rust-hir-item.h > +++ b/gcc/rust/hir/tree/rust-hir-item.h > @@ -106,8 +106,6 @@ public: >=20 > Location get_locus () const { return locus; } >=20 > - Location get_locus_slow () const override final { return get_locus (); }= > - > void accept_vis (HIRVisitor &vis) override; >=20 > Identifier get_type_representation () const { return type_representation= ; } > diff --git a/gcc/rust/hir/tree/rust-hir-path.h b/gcc/rust/hir/tree/rust-hi= r-path.h > index a8bbbb62ef6..9f60b8fb7df 100644 > --- a/gcc/rust/hir/tree/rust-hir-path.h > +++ b/gcc/rust/hir/tree/rust-hir-path.h > @@ -316,7 +316,6 @@ public: > } >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > void accept_vis (HIRVisitor &vis) override; >=20 > @@ -792,7 +791,6 @@ public: > {} >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > void accept_vis (HIRVisitor &vis) override; >=20 > diff --git a/gcc/rust/hir/tree/rust-hir-stmt.h b/gcc/rust/hir/tree/rust-hi= r-stmt.h > index 584b0e358cd..eef6834f99a 100644 > --- a/gcc/rust/hir/tree/rust-hir-stmt.h > +++ b/gcc/rust/hir/tree/rust-hir-stmt.h > @@ -109,8 +109,6 @@ public: > LetStmt (LetStmt &&other) =3D default; > LetStmt &operator=3D (LetStmt &&other) =3D default; >=20 > - Location get_locus_slow () const override { return get_locus (); } > - > Location get_locus () const { return locus; } >=20 > void accept_vis (HIRVisitor &vis) override; > diff --git a/gcc/rust/hir/tree/rust-hir-type.h b/gcc/rust/hir/tree/rust-hi= r-type.h > index 8d75d0285d3..5b578d915a2 100644 > --- a/gcc/rust/hir/tree/rust-hir-type.h > +++ b/gcc/rust/hir/tree/rust-hir-type.h > @@ -63,8 +63,6 @@ public: > return mappings; > } >=20 > - Location get_locus_slow () const override final { return get_locus (); }= > - > BoundType get_bound_type () const final override { return TRAITBOUND; } >=20 > TypePath &get_path () { return type_path; } > diff --git a/gcc/rust/hir/tree/rust-hir.h b/gcc/rust/hir/tree/rust-hir.h > index b8acf1a6e40..b285d352b59 100644 > --- a/gcc/rust/hir/tree/rust-hir.h > +++ b/gcc/rust/hir/tree/rust-hir.h > @@ -100,9 +100,7 @@ public: >=20 > virtual void accept_vis (HIRVisitor &vis) =3D 0; >=20 > - /* HACK: slow way of getting location from base expression through virt= ual > - * methods. */ > - virtual Location get_locus_slow () const { return Location (); } > + virtual Location get_locus () const =3D 0; >=20 > virtual bool is_unit_check_needed () const { return false; } >=20 > @@ -194,9 +192,7 @@ public: >=20 > virtual ~Expr () {} >=20 > - /* HACK: slow way of getting location from base expression through virt= ual > - * methods. */ > - virtual Location get_locus_slow () const { return Location (); } > + virtual Location get_locus () const =3D 0; >=20 > // HACK: strictly not needed, but faster than full downcast clone > virtual bool is_expr_without_block () const =3D 0; > @@ -285,7 +281,6 @@ public: > } >=20 > Location get_locus () const { return locus; } > - Location get_locus_slow () const override { return get_locus (); } >=20 > void accept_vis (HIRVisitor &vis) override; >=20 > @@ -426,7 +421,7 @@ public: >=20 > virtual Analysis::NodeMapping get_mappings () const =3D 0; >=20 > - virtual Location get_locus_slow () const =3D 0; > + virtual Location get_locus () const =3D 0; >=20 > virtual BoundType get_bound_type () const =3D 0; >=20 > @@ -483,8 +478,6 @@ public: > return mappings; > } >=20 > - Location get_locus_slow () const override final { return get_locus (); }= > - > BoundType get_bound_type () const final override { return LIFETIME; } >=20 > protected: > @@ -522,7 +515,7 @@ public: >=20 > virtual void accept_vis (HIRVisitor &vis) =3D 0; >=20 > - virtual Location get_locus_slow () const =3D 0; > + virtual Location get_locus () const =3D 0; >=20 > Analysis::NodeMapping get_mappings () const { return mappings; } >=20 > @@ -611,8 +604,6 @@ public: >=20 > Location get_locus () const { return locus; } >=20 > - Location get_locus_slow () const override final { return get_locus (); }= > - > protected: > /* Use covariance to implement clone function as returning this object r= ather > * than base */ > diff --git a/gcc/rust/lint/rust-lint-marklive.cc b/gcc/rust/lint/rust-lint= -marklive.cc > index 87fa3ef2f3e..f383d48377e 100644 > --- a/gcc/rust/lint/rust-lint-marklive.cc > +++ b/gcc/rust/lint/rust-lint-marklive.cc > @@ -211,7 +211,7 @@ MarkLive::visit (HIR::FieldAccessExpr &expr) > if (!tyctx->lookup_type ( > expr.get_receiver_expr ()->get_mappings ().get_hirid (), &receiver)) > { > - rust_error_at (expr.get_receiver_expr ()->get_locus_slow (), > + rust_error_at (expr.get_receiver_expr ()->get_locus (), > "unresolved type for receiver"); > } > bool ok =3D receiver->get_kind () =3D=3D TyTy::TypeKind::ADT; > @@ -223,7 +223,7 @@ MarkLive::visit (HIR::FieldAccessExpr &expr) > adt->get_field (expr.get_field_name (), &index); > if (index >=3D adt->num_fields ()) > { > - rust_error_at (expr.get_receiver_expr ()->get_locus_slow (), > + rust_error_at (expr.get_receiver_expr ()->get_locus (), > "cannot access struct %s by index: %ld", > adt->get_name ().c_str (), index); > return; > diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-= impl.h > index fa6d409c6dc..8ee9e42f944 100644 > --- a/gcc/rust/parse/rust-parse-impl.h > +++ b/gcc/rust/parse/rust-parse-impl.h > @@ -11431,7 +11431,7 @@ Parser::parse_stmt_or_expr_wit= h_block ( > return ExprOrStmt (std::move (expr)); >=20 > // internal block expr must either have semicolons followed, or evaluate= to () > - auto locus =3D expr->get_locus_slow (); > + auto locus =3D expr->get_locus (); > std::unique_ptr stmt ( > new AST::ExprStmtWithBlock (std::move (expr), locus, > tok->get_id () =3D=3D SEMICOLON)); > @@ -12823,7 +12823,7 @@ Parser::left_denotation (const= _TokenPtr tok, > { > // FIXME: allow for outer attributes to be applied > case QUESTION_MARK: { > - Location left_locus =3D left->get_locus_slow (); > + Location left_locus =3D left->get_locus (); > // error propagation expression - unary postfix > return std::unique_ptr ( > new AST::ErrorPropagationExpr (std::move (left), > @@ -13185,7 +13185,7 @@ Parser::parse_arithmetic_or_lo= gical_expr ( > return nullptr; >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::ArithmeticOrLogicalExpr (std::move (left), std::move (right),= > @@ -13206,7 +13206,7 @@ Parser::parse_binary_plus_expr= ( > return nullptr; >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::ArithmeticOrLogicalExpr (std::move (left), std::move (right),= > @@ -13227,7 +13227,7 @@ Parser::parse_binary_minus_exp= r ( > return nullptr; >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::ArithmeticOrLogicalExpr (std::move (left), std::move (right),= > @@ -13249,7 +13249,7 @@ Parser::parse_binary_mult_expr= ( > return nullptr; >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::ArithmeticOrLogicalExpr (std::move (left), std::move (right),= > @@ -13271,7 +13271,7 @@ Parser::parse_binary_div_expr (= > return nullptr; >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::ArithmeticOrLogicalExpr (std::move (left), std::move (right),= > @@ -13293,7 +13293,7 @@ Parser::parse_binary_mod_expr (= > return nullptr; >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::ArithmeticOrLogicalExpr (std::move (left), std::move (right),= > @@ -13316,7 +13316,7 @@ Parser::parse_bitwise_and_expr= ( > return nullptr; >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::ArithmeticOrLogicalExpr (std::move (left), std::move (right),= > @@ -13339,7 +13339,7 @@ Parser::parse_bitwise_or_expr (= > return nullptr; >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::ArithmeticOrLogicalExpr (std::move (left), std::move (right),= > @@ -13362,7 +13362,7 @@ Parser::parse_bitwise_xor_expr= ( > return nullptr; >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::ArithmeticOrLogicalExpr (std::move (left), std::move (right),= > @@ -13384,7 +13384,7 @@ Parser::parse_left_shift_expr (= > return nullptr; >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::ArithmeticOrLogicalExpr (std::move (left), std::move (right),= > @@ -13406,7 +13406,7 @@ Parser::parse_right_shift_expr= ( > return nullptr; >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::ArithmeticOrLogicalExpr (std::move (left), std::move (right),= > @@ -13458,7 +13458,7 @@ Parser::parse_comparison_expr (= > return nullptr; >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::ComparisonExpr (std::move (left), std::move (right), expr_typ= e, > @@ -13479,7 +13479,7 @@ Parser::parse_binary_equal_exp= r ( > return nullptr; >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::ComparisonExpr (std::move (left), std::move (right), > @@ -13500,7 +13500,7 @@ Parser::parse_binary_not_equal= _expr ( > return nullptr; >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::ComparisonExpr (std::move (left), std::move (right), > @@ -13521,7 +13521,7 @@ Parser::parse_binary_greater_t= han_expr ( > return nullptr; >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::ComparisonExpr (std::move (left), std::move (right), > @@ -13542,7 +13542,7 @@ Parser::parse_binary_less_than= _expr ( > return nullptr; >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::ComparisonExpr (std::move (left), std::move (right), > @@ -13563,7 +13563,7 @@ Parser::parse_binary_greater_e= qual_expr ( > return nullptr; >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::ComparisonExpr (std::move (left), std::move (right), > @@ -13584,7 +13584,7 @@ Parser::parse_binary_less_equa= l_expr ( > return nullptr; >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::ComparisonExpr (std::move (left), std::move (right), > @@ -13605,7 +13605,7 @@ Parser::parse_lazy_or_expr ( > return nullptr; >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::LazyBooleanExpr (std::move (left), std::move (right), > @@ -13626,7 +13626,7 @@ Parser::parse_lazy_and_expr ( > return nullptr; >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::LazyBooleanExpr (std::move (left), std::move (right), > @@ -13648,7 +13648,7 @@ Parser::parse_type_cast_expr (= > // FIXME: how do I get precedence put in here? >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D expr_to_cast->get_locus_slow (); > + Location locus =3D expr_to_cast->get_locus (); >=20 > return std::unique_ptr ( > new AST::TypeCastExpr (std::move (expr_to_cast), std::move (type), loc= us)); > @@ -13669,7 +13669,7 @@ Parser::parse_assig_expr ( > // FIXME: ensure right-associativity for this - 'LBP - 1' may do this? >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::AssignmentExpr (std::move (left), std::move (right), locus));= > @@ -13728,7 +13728,7 @@ Parser::parse_compound_assignm= ent_expr ( > // FIXME: ensure right-associativity for this - 'LBP - 1' may do this? >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::CompoundAssignmentExpr (std::move (left), std::move (right), > @@ -13750,7 +13750,7 @@ Parser::parse_plus_assig_expr (= > // FIXME: ensure right-associativity for this - 'LBP - 1' may do this? >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::CompoundAssignmentExpr (std::move (left), std::move (right), > @@ -13772,7 +13772,7 @@ Parser::parse_minus_assig_expr= ( > // FIXME: ensure right-associativity for this - 'LBP - 1' may do this? >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::CompoundAssignmentExpr (std::move (left), std::move (right), > @@ -13795,7 +13795,7 @@ Parser::parse_mult_assig_expr (= > // FIXME: ensure right-associativity for this - 'LBP - 1' may do this? >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::CompoundAssignmentExpr (std::move (left), std::move (right), > @@ -13818,7 +13818,7 @@ Parser::parse_div_assig_expr (= > // FIXME: ensure right-associativity for this - 'LBP - 1' may do this? >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::CompoundAssignmentExpr (std::move (left), std::move (right), > @@ -13841,7 +13841,7 @@ Parser::parse_mod_assig_expr (= > // FIXME: ensure right-associativity for this - 'LBP - 1' may do this? >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::CompoundAssignmentExpr (std::move (left), std::move (right), > @@ -13864,7 +13864,7 @@ Parser::parse_and_assig_expr (= > // FIXME: ensure right-associativity for this - 'LBP - 1' may do this? >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::CompoundAssignmentExpr (std::move (left), std::move (right), > @@ -13887,7 +13887,7 @@ Parser::parse_or_assig_expr ( > // FIXME: ensure right-associativity for this - 'LBP - 1' may do this? >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::CompoundAssignmentExpr (std::move (left), std::move (right), > @@ -13910,7 +13910,7 @@ Parser::parse_xor_assig_expr (= > // FIXME: ensure right-associativity for this - 'LBP - 1' may do this? >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::CompoundAssignmentExpr (std::move (left), std::move (right), > @@ -13933,7 +13933,7 @@ Parser::parse_left_shift_assig= _expr ( > // FIXME: ensure right-associativity for this - 'LBP - 1' may do this? >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::CompoundAssignmentExpr (std::move (left), std::move (right), > @@ -13956,7 +13956,7 @@ Parser::parse_right_shift_assi= g_expr ( > // FIXME: ensure right-associativity for this - 'LBP - 1' may do this? >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::CompoundAssignmentExpr (std::move (left), std::move (right), > @@ -13985,7 +13985,7 @@ Parser::parse_await_expr ( > } >=20 > // TODO: check inside async block in semantic analysis > - Location locus =3D expr_to_await->get_locus_slow (); > + Location locus =3D expr_to_await->get_locus (); >=20 > return std::unique_ptr ( > new AST::AwaitExpr (std::move (expr_to_await), std::move (outer_attrs)= , > @@ -14008,7 +14008,7 @@ Parser::parse_led_range_exclus= ive_expr ( > std::unique_ptr right > =3D parse_expr (LBP_DOT_DOT, AST::AttrVec (), restrictions); >=20 > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > if (right =3D=3D nullptr) > { > @@ -14066,7 +14066,7 @@ Parser::parse_range_inclusive_= expr ( > // FIXME: make non-associative >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D left->get_locus_slow (); > + Location locus =3D left->get_locus (); >=20 > return std::unique_ptr ( > new AST::RangeFromToInclExpr (std::move (left), std::move (right), loc= us)); > @@ -14114,7 +14114,7 @@ Parser::parse_tuple_index_expr= ( > } > int index_int =3D atoi (index.c_str ()); >=20 > - Location locus =3D tuple_expr->get_locus_slow (); > + Location locus =3D tuple_expr->get_locus (); >=20 > return std::unique_ptr ( > new AST::TupleIndexExpr (std::move (tuple_expr), index_int, > @@ -14145,7 +14145,7 @@ Parser::parse_index_expr ( > } >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D array_expr->get_locus_slow (); > + Location locus =3D array_expr->get_locus (); >=20 > return std::unique_ptr ( > new AST::ArrayIndexExpr (std::move (array_expr), std::move (index_expr= ), > @@ -14167,7 +14167,7 @@ Parser::parse_field_access_exp= r ( >=20 > Identifier ident =3D ident_tok->get_str (); >=20 > - Location locus =3D struct_expr->get_locus_slow (); > + Location locus =3D struct_expr->get_locus (); >=20 > // TODO: check types. actually, do so during semantic analysis > return std::unique_ptr ( > @@ -14230,7 +14230,7 @@ Parser::parse_method_call_expr= ( > } >=20 > // TODO: check types. actually do so in semantic analysis pass. > - Location locus =3D receiver_expr->get_locus_slow (); > + Location locus =3D receiver_expr->get_locus (); >=20 > return std::unique_ptr ( > new AST::MethodCallExpr (std::move (receiver_expr), std::move (segment= ), > @@ -14277,7 +14277,7 @@ Parser::parse_function_call_ex= pr ( > } >=20 > // TODO: check types. actually, do so during semantic analysis > - Location locus =3D function_expr->get_locus_slow (); > + Location locus =3D function_expr->get_locus (); >=20 > return std::unique_ptr ( > new AST::CallExpr (std::move (function_expr), std::move (params), > @@ -14772,7 +14772,7 @@ Parser::parse_tuple_index_expr= _float ( > // get int from string > int index =3D atoi (index_str.c_str ()); >=20 > - Location locus =3D tuple_expr->get_locus_slow (); > + Location locus =3D tuple_expr->get_locus (); >=20 > return std::unique_ptr ( > new AST::TupleIndexExpr (std::move (tuple_expr), index, > diff --git a/gcc/rust/resolve/rust-ast-resolve-item.h b/gcc/rust/resolve/r= ust-ast-resolve-item.h > index bc05e93069c..d3c053b609f 100644 > --- a/gcc/rust/resolve/rust-ast-resolve-item.h > +++ b/gcc/rust/resolve/rust-ast-resolve-item.h > @@ -400,9 +400,9 @@ public: > auto Self > =3D CanonicalPath::get_big_self (impl_block.get_type ()->get_node_id= ()); >=20 > - resolver->get_type_scope ().insert ( > - Self, impl_block.get_type ()->get_node_id (), > - impl_block.get_type ()->get_locus_slow ()); > + resolver->get_type_scope ().insert (Self, > + impl_block.get_type ()->get_node_id (), > + impl_block.get_type ()->get_locus ()); >=20 > for (auto &impl_item : impl_block.get_impl_items ()) > { > @@ -519,9 +519,9 @@ public: > auto Self > =3D CanonicalPath::get_big_self (impl_block.get_type ()->get_node_id= ()); >=20 > - resolver->get_type_scope ().insert ( > - Self, impl_block.get_type ()->get_node_id (), > - impl_block.get_type ()->get_locus_slow ()); > + resolver->get_type_scope ().insert (Self, > + impl_block.get_type ()->get_node_id (), > + impl_block.get_type ()->get_locus ()); >=20 > for (auto &impl_item : impl_block.get_impl_items ()) > { > diff --git a/gcc/rust/resolve/rust-ast-resolve-type.h b/gcc/rust/resolve/r= ust-ast-resolve-type.h > index b8affe68c41..97c031199b3 100644 > --- a/gcc/rust/resolve/rust-ast-resolve-type.h > +++ b/gcc/rust/resolve/rust-ast-resolve-type.h > @@ -211,7 +211,7 @@ public: > // https://github.com/rust-lang/rust/blob/1f94abcda6884893d47233041020= 89198caa0839/compiler/rustc_resolve/src/lib.rs#L1722 > if (!resolver->get_type_scope ().lookup (canonical_path, &resolved_nod= e)) > { > - rust_error_at (path.get_locus_slow (), "failed to resolve TypePath: %= s", > + rust_error_at (path.get_locus (), "failed to resolve TypePath: %s", > canonical_path.get ().c_str ()); > return UNKNOWN_NODEID; > } > @@ -231,7 +231,7 @@ public: > ResolveType resolver (parent, canonicalize_type_with_generics); > type->accept_vis (resolver); > if (!resolver.ok) > - rust_error_at (type->get_locus_slow (), "unresolved type"); > + rust_error_at (type->get_locus (), "unresolved type"); >=20 > return resolver.resolved_node; > }; > @@ -311,7 +311,7 @@ public: > ResolveTypeBound resolver (parent, canonicalize_type_with_generics); > type->accept_vis (resolver); > if (!resolver.ok) > - rust_error_at (type->get_locus_slow (), "unresolved type bound"); > + rust_error_at (type->get_locus (), "unresolved type bound"); >=20 > return resolver.resolved_node; > }; > @@ -346,7 +346,7 @@ public: > ResolveGenericParam resolver (parent); > param->accept_vis (resolver); > if (!resolver.ok) > - rust_error_at (param->get_locus_slow (), "unresolved generic parame= ter"); > + rust_error_at (param->get_locus (), "unresolved generic parameter")= ; >=20 > return resolver.resolved_node; > }; > diff --git a/gcc/rust/resolve/rust-ast-verify-assignee.h b/gcc/rust/resolv= e/rust-ast-verify-assignee.h > index aed01196f81..9da3883220d 100644 > --- a/gcc/rust/resolve/rust-ast-verify-assignee.h > +++ b/gcc/rust/resolve/rust-ast-verify-assignee.h > @@ -35,7 +35,7 @@ public: > VerifyAsignee checker (parent); > assignee->accept_vis (checker); > if (!checker.ok) > - rust_error_at (assignee->get_locus_slow (), > + rust_error_at (assignee->get_locus (), > "invalid left-hand side of assignment"); > return checker.ok; > } > diff --git a/gcc/rust/typecheck/rust-hir-const-fold.h b/gcc/rust/typecheck= /rust-hir-const-fold.h > index 9e0450e8882..1bff7ef13b7 100644 > --- a/gcc/rust/typecheck/rust-hir-const-fold.h > +++ b/gcc/rust/typecheck/rust-hir-const-fold.h > @@ -211,7 +211,7 @@ public: > item.accept_vis (folder); > if (folder.ctx->get_backend ()->is_error_expression (folder.folded)) > { > - rust_error_at (item.get_locus_slow (), "non const value"); > + rust_error_at (item.get_locus (), "non const value"); > return nullptr; > } >=20 > @@ -240,7 +240,7 @@ public: > expr->accept_vis (folder); > if (folder.ctx->get_backend ()->is_error_expression (folder.folded)) > { > - rust_error_at (expr->get_locus_slow (), "non const value"); > + rust_error_at (expr->get_locus (), "non const value"); > return nullptr; > } >=20 > diff --git a/gcc/rust/typecheck/rust-hir-type-check-expr.h b/gcc/rust/type= check/rust-hir-type-check-expr.h > index a95a4e91c78..274451606cb 100644 > --- a/gcc/rust/typecheck/rust-hir-type-check-expr.h > +++ b/gcc/rust/typecheck/rust-hir-type-check-expr.h > @@ -49,8 +49,7 @@ public: >=20 > if (resolver.infered =3D=3D nullptr) > { > - rust_error_at (expr->get_locus_slow (), > - "failed to type resolve expression"); > + rust_error_at (expr->get_locus (), "failed to type resolve expression= "); > return new TyTy::ErrorType (expr->get_mappings ().get_hirid ()); > } >=20 > @@ -67,7 +66,7 @@ public: > =3D TypeCheckExpr::Resolve (expr.get_tuple_expr ().get (), inside_lo= op); > if (resolved =3D=3D nullptr) > { > - rust_error_at (expr.get_tuple_expr ()->get_locus_slow (), > + rust_error_at (expr.get_tuple_expr ()->get_locus (), > "failed to resolve TupleIndexExpr receiver"); > return; > } > @@ -76,7 +75,7 @@ public: > || resolved->get_kind () =3D=3D TyTy::TypeKind::TUPLE; > if (!is_valid_type) > { > - rust_error_at (expr.get_tuple_expr ()->get_locus_slow (), > + rust_error_at (expr.get_tuple_expr ()->get_locus (), > "Expected Tuple or ADT got: %s", > resolved->as_string ().c_str ()); > return; > @@ -203,7 +202,7 @@ public: > =3D TypeCheckExpr::Resolve (expr.get_receiver ().get (), false); > if (receiver_tyty =3D=3D nullptr) > { > - rust_error_at (expr.get_receiver ()->get_locus_slow (), > + rust_error_at (expr.get_receiver ()->get_locus (), > "failed to resolve receiver in MethodCallExpr"); > return; > } > @@ -771,7 +770,7 @@ public: > =3D size_ty->unify (TypeCheckExpr::Resolve (expr.get_index_expr (), f= alse)); > if (resolved_index_expr =3D=3D nullptr) > { > - rust_error_at (expr.get_index_expr ()->get_locus_slow (), > + rust_error_at (expr.get_index_expr ()->get_locus (), > "Type Resolver failure in Index for ArrayIndexExpr"); > return; > } > @@ -782,13 +781,13 @@ public: > expr.get_array_expr ()->accept_vis (*this); > if (infered =3D=3D nullptr) > { > - rust_error_at (expr.get_index_expr ()->get_locus_slow (), > + rust_error_at (expr.get_index_expr ()->get_locus (), > "failed to resolve array reference expression"); > return; > } > else if (infered->get_kind () !=3D TyTy::TypeKind::ARRAY) > { > - rust_error_at (expr.get_index_expr ()->get_locus_slow (), > + rust_error_at (expr.get_index_expr ()->get_locus (), > "expected an ArrayType got [%s]", > infered->as_string ().c_str ()); > infered =3D nullptr; > @@ -936,7 +935,7 @@ public: > =3D TypeCheckExpr::Resolve (expr.get_loop_block ().get (), true); > if (!block_expr->is_unit ()) > { > - rust_error_at (expr.get_loop_block ()->get_locus_slow (), > + rust_error_at (expr.get_loop_block ()->get_locus (), > "expected %<()%> got %s", > block_expr->as_string ().c_str ()); > return; > @@ -965,7 +964,7 @@ public: >=20 > if (!block_expr->is_unit ()) > { > - rust_error_at (expr.get_loop_block ()->get_locus_slow (), > + rust_error_at (expr.get_loop_block ()->get_locus (), > "expected %<()%> got %s", > block_expr->as_string ().c_str ()); > return; > diff --git a/gcc/rust/typecheck/rust-hir-type-check-type.h b/gcc/rust/type= check/rust-hir-type-check-type.h > index fff86beaa27..0cc1cfb3d40 100644 > --- a/gcc/rust/typecheck/rust-hir-type-check-type.h > +++ b/gcc/rust/typecheck/rust-hir-type-check-type.h > @@ -257,7 +257,7 @@ public: >=20 > if (resolver.resolved =3D=3D nullptr) > { > - rust_error_at (param->get_locus_slow (), > + rust_error_at (param->get_locus (), > "failed to setup generic parameter"); > return nullptr; > } > diff --git a/gcc/rust/typecheck/rust-hir-type-check.cc b/gcc/rust/typechec= k/rust-hir-type-check.cc > index 4b66fdbd6e6..7f0e0ffdb30 100644 > --- a/gcc/rust/typecheck/rust-hir-type-check.cc > +++ b/gcc/rust/typecheck/rust-hir-type-check.cc > @@ -97,7 +97,7 @@ TypeCheckExpr::visit (HIR::BlockExpr &expr) > auto resolved =3D TypeCheckStmt::Resolve (s, inside_loop); > if (resolved =3D=3D nullptr) > { > - rust_error_at (s->get_locus_slow (), "failure to resolve type"); > + rust_error_at (s->get_locus (), "failure to resolve type"); > return false; > } >=20 > @@ -145,9 +145,8 @@ TypeCheckStructExpr::visit (HIR::StructExprStructField= s &struct_expr) > =3D (TyTy::ADTType *) struct_path_resolved->unify (base_resolved); > if (struct_def =3D=3D nullptr) > { > - rust_fatal_error ( > - struct_expr.struct_base->base_struct->get_locus_slow (), > - "incompatible types for base struct reference"); > + rust_fatal_error (struct_expr.struct_base->base_struct->get_locus (= ), > + "incompatible types for base struct reference"); > return; > } > } > @@ -229,11 +228,11 @@ TypeCheckStructExpr::visit (HIR::StructExprStructFie= lds &struct_expr) > HIR::Expr *field_value =3D new HIR::FieldAccessExpr ( > mapping, std::unique_ptr (receiver), missing, > std::move (outer_attribs), > - struct_expr.struct_base->base_struct->get_locus_slow ()); > + struct_expr.struct_base->base_struct->get_locus ()); >=20 > implicit_field =3D new HIR::StructExprFieldIdentifierValue ( > mapping, missing, std::unique_ptr (field_value), > - struct_expr.struct_base->base_struct->get_locus_slow ()); > + struct_expr.struct_base->base_struct->get_locus ()); >=20 > size_t field_index; > bool ok =3D struct_path_resolved->get_field (missing, &field_inde= x); > diff --git a/gcc/rust/typecheck/rust-tyty.cc b/gcc/rust/typecheck/rust-tyt= y.cc > index 56fdafd7919..e449b55f41e 100644 > --- a/gcc/rust/typecheck/rust-tyty.cc > +++ b/gcc/rust/typecheck/rust-tyty.cc > @@ -2207,7 +2207,7 @@ TypeCheckCallExpr::visit (ADTType &type) > BaseType *arg =3D Resolver::TypeCheckExpr::Resolve (p, false); > if (arg =3D=3D nullptr) > { > - rust_error_at (p->get_locus_slow (), "failed to resolve argument type= "); > + rust_error_at (p->get_locus (), "failed to resolve argument type"); > return false; > } >=20 > @@ -2262,7 +2262,7 @@ TypeCheckCallExpr::visit (FnType &type) > auto argument_expr_tyty =3D Resolver::TypeCheckExpr::Resolve (param, f= alse); > if (argument_expr_tyty =3D=3D nullptr) > { > - rust_error_at (param->get_locus_slow (), > + rust_error_at (param->get_locus (), > "failed to resolve type for argument expr in CallExpr"); > return false; > } > @@ -2276,7 +2276,7 @@ TypeCheckCallExpr::visit (FnType &type) > resolved_argument_type =3D fnparam.second->unify (argument_expr_tyty); > if (resolved_argument_type =3D=3D nullptr) > { > - rust_error_at (param->get_locus_slow (), > + rust_error_at (param->get_locus (), > "Type Resolution failure on parameter"); > return false; > } > @@ -2327,7 +2327,7 @@ TypeCheckCallExpr::visit (FnPtr &type) > auto argument_expr_tyty =3D Resolver::TypeCheckExpr::Resolve (param, f= alse); > if (argument_expr_tyty =3D=3D nullptr) > { > - rust_error_at (param->get_locus_slow (), > + rust_error_at (param->get_locus (), > "failed to resolve type for argument expr in CallExpr"); > return false; > } > @@ -2335,7 +2335,7 @@ TypeCheckCallExpr::visit (FnPtr &type) > auto resolved_argument_type =3D fnparam->unify (argument_expr_tyty); > if (resolved_argument_type =3D=3D nullptr) > { > - rust_error_at (param->get_locus_slow (), > + rust_error_at (param->get_locus (), > "Type Resolution failure on parameter"); > return false; > } > @@ -2378,7 +2378,7 @@ TypeCheckMethodCallExpr::visit (FnType &type) > auto argument_expr_tyty =3D Resolver::TypeCheckExpr::Resolve (param, f= alse); > if (argument_expr_tyty =3D=3D nullptr) > { > - rust_error_at (param->get_locus_slow (), > + rust_error_at (param->get_locus (), > "failed to resolve type for argument expr in CallExpr"); > return false; > } > @@ -2386,7 +2386,7 @@ TypeCheckMethodCallExpr::visit (FnType &type) > auto resolved_argument_type =3D fnparam.second->unify (argument_expr_t= yty); > if (resolved_argument_type =3D=3D nullptr) > { > - rust_error_at (param->get_locus_slow (), > + rust_error_at (param->get_locus (), > "Type Resolution failure on parameter"); > return false; > } > diff --git a/gcc/rust/util/rust-hir-map.cc b/gcc/rust/util/rust-hir-map.cc= > index d544042b344..deade08db37 100644 > --- a/gcc/rust/util/rust-hir-map.cc > +++ b/gcc/rust/util/rust-hir-map.cc > @@ -380,7 +380,7 @@ Mappings::insert_hir_expr (CrateNum crateNum, HirId id= , HIR::Expr *expr) > { > hirExprMappings[crateNum][id] =3D expr; > nodeIdToHirMappings[crateNum][expr->get_mappings ().get_nodeid ()] =3D i= d; > - insert_location (crateNum, id, expr->get_locus_slow ()); > + insert_location (crateNum, id, expr->get_locus ()); > } >=20 > HIR::Expr * > @@ -430,7 +430,7 @@ Mappings::insert_hir_generic_param (CrateNum crateNum,= HirId id, >=20 > hirGenericParamMappings[crateNum][id] =3D param; > nodeIdToHirMappings[crateNum][param->get_mappings ().get_nodeid ()] =3D i= d; > - insert_location (crateNum, id, param->get_locus_slow ()); > + insert_location (crateNum, id, param->get_locus ()); > } >=20 > HIR::GenericParam * > --=20 > 2.32.0 >=20 > --=20 > Gcc-rust mailing list > Gcc-rust@gcc.gnu.org > https://gcc.gnu.org/mailman/listinfo/gcc-rust