public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-7797] gccrs: Replace some more usages of Location with location_t
@ 2024-01-16 17:59 Arthur Cohen
  0 siblings, 0 replies; only message in thread
From: Arthur Cohen @ 2024-01-16 17:59 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:df1da36415bb15919551f1b813443057263fc187

commit r14-7797-gdf1da36415bb15919551f1b813443057263fc187
Author: Owen Avery <powerboat9.gamer@gmail.com>
Date:   Mon Jul 10 15:56:31 2023 -0400

    gccrs: Replace some more usages of Location with location_t
    
    gcc/rust/ChangeLog:
    
            * ast/rust-ast.h: Replace Location with location_t.
            * ast/rust-expr.h: Likewise.
            * ast/rust-item.h: Likewise.
            * ast/rust-macro.h: Likewise.
            * ast/rust-path.h: Likewise.
            * ast/rust-pattern.h: Likewise.
            * ast/rust-stmt.h: Likewise.
            * ast/rust-type.h: Likewise.
            * hir/rust-ast-lower-base.h: Likewise.
            * hir/tree/rust-hir-expr.h: Likewise.
            * hir/tree/rust-hir-item.h: Likewise.
            * hir/tree/rust-hir-path.h: Likewise.
            * hir/tree/rust-hir-pattern.h: Likewise.
            * hir/tree/rust-hir-stmt.h: Likewise.
            * hir/tree/rust-hir-type.h: Likewise.
            * hir/tree/rust-hir.h: Likewise.
            * lex/rust-token.h: Likewise.
            * resolve/rust-ast-resolve-pattern.h: Likewise.
            * typecheck/rust-hir-trait-reference.h: Likewise.
            * typecheck/rust-tyty-bounds.h: Likewise.
            * typecheck/rust-tyty-call.h: Likewise.
            * typecheck/rust-tyty-subst.h: Likewise.
            * typecheck/rust-tyty-util.h: Likewise.
            * typecheck/rust-tyty.h: Likewise.
    
    Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>

Diff:
---
 gcc/rust/ast/rust-ast.h                       | 34 +++++++-------
 gcc/rust/ast/rust-expr.h                      | 66 +++++++++++++--------------
 gcc/rust/ast/rust-item.h                      | 62 ++++++++++++-------------
 gcc/rust/ast/rust-macro.h                     | 20 ++++----
 gcc/rust/ast/rust-path.h                      | 24 +++++-----
 gcc/rust/ast/rust-pattern.h                   | 32 ++++++-------
 gcc/rust/ast/rust-stmt.h                      |  6 +--
 gcc/rust/ast/rust-type.h                      | 30 ++++++------
 gcc/rust/hir/rust-ast-lower-base.h            |  2 +-
 gcc/rust/hir/tree/rust-hir-expr.h             | 58 +++++++++++------------
 gcc/rust/hir/tree/rust-hir-item.h             | 50 ++++++++++----------
 gcc/rust/hir/tree/rust-hir-path.h             | 16 +++----
 gcc/rust/hir/tree/rust-hir-pattern.h          | 28 ++++++------
 gcc/rust/hir/tree/rust-hir-stmt.h             |  6 +--
 gcc/rust/hir/tree/rust-hir-type.h             |  4 +-
 gcc/rust/hir/tree/rust-hir.h                  | 20 ++++----
 gcc/rust/lex/rust-token.h                     |  2 +-
 gcc/rust/resolve/rust-ast-resolve-pattern.h   |  2 +-
 gcc/rust/typecheck/rust-hir-trait-reference.h |  4 +-
 gcc/rust/typecheck/rust-tyty-bounds.h         |  2 +-
 gcc/rust/typecheck/rust-tyty-call.h           |  2 +-
 gcc/rust/typecheck/rust-tyty-subst.h          |  2 +-
 gcc/rust/typecheck/rust-tyty-util.h           |  2 +-
 gcc/rust/typecheck/rust-tyty.h                |  6 +--
 24 files changed, 240 insertions(+), 240 deletions(-)

diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h
index bd6a06e3710..7989bbe13c1 100644
--- a/gcc/rust/ast/rust-ast.h
+++ b/gcc/rust/ast/rust-ast.h
@@ -58,7 +58,7 @@ public:
   Identifier &operator= (Identifier &&) = default;
 
   NodeId get_node_id () const { return node_id; }
-  Location get_locus () const { return loc; }
+  location_t get_locus () const { return loc; }
   const std::string &as_string () const { return ident; }
 
   bool empty () const { return ident.empty (); }
@@ -274,7 +274,7 @@ public:
   TokenId get_id () const { return tok_ref->get_id (); }
   const std::string &get_str () const { return tok_ref->get_str (); }
 
-  Location get_locus () const { return tok_ref->get_locus (); }
+  location_t get_locus () const { return tok_ref->get_locus (); }
 
   PrimitiveCoreType get_type_hint () const { return tok_ref->get_type_hint (); }
 
@@ -393,7 +393,7 @@ public:
 
   std::string as_string () const override;
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
   NodeId get_node_id () const { return node_id; }
   const std::string &get_segment_name () const { return segment_name; }
   bool is_super_path_seg () const
@@ -442,7 +442,7 @@ public:
     return opening_scope_resolution;
   }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
   NodeId get_node_id () const { return node_id; }
 
   // does this need visitor if not polymorphic? probably not
@@ -543,7 +543,7 @@ public:
   // Returns whether the attribute is considered an "empty" attribute.
   bool is_empty () const { return attr_input == nullptr && path.is_empty (); }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   AttrInput &get_attr_input () const { return *attr_input; }
 
@@ -689,7 +689,7 @@ public:
 
   virtual ~MetaItemInner ();
 
-  virtual Location get_locus () const = 0;
+  virtual location_t get_locus () const = 0;
 
   virtual std::string as_string () const = 0;
 
@@ -945,7 +945,7 @@ public:
 
   virtual std::string as_string () const = 0;
 
-  virtual Location get_locus () const = 0;
+  virtual location_t get_locus () const = 0;
 
   virtual void mark_for_strip () = 0;
   virtual bool is_marked_for_strip () const = 0;
@@ -1027,7 +1027,7 @@ public:
 
   virtual ~Expr () {}
 
-  virtual Location get_locus () const = 0;
+  virtual location_t get_locus () const = 0;
 
   virtual bool is_literal () const { return false; }
 
@@ -1102,7 +1102,7 @@ public:
 
   std::string as_string () const override { return ident.as_string (); }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   Identifier get_ident () const { return ident; }
 
@@ -1161,7 +1161,7 @@ public:
   virtual void mark_for_strip () {}
   virtual bool is_marked_for_strip () const { return false; }
 
-  virtual Location get_locus () const = 0;
+  virtual location_t get_locus () const = 0;
   virtual NodeId get_pattern_node_id () const = 0;
 
 protected:
@@ -1197,7 +1197,7 @@ public:
   virtual void mark_for_strip () {}
   virtual bool is_marked_for_strip () const { return false; }
 
-  virtual Location get_locus () const = 0;
+  virtual location_t get_locus () const = 0;
 
   NodeId get_node_id () const { return node_id; }
 
@@ -1252,7 +1252,7 @@ public:
 
   NodeId get_node_id () const { return node_id; }
 
-  virtual Location get_locus () const = 0;
+  virtual location_t get_locus () const = 0;
 
 protected:
   // Clone function implementation as pure virtual method
@@ -1309,7 +1309,7 @@ public:
 
   LifetimeType get_lifetime_type () { return lifetime_type; }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   std::string get_lifetime_name () const { return lifetime_name; }
 
@@ -1344,7 +1344,7 @@ public:
 
   virtual std::string as_string () const = 0;
 
-  virtual Location get_locus () const = 0;
+  virtual location_t get_locus () const = 0;
 
   virtual Kind get_kind () const = 0;
 
@@ -1401,7 +1401,7 @@ public:
 
   void accept_vis (ASTVisitor &vis) override;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   Kind get_kind () const override final { return Kind::Lifetime; }
 
@@ -1443,7 +1443,7 @@ public:
   virtual bool is_marked_for_strip () const = 0;
 
   NodeId get_node_id () const { return node_id; }
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 };
 
 /* Abstract base class for items used within an inherent impl block (the impl
@@ -1468,7 +1468,7 @@ public:
   virtual void mark_for_strip () = 0;
   virtual bool is_marked_for_strip () const = 0;
 
-  virtual Location get_locus () const = 0;
+  virtual location_t get_locus () const = 0;
 };
 
 // Abstract base class for items used in a trait impl
diff --git a/gcc/rust/ast/rust-expr.h b/gcc/rust/ast/rust-expr.h
index c8362504113..63c7d107961 100644
--- a/gcc/rust/ast/rust-expr.h
+++ b/gcc/rust/ast/rust-expr.h
@@ -65,7 +65,7 @@ public:
     return std::unique_ptr<LiteralExpr> (clone_literal_expr_impl ());
   }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   bool is_literal () const override final { return true; }
 
@@ -192,7 +192,7 @@ public:
 
   std::string as_string () const override { return lit_expr.as_string (); }
 
-  Location get_locus () const override { return lit_expr.get_locus (); }
+  location_t get_locus () const override { return lit_expr.get_locus (); }
 
   LiteralExpr get_literal () const { return lit_expr; }
 
@@ -232,7 +232,7 @@ public:
   //  we have no idea use which of them, just simply return UNKNOWN_LOCATION
   //  now.
   // Maybe we will figure out when we really need the location in the future.
-  Location get_locus () const override { return UNKNOWN_LOCATION; }
+  location_t get_locus () const override { return UNKNOWN_LOCATION; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -301,7 +301,7 @@ protected:
   OperatorExpr &operator= (OperatorExpr &&other) = default;
 
 public:
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   // Invalid if expr is null, so base stripping on that.
   void mark_for_strip () override { main_or_left_expr = nullptr; }
@@ -953,7 +953,7 @@ public:
   GroupedExpr (GroupedExpr &&other) = default;
   GroupedExpr &operator= (GroupedExpr &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -1185,7 +1185,7 @@ public:
   ArrayExpr (ArrayExpr &&other) = default;
   ArrayExpr &operator= (ArrayExpr &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -1268,7 +1268,7 @@ public:
   ArrayIndexExpr (ArrayIndexExpr &&other) = default;
   ArrayIndexExpr &operator= (ArrayIndexExpr &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -1381,7 +1381,7 @@ public:
   /* Note: syntactically, can disambiguate single-element tuple from parens with
    * comma, i.e. (0,) rather than (0) */
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -1465,7 +1465,7 @@ public:
   TupleIndexExpr (TupleIndexExpr &&other) = default;
   TupleIndexExpr &operator= (TupleIndexExpr &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -1554,7 +1554,7 @@ public:
       inner_attrs (std::move (inner_attribs)), locus (locus)
   {}
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -1641,7 +1641,7 @@ public:
 
   virtual void accept_vis (ASTVisitor &vis) = 0;
 
-  virtual Location get_locus () const = 0;
+  virtual location_t get_locus () const = 0;
 
   NodeId get_node_id () const { return node_id; }
 
@@ -1669,7 +1669,7 @@ public:
 
   std::string as_string () const override { return field_name.as_string (); }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -1743,7 +1743,7 @@ public:
 
   std::string get_field_name () const { return field_name.as_string (); }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
 protected:
   /* Use covariance to implement clone function as returning this object rather
@@ -1774,7 +1774,7 @@ public:
 
   TupleIndex get_index () const { return index; }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
 protected:
   /* Use covariance to implement clone function as returning this object rather
@@ -1958,7 +1958,7 @@ public:
   // Returns whether function call has parameters.
   bool has_params () const { return !params.empty (); }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -2058,7 +2058,7 @@ public:
   MethodCallExpr (MethodCallExpr &&other) = default;
   MethodCallExpr &operator= (MethodCallExpr &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -2151,7 +2151,7 @@ public:
   FieldAccessExpr (FieldAccessExpr &&other) = default;
   FieldAccessExpr &operator= (FieldAccessExpr &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -2269,7 +2269,7 @@ public:
     return type;
   }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 };
 
 // Base closure definition expression AST node - abstract
@@ -2290,7 +2290,7 @@ protected:
 public:
   std::string as_string () const override;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   // TODO: this mutable getter seems really dodgy. Think up better way.
   const std::vector<ClosureParam> &get_params () const { return params; }
@@ -2458,7 +2458,7 @@ public:
     return std::unique_ptr<BlockExpr> (clone_block_expr_impl ());
   }
 
-  Location get_locus () const override final { return start_locus; }
+  location_t get_locus () const override final { return start_locus; }
 
   Location get_start_locus () const { return start_locus; }
   Location get_end_locus () const { return end_locus; }
@@ -2643,7 +2643,7 @@ public:
       locus (locus)
   {}
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -2732,7 +2732,7 @@ public:
   BreakExpr (BreakExpr &&other) = default;
   BreakExpr &operator= (BreakExpr &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -2776,7 +2776,7 @@ protected:
   RangeExpr (location_t locus) : locus (locus) {}
 
 public:
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   std::vector<Attribute> &get_outer_attrs () override final
   {
@@ -3228,7 +3228,7 @@ public:
   ReturnExpr (ReturnExpr &&other) = default;
   ReturnExpr &operator= (ReturnExpr &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -3310,7 +3310,7 @@ public:
   UnsafeBlockExpr (UnsafeBlockExpr &&other) = default;
   UnsafeBlockExpr &operator= (UnsafeBlockExpr &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -3365,7 +3365,7 @@ public:
   // Creates an error state LoopLabel.
   static LoopLabel error () { return LoopLabel (Lifetime::error ()); }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   Lifetime &get_lifetime () { return label; }
 
@@ -3431,7 +3431,7 @@ public:
 
   LoopLabel &get_loop_label () { return loop_label; }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   // Invalid if loop block is null, so base stripping on that.
   void mark_for_strip () override { loop_block = nullptr; }
@@ -3755,7 +3755,7 @@ public:
    * vector of else ifs - i.e. not like a switch statement. TODO - is this a
    * better approach? or does it not parse correctly and have downsides? */
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -3936,7 +3936,7 @@ public:
     return std::unique_ptr<IfLetExpr> (clone_if_let_expr_impl ());
   }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -4155,7 +4155,7 @@ public:
     return match_arm_patterns;
   }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 };
 
 /* A "match case" - a correlated match arm and resulting expression. Not
@@ -4271,7 +4271,7 @@ public:
   MatchExpr (MatchExpr &&other) = default;
   MatchExpr &operator= (MatchExpr &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -4357,7 +4357,7 @@ public:
 
   std::string as_string () const override;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -4439,7 +4439,7 @@ public:
   std::string as_string () const override;
 
   bool get_has_move () { return has_move; }
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
diff --git a/gcc/rust/ast/rust-item.h b/gcc/rust/ast/rust-item.h
index d385798dedc..365b20b903a 100644
--- a/gcc/rust/ast/rust-item.h
+++ b/gcc/rust/ast/rust-item.h
@@ -130,7 +130,7 @@ public:
 
   std::string as_string () const override;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   Kind get_kind () const override final { return Kind::Type; }
 
@@ -213,7 +213,7 @@ public:
 
   std::vector<Lifetime> &get_lifetime_bounds () { return lifetime_bounds; }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
 protected:
   // Clone function implementation as (not pure) virtual method
@@ -304,7 +304,7 @@ public:
 
   NodeId get_node_id () const override final { return node_id; }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
 protected:
   // Clone function implementation as (not pure) virtual method
@@ -466,7 +466,7 @@ public:
 
   std::string as_string () const;
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   bool get_has_ref () const { return has_ref; };
   bool get_is_mut () const { return is_mut; }
@@ -515,7 +515,7 @@ public:
   std::string get_extern_abi () const { return extern_abi; }
   bool has_abi () const { return !extern_abi.empty (); }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 };
 
 // A function parameter
@@ -580,7 +580,7 @@ public:
 
   std::string as_string () const;
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   // TODO: seems kinda dodgy. Think of better way.
   std::vector<Attribute> &get_outer_attrs () { return outer_attrs; }
@@ -647,7 +647,7 @@ public:
   // Returns whether visibility is public or not.
   bool is_public () const { return vis_type != PRIV && !is_error (); }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   // empty?
   // Creates an error visibility.
@@ -913,7 +913,7 @@ public:
 
   NodeId get_node_id () const { return node_id; }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   FunctionQualifiers get_qualifiers () { return qualifiers; }
 
@@ -1134,7 +1134,7 @@ public:
 
   std::string as_string () const override;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   // Invalid if name is empty, so base stripping on that.
   void mark_for_strip () override { module_name = {""}; }
@@ -1181,7 +1181,7 @@ public:
       as_clause_name (std::move (as_clause_name)), locus (locus)
   {}
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -1248,7 +1248,7 @@ public:
   virtual std::string as_string () const = 0;
   virtual Kind get_kind () const = 0;
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   virtual void accept_vis (ASTVisitor &vis) = 0;
 
@@ -1520,7 +1520,7 @@ public:
   UseDeclaration (UseDeclaration &&other) = default;
   UseDeclaration &operator= (UseDeclaration &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   std::unique_ptr<UseTree> &get_tree () { return use_tree; }
 
@@ -1649,7 +1649,7 @@ public:
   Function (Function &&other) = default;
   Function &operator= (Function &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -1795,7 +1795,7 @@ public:
   TypeAlias (TypeAlias &&other) = default;
   TypeAlias &operator= (TypeAlias &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -1864,7 +1864,7 @@ public:
   // Returns whether struct has a where clause.
   bool has_where_clause () const { return !where_clause.is_empty (); }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   // Invalid if name is empty, so base stripping on that.
   void mark_for_strip () override { struct_name = {""}; }
@@ -2014,7 +2014,7 @@ public:
 
   Identifier get_field_name () const { return field_name; }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   // TODO: is this better? Or is a "vis_block" better?
   std::unique_ptr<Type> &get_field_type ()
@@ -2161,7 +2161,7 @@ public:
   Visibility &get_visibility () { return visibility; }
   const Visibility &get_visibility () const { return visibility; }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   // TODO: this mutable getter seems really dodgy. Think up better way.
   std::vector<Attribute> &get_outer_attrs () { return outer_attrs; }
@@ -2238,7 +2238,7 @@ public:
   // not pure virtual as not abstract
   virtual void accept_vis (ASTVisitor &vis) override;
 
-  Location get_locus () const override { return locus; }
+  location_t get_locus () const override { return locus; }
 
   Identifier get_identifier () const { return variant_name; }
 
@@ -2457,7 +2457,7 @@ public:
   Enum (Enum &&other) = default;
   Enum &operator= (Enum &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -2559,7 +2559,7 @@ public:
   Union (Union &&other) = default;
   Union &operator= (Union &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -2656,7 +2656,7 @@ public:
    * as identifier) constant. */
   bool is_unnamed () const { return identifier == "_"; }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -2770,7 +2770,7 @@ public:
   StaticItem (StaticItem &&other) = default;
   StaticItem &operator= (StaticItem &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -3305,7 +3305,7 @@ public:
 
   std::string as_string () const override;
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -3532,7 +3532,7 @@ public:
   Trait (Trait &&other) = default;
   Trait &operator= (Trait &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -3625,7 +3625,7 @@ public:
   // Returns whether impl has inner attributes.
   bool has_inner_attrs () const { return !inner_attrs.empty (); }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   // Invalid if trait type is null, so base stripping on that.
   void mark_for_strip () override { trait_type = nullptr; }
@@ -3897,7 +3897,7 @@ public:
 
   virtual std::string as_string () const;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   virtual void accept_vis (ASTVisitor &vis) = 0;
 
@@ -3995,7 +3995,7 @@ public:
   // Returns whether item has non-default visibility.
   bool has_visibility () const { return !visibility.is_error (); }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   void mark_for_strip () override { marked_for_strip = true; };
   bool is_marked_for_strip () const override { return marked_for_strip; };
@@ -4086,7 +4086,7 @@ public:
   // Returns whether item has non-default visibility.
   bool has_visibility () const { return !visibility.is_error (); }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   // Based on idea that type should never be null.
   void mark_for_strip () override { item_type = nullptr; };
@@ -4150,7 +4150,7 @@ public:
 
   std::string get_name () const { return name; }
 
-  Location get_locus () { return locus; }
+  location_t get_locus () { return locus; }
 
   // Creates an error state named function parameter.
   static NamedFunctionParam create_error ()
@@ -4270,7 +4270,7 @@ public:
     return !variadic_outer_attrs.empty ();
   }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   Visibility &get_visibility () { return visibility; }
   const Visibility &get_visibility () const { return visibility; }
@@ -4465,7 +4465,7 @@ public:
   ExternBlock (ExternBlock &&other) = default;
   ExternBlock &operator= (ExternBlock &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
diff --git a/gcc/rust/ast/rust-macro.h b/gcc/rust/ast/rust-macro.h
index b416208e09e..c63b480de61 100644
--- a/gcc/rust/ast/rust-macro.h
+++ b/gcc/rust/ast/rust-macro.h
@@ -405,7 +405,7 @@ public:
 
   std::string as_string () const { return token_tree.as_string (); }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   DelimTokenTree &get_token_tree () { return token_tree; }
   const DelimTokenTree &get_token_tree () const { return token_tree; }
@@ -438,7 +438,7 @@ public:
 		      locus);
   }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   std::string as_string () const;
 
@@ -552,7 +552,7 @@ public:
   std::vector<MacroRule> &get_macro_rules () { return rules; }
   const std::vector<MacroRule> &get_macro_rules () const { return rules; }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   Identifier get_rule_name () const { return rule_name; }
 
@@ -646,7 +646,7 @@ public:
 			   std::move (pending_eager_invocations)));
   }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -838,7 +838,7 @@ public:
     return path;
   }
 
-  Location get_locus () const override { return path.get_locus (); }
+  location_t get_locus () const override { return path.get_locus (); }
 
   bool check_cfg_predicate (const Session &session) const override;
 
@@ -896,7 +896,7 @@ public:
 
   void accept_vis (ASTVisitor &vis) override;
 
-  Location get_locus () const override { return path.get_locus (); }
+  location_t get_locus () const override { return path.get_locus (); }
 
   bool check_cfg_predicate (const Session &session) const override;
 
@@ -927,7 +927,7 @@ public:
 
   Identifier get_ident () const { return ident; }
 
-  Location get_locus () const override { return ident_locus; }
+  location_t get_locus () const override { return ident_locus; }
 
   bool check_cfg_predicate (const Session &session) const override;
 
@@ -971,7 +971,7 @@ public:
     return std::unique_ptr<MetaNameValueStr> (clone_meta_item_inner_impl ());
   }
 
-  Location get_locus () const override { return ident_locus; }
+  location_t get_locus () const override { return ident_locus; }
 
   bool check_cfg_predicate (const Session &session) const override;
 
@@ -1015,7 +1015,7 @@ public:
 
   std::vector<SimplePath> &get_paths () { return paths; };
 
-  Location get_locus () const override { return ident_locus; }
+  location_t get_locus () const override { return ident_locus; }
 
   bool check_cfg_predicate (const Session &session) const override;
 
@@ -1055,7 +1055,7 @@ public:
 
   std::vector<MetaNameValueStr> &get_values () { return strs; }
 
-  Location get_locus () const override { return ident_locus; }
+  location_t get_locus () const override { return ident_locus; }
 
   bool check_cfg_predicate (const Session &session) const override;
 
diff --git a/gcc/rust/ast/rust-path.h b/gcc/rust/ast/rust-path.h
index 7f14a3fddf6..d70789c4c90 100644
--- a/gcc/rust/ast/rust-path.h
+++ b/gcc/rust/ast/rust-path.h
@@ -50,7 +50,7 @@ public:
 
   std::string as_string () const { return segment_name; }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   bool is_super_segment () const { return as_string ().compare ("super") == 0; }
   bool is_crate_segment () const { return as_string ().compare ("crate") == 0; }
@@ -126,7 +126,7 @@ public:
     return type;
   }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   Identifier get_identifier () const { return identifier; }
 };
@@ -375,7 +375,7 @@ public:
 
   void accept_vis (ASTVisitor &vis) override;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   Kind get_kind () const override final { return Kind::Const; }
 
@@ -462,7 +462,7 @@ public:
 
   std::vector<Lifetime> &get_lifetime_args () { return lifetime_args; };
 
-  Location get_locus () { return locus; }
+  location_t get_locus () { return locus; }
 };
 
 /* A segment of a path in expression, including an identifier aspect and maybe
@@ -511,7 +511,7 @@ public:
 
   std::string as_string () const;
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   // TODO: is this better? Or is a "vis_pattern" better?
   GenericArgs &get_generic_args ()
@@ -621,7 +621,7 @@ public:
     return convert_to_simple_path (has_opening_scope_resolution);
   }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -752,7 +752,7 @@ public:
    * function). Overridden in derived classes with other segments. */
   virtual bool is_ident_only () const { return true; }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   // not pure virtual as class not abstract
   virtual void accept_vis (ASTVisitor &vis);
@@ -952,7 +952,7 @@ public:
     return return_type;
   }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 };
 
 // Segment used in type path with a function argument
@@ -1080,7 +1080,7 @@ public:
   // Creates a trait bound with a clone of this type path as its only element.
   TraitBound *to_trait_bound (bool in_parens) const override;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -1162,7 +1162,7 @@ public:
 
   std::string as_string () const;
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   // TODO: is this better? Or is a "vis_pattern" better?
   std::unique_ptr<Type> &get_type ()
@@ -1216,7 +1216,7 @@ public:
 				      {}, UNDEF_LOCATION);
   }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -1366,7 +1366,7 @@ public:
     return segments;
   }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 };
 } // namespace AST
 } // namespace Rust
diff --git a/gcc/rust/ast/rust-pattern.h b/gcc/rust/ast/rust-pattern.h
index d35fbce88f3..95655f5c097 100644
--- a/gcc/rust/ast/rust-pattern.h
+++ b/gcc/rust/ast/rust-pattern.h
@@ -45,7 +45,7 @@ public:
       node_id (Analysis::Mappings::get ()->get_next_node_id ())
   {}
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -133,7 +133,7 @@ public:
   IdentifierPattern (IdentifierPattern &&other) = default;
   IdentifierPattern &operator= (IdentifierPattern &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -175,7 +175,7 @@ public:
     : locus (locus), node_id (Analysis::Mappings::get ()->get_next_node_id ())
   {}
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -204,7 +204,7 @@ public:
     : locus (locus), node_id (Analysis::Mappings::get ()->get_next_node_id ())
   {}
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -273,7 +273,7 @@ public:
 
   bool get_has_minus () const { return has_minus; }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -304,7 +304,7 @@ public:
 
   std::string as_string () const override { return path.as_string (); }
 
-  Location get_locus () const { return path.get_locus (); }
+  location_t get_locus () const { return path.get_locus (); }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -341,7 +341,7 @@ public:
 
   std::string as_string () const override { return path.as_string (); }
 
-  Location get_locus () const { return path.get_locus (); }
+  location_t get_locus () const { return path.get_locus (); }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -412,7 +412,7 @@ public:
   RangePattern (RangePattern &&other) = default;
   RangePattern &operator= (RangePattern &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   bool get_has_ellipsis_syntax () { return has_ellipsis_syntax; }
 
@@ -490,7 +490,7 @@ public:
   ReferencePattern (ReferencePattern &&other) = default;
   ReferencePattern &operator= (ReferencePattern &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -568,7 +568,7 @@ public:
 
   virtual std::string as_string () const;
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   virtual void accept_vis (ASTVisitor &vis) = 0;
 
@@ -928,7 +928,7 @@ public:
    * is empty). */
   bool has_struct_pattern_elems () const { return !elems.is_empty (); }
 
-  Location get_locus () const override { return path.get_locus (); }
+  location_t get_locus () const override { return path.get_locus (); }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -1172,7 +1172,7 @@ public:
   TupleStructPattern (TupleStructPattern &&other) = default;
   TupleStructPattern &operator= (TupleStructPattern &&other) = default;
 
-  Location get_locus () const override { return path.get_locus (); }
+  location_t get_locus () const override { return path.get_locus (); }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -1417,7 +1417,7 @@ public:
     return *this;
   }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -1479,7 +1479,7 @@ public:
   GroupedPattern (GroupedPattern &&other) = default;
   GroupedPattern &operator= (GroupedPattern &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -1545,7 +1545,7 @@ public:
   SlicePattern (SlicePattern &&other) = default;
   SlicePattern &operator= (SlicePattern &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -1612,7 +1612,7 @@ public:
   AltPattern (AltPattern &&other) = default;
   AltPattern &operator= (AltPattern &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
diff --git a/gcc/rust/ast/rust-stmt.h b/gcc/rust/ast/rust-stmt.h
index e5b90b0a126..b332425316c 100644
--- a/gcc/rust/ast/rust-stmt.h
+++ b/gcc/rust/ast/rust-stmt.h
@@ -38,7 +38,7 @@ public:
 
   EmptyStmt (location_t locus) : locus (locus) {}
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -139,7 +139,7 @@ public:
   LetStmt (LetStmt &&other) = default;
   LetStmt &operator= (LetStmt &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -190,7 +190,7 @@ class ExprStmt : public Stmt
   bool semicolon_followed;
 
 public:
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   bool is_item () const override final { return false; }
 
diff --git a/gcc/rust/ast/rust-type.h b/gcc/rust/ast/rust-type.h
index 49028334efd..1637367791c 100644
--- a/gcc/rust/ast/rust-type.h
+++ b/gcc/rust/ast/rust-type.h
@@ -70,7 +70,7 @@ public:
 
   std::string as_string () const override;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -144,7 +144,7 @@ public:
 
   std::string as_string () const override;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -210,7 +210,7 @@ public:
 
   std::string as_string () const override;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -280,7 +280,7 @@ public:
     return type_in_parens->to_trait_bound (true);
   }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -313,7 +313,7 @@ public:
 
   std::string as_string () const override;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -358,7 +358,7 @@ public:
     return new TraitBound (trait_bound);
   }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -415,7 +415,7 @@ public:
 
   std::string as_string () const override;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -455,7 +455,7 @@ public:
 
   std::string as_string () const override { return "! (never type)"; }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 };
@@ -508,7 +508,7 @@ public:
 
   std::string as_string () const override;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -575,7 +575,7 @@ public:
 
   std::string as_string () const override;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -636,7 +636,7 @@ public:
 
   std::string as_string () const override;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -696,7 +696,7 @@ public:
 
   std::string as_string () const override;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
@@ -736,7 +736,7 @@ public:
 
   std::string as_string () const override;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 };
@@ -817,7 +817,7 @@ public:
     return MaybeNamedParam ({""}, UNNAMED, nullptr, {}, UNDEF_LOCATION);
   }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   // TODO: this mutable getter seems really dodgy. Think up better way.
   std::vector<Attribute> &get_outer_attrs () { return outer_attrs; }
@@ -923,7 +923,7 @@ public:
 
   std::string as_string () const override;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (ASTVisitor &vis) override;
 
diff --git a/gcc/rust/hir/rust-ast-lower-base.h b/gcc/rust/hir/rust-ast-lower-base.h
index 4fb2f97febd..0b7dce888a1 100644
--- a/gcc/rust/hir/rust-ast-lower-base.h
+++ b/gcc/rust/hir/rust-ast-lower-base.h
@@ -44,7 +44,7 @@ public:
   {}
 
   const Analysis::NodeMapping &get_mappings () const { return mappings; }
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
   const AST::AttrVec &get_outer_attrs () const { return outer_attrs; }
 
 private:
diff --git a/gcc/rust/hir/tree/rust-hir-expr.h b/gcc/rust/hir/tree/rust-hir-expr.h
index f4f08d56e01..e180d6c1a11 100644
--- a/gcc/rust/hir/tree/rust-hir-expr.h
+++ b/gcc/rust/hir/tree/rust-hir-expr.h
@@ -94,7 +94,7 @@ public:
     return std::unique_ptr<LiteralExpr> (clone_literal_expr_impl ());
   }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRExpressionVisitor &vis) override;
@@ -170,7 +170,7 @@ protected:
   OperatorExpr &operator= (OperatorExpr &&other) = default;
 
 public:
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   std::unique_ptr<Expr> &get_expr () { return main_or_left_expr; }
 
@@ -791,7 +791,7 @@ public:
   GroupedExpr (GroupedExpr &&other) = default;
   GroupedExpr &operator= (GroupedExpr &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRExpressionVisitor &vis) override;
@@ -1013,7 +1013,7 @@ public:
   ArrayExpr (ArrayExpr &&other) = default;
   ArrayExpr &operator= (ArrayExpr &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRExpressionVisitor &vis) override;
@@ -1082,7 +1082,7 @@ public:
   ArrayIndexExpr (ArrayIndexExpr &&other) = default;
   ArrayIndexExpr &operator= (ArrayIndexExpr &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRExpressionVisitor &vis) override;
@@ -1162,7 +1162,7 @@ public:
   /* Note: syntactically, can disambiguate single-element tuple from parens with
    * comma, i.e. (0,) rather than (0) */
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRExpressionVisitor &vis) override;
@@ -1236,7 +1236,7 @@ public:
   TupleIndexExpr (TupleIndexExpr &&other) = default;
   TupleIndexExpr &operator= (TupleIndexExpr &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRExpressionVisitor &vis) override;
@@ -1305,7 +1305,7 @@ public:
       WithInnerAttrs (std::move (inner_attribs)), locus (locus)
   {}
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRExpressionVisitor &vis) override;
@@ -1400,7 +1400,7 @@ public:
 
   Analysis::NodeMapping &get_mappings () { return mappings; }
 
-  Location get_locus () { return locus; }
+  location_t get_locus () { return locus; }
 
   virtual StructExprFieldKind get_kind () const = 0;
 
@@ -1752,7 +1752,7 @@ public:
   // Returns whether function call has parameters.
   bool has_params () const { return !params.empty (); }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRExpressionVisitor &vis) override;
@@ -1839,7 +1839,7 @@ public:
   MethodCallExpr (MethodCallExpr &&other) = default;
   MethodCallExpr &operator= (MethodCallExpr &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRExpressionVisitor &vis) override;
@@ -1923,7 +1923,7 @@ public:
   FieldAccessExpr (FieldAccessExpr &&other) = default;
   FieldAccessExpr &operator= (FieldAccessExpr &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRExpressionVisitor &vis) override;
@@ -2022,7 +2022,7 @@ public:
 
   std::unique_ptr<Type> &get_type () { return type; }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 };
 
 // Base closure definition expression HIR node - abstract
@@ -2077,7 +2077,7 @@ public:
 
   std::string as_string () const override;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   ExprType get_expression_type () const override final
   {
@@ -2191,7 +2191,7 @@ public:
     return std::unique_ptr<BlockExpr> (clone_block_expr_impl ());
   }
 
-  Location get_locus () const override final { return start_locus; }
+  location_t get_locus () const override final { return start_locus; }
 
   Location get_start_locus () const { return start_locus; }
 
@@ -2253,7 +2253,7 @@ public:
       label (std::move (label)), locus (locus)
   {}
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRExpressionVisitor &vis) override;
@@ -2337,7 +2337,7 @@ public:
   BreakExpr (BreakExpr &&other) = default;
   BreakExpr &operator= (BreakExpr &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRExpressionVisitor &vis) override;
@@ -2376,7 +2376,7 @@ protected:
   {}
 
 public:
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   ExprType get_expression_type () const override final
   {
@@ -2741,7 +2741,7 @@ public:
   ReturnExpr (ReturnExpr &&other) = default;
   ReturnExpr &operator= (ReturnExpr &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRExpressionVisitor &vis) override;
@@ -2807,7 +2807,7 @@ public:
   UnsafeBlockExpr (UnsafeBlockExpr &&other) = default;
   UnsafeBlockExpr &operator= (UnsafeBlockExpr &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRExpressionVisitor &vis) override;
@@ -2856,7 +2856,7 @@ public:
   // Returns whether the LoopLabel is in an error state.
   bool is_error () const { return label.is_error (); }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   Analysis::NodeMapping &get_mappings () { return mappings; }
 
@@ -2914,7 +2914,7 @@ protected:
 public:
   bool has_loop_label () const { return !loop_label.is_error (); }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   std::unique_ptr<HIR::BlockExpr> &get_loop_block () { return loop_block; };
 
@@ -3212,7 +3212,7 @@ public:
    * vector of else ifs - i.e. not like a switch statement. TODO - is this a
    * better approach? or does it not parse correctly and have downsides? */
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRExpressionVisitor &vis) override;
@@ -3370,7 +3370,7 @@ public:
     return std::unique_ptr<IfLetExpr> (clone_if_let_expr_impl ());
   }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRExpressionVisitor &vis) override;
@@ -3557,7 +3557,7 @@ public:
 
   std::unique_ptr<Expr> &get_guard_expr () { return guard_expr; }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 };
 
 /* A "match case" - a correlated match arm and resulting expression. Not
@@ -3655,7 +3655,7 @@ public:
   MatchExpr (MatchExpr &&other) = default;
   MatchExpr &operator= (MatchExpr &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRExpressionVisitor &vis) override;
@@ -3719,7 +3719,7 @@ public:
 
   std::string as_string () const override;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRExpressionVisitor &vis) override;
@@ -3778,7 +3778,7 @@ public:
 
   std::string as_string () const override;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   bool get_has_move () const { return has_move; }
   std::unique_ptr<BlockExpr> &get_block_expr () { return block_expr; }
@@ -3841,7 +3841,7 @@ public:
     return lvalue_mappings;
   }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
 private:
   const Analysis::NodeMapping node_mappings;
diff --git a/gcc/rust/hir/tree/rust-hir-item.h b/gcc/rust/hir/tree/rust-hir-item.h
index 70393f315bb..2d4cae5beba 100644
--- a/gcc/rust/hir/tree/rust-hir-item.h
+++ b/gcc/rust/hir/tree/rust-hir-item.h
@@ -113,7 +113,7 @@ public:
 
   std::string as_string () const override;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
 
@@ -270,7 +270,7 @@ public:
   TypeBoundWhereClauseItem &operator= (TypeBoundWhereClauseItem &&other)
     = default;
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   std::string as_string () const override;
 
@@ -447,7 +447,7 @@ public:
 
   std::string as_string () const;
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   ImplicitSelfKind get_self_kind () const { return self_kind; }
 
@@ -542,7 +542,7 @@ public:
 
   std::string as_string () const;
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   std::unique_ptr<Pattern> &get_param_name () { return param_name; }
 
@@ -714,7 +714,7 @@ public:
    * the module. */
   void add_crate_name (std::vector<std::string> &names) const override;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   ItemKind get_item_kind () const override { return ItemKind::Module; }
 
@@ -766,7 +766,7 @@ public:
       as_clause_name (std::move (as_clause_name)), locus (locus)
   {}
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   ItemKind get_item_kind () const override { return ItemKind::ExternCrate; }
   std::string get_referenced_crate () { return referenced_crate; }
@@ -813,7 +813,7 @@ public:
 
   virtual std::string as_string () const = 0;
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
 protected:
   // Clone function implementation as pure virtual method
@@ -1048,7 +1048,7 @@ public:
   UseDeclaration (UseDeclaration &&other) = default;
   UseDeclaration &operator= (UseDeclaration &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
   ItemKind get_item_kind () const override { return ItemKind::UseDeclaration; }
 
   std::unique_ptr<UseTree> &get_use_tree () { return use_tree; }
@@ -1177,7 +1177,7 @@ public:
   Function (Function &&other) = default;
   Function &operator= (Function &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRImplVisitor &vis) override;
@@ -1314,7 +1314,7 @@ public:
   TypeAlias (TypeAlias &&other) = default;
   TypeAlias &operator= (TypeAlias &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRImplVisitor &vis) override;
@@ -1386,7 +1386,7 @@ public:
   // Returns whether struct has a where clause.
   bool has_where_clause () const { return !where_clause.is_empty (); }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
   ItemKind get_item_kind () const override { return ItemKind::Struct; }
 
   std::vector<std::unique_ptr<GenericParam>> &get_generic_params ()
@@ -1502,7 +1502,7 @@ public:
 
   Analysis::NodeMapping get_mappings () const { return mappings; }
 
-  Location get_locus () { return locus; }
+  location_t get_locus () { return locus; }
   AST::AttrVec &get_outer_attrs () { return outer_attrs; }
   Visibility &get_visibility () { return visibility; }
 };
@@ -1632,7 +1632,7 @@ public:
 
   Visibility &get_visibility () { return visibility; }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   AST::AttrVec &get_outer_attrs () { return outer_attrs; }
   std::unique_ptr<HIR::Type> &get_field_type () { return field_type; }
@@ -1720,7 +1720,7 @@ public:
   void accept_vis (HIRStmtVisitor &vis) override;
   // void accept_vis (HIRVisItemVisitor &vis) override;
 
-  Location get_locus () const override { return locus; }
+  location_t get_locus () const override { return locus; }
 
   Identifier get_identifier () const { return variant_name; }
 
@@ -1940,7 +1940,7 @@ public:
   Enum (Enum &&other) = default;
   Enum &operator= (Enum &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRStmtVisitor &vis) override;
@@ -2048,7 +2048,7 @@ public:
 
   Identifier get_identifier () const { return union_name; }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRStmtVisitor &vis) override;
@@ -2114,7 +2114,7 @@ public:
     return identifier.as_string () == std::string ("_");
   }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRStmtVisitor &vis) override;
@@ -2205,7 +2205,7 @@ public:
   StaticItem (StaticItem &&other) = default;
   StaticItem &operator= (StaticItem &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRStmtVisitor &vis) override;
@@ -2375,7 +2375,7 @@ public:
 
   std::string as_string () const override;
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRTraitItemVisitor &vis) override;
@@ -2462,7 +2462,7 @@ public:
 
   std::string as_string () const override;
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRTraitItemVisitor &vis) override;
@@ -2555,7 +2555,7 @@ public:
 
   std::string as_string () const override;
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRTraitItemVisitor &vis) override;
@@ -2690,7 +2690,7 @@ public:
   Trait (Trait &&other) = default;
   Trait &operator= (Trait &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRStmtVisitor &vis) override;
@@ -2817,7 +2817,7 @@ public:
   // Returns the polarity of the impl.
   Polarity get_polarity () const { return polarity; }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   std::unique_ptr<Type> &get_type () { return impl_type; };
 
@@ -2874,7 +2874,7 @@ public:
 
   virtual std::string as_string () const;
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   virtual void accept_vis (HIRFullVisitor &vis) = 0;
   virtual void accept_vis (HIRExternalItemVisitor &vis) = 0;
@@ -3185,7 +3185,7 @@ public:
   ExternBlock (ExternBlock &&other) = default;
   ExternBlock &operator= (ExternBlock &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRStmtVisitor &vis) override;
diff --git a/gcc/rust/hir/tree/rust-hir-path.h b/gcc/rust/hir/tree/rust-hir-path.h
index f726a43555d..80456e818a4 100644
--- a/gcc/rust/hir/tree/rust-hir-path.h
+++ b/gcc/rust/hir/tree/rust-hir-path.h
@@ -110,7 +110,7 @@ public:
   std::unique_ptr<Type> &get_type () { return type; }
   const std::unique_ptr<Type> &get_type () const { return type; }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 };
 
 class ConstGenericArg
@@ -225,7 +225,7 @@ public:
 
   std::vector<ConstGenericArg> &get_const_args () { return const_args; }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 };
 
 /* A segment of a path in expression, including an identifier aspect and maybe
@@ -267,7 +267,7 @@ public:
 
   std::string as_string () const;
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   PathIdentSegment &get_segment () { return segment_name; }
   const PathIdentSegment &get_segment () const { return segment_name; }
@@ -373,7 +373,7 @@ public:
     return convert_to_simple_path (has_opening_scope_resolution);
   }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRExpressionVisitor &vis) override;
@@ -478,7 +478,7 @@ public:
    * function). Overriden in derived classes with other segments. */
   virtual bool is_ident_only () const { return true; }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   // not pure virtual as class not abstract
   virtual void accept_vis (HIRFullVisitor &vis);
@@ -803,7 +803,7 @@ public:
 
   std::string as_string () const;
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   Analysis::NodeMapping get_mappings () const { return mappings; }
 
@@ -854,7 +854,7 @@ public:
       path_type (std::move (qual_path_type)), locus (locus)
   {}
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRExpressionVisitor &vis) override;
@@ -862,7 +862,7 @@ public:
 
   QualifiedPathType &get_path_type () { return path_type; }
 
-  Location get_locus () { return locus; }
+  location_t get_locus () { return locus; }
 
   Analysis::NodeMapping get_pattern_mappings () const override final
   {
diff --git a/gcc/rust/hir/tree/rust-hir-pattern.h b/gcc/rust/hir/tree/rust-hir-pattern.h
index 882aa1165c1..c8defd4d795 100644
--- a/gcc/rust/hir/tree/rust-hir-pattern.h
+++ b/gcc/rust/hir/tree/rust-hir-pattern.h
@@ -46,7 +46,7 @@ public:
       locus (locus), mappings (mappings)
   {}
 
-  Location get_locus () const override { return locus; }
+  location_t get_locus () const override { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRPatternVisitor &vis) override;
@@ -128,7 +128,7 @@ public:
   IdentifierPattern (IdentifierPattern &&other) = default;
   IdentifierPattern &operator= (IdentifierPattern &&other) = default;
 
-  Location get_locus () const override { return locus; }
+  location_t get_locus () const override { return locus; }
 
   bool is_mut () const { return mut == Mutability::Mut; }
   bool get_is_ref () const { return is_ref; }
@@ -171,7 +171,7 @@ public:
     : locus (locus), mappings (mappings)
   {}
 
-  Location get_locus () const override { return locus; }
+  location_t get_locus () const override { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRPatternVisitor &vis) override;
@@ -247,7 +247,7 @@ public:
 
   std::string as_string () const override;
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   Literal get_literal () const { return literal; }
   bool get_has_minus () const { return has_minus; }
@@ -281,7 +281,7 @@ public:
 
   std::string as_string () const override { return path.as_string (); }
 
-  Location get_locus () const { return path.get_locus (); }
+  location_t get_locus () const { return path.get_locus (); }
 
   PathInExpression &get_path () { return path; }
   const PathInExpression &get_path () const { return path; }
@@ -317,7 +317,7 @@ public:
 
   std::string as_string () const override { return path.as_string (); }
 
-  Location get_locus () const { return path.get_locus (); }
+  location_t get_locus () const { return path.get_locus (); }
 
   void accept_vis (HIRFullVisitor &vis) override;
 
@@ -388,7 +388,7 @@ public:
   RangePattern (RangePattern &&other) = default;
   RangePattern &operator= (RangePattern &&other) = default;
 
-  Location get_locus () const override { return locus; }
+  location_t get_locus () const override { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRPatternVisitor &vis) override;
@@ -469,7 +469,7 @@ public:
     return mappings;
   }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   PatternType get_pattern_type () const override final
   {
@@ -515,7 +515,7 @@ public:
   virtual void accept_vis (HIRFullVisitor &vis) = 0;
   virtual ItemType get_item_type () const = 0;
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
   Analysis::NodeMapping get_mappings () const { return mappings; };
   AST::AttrVec get_outer_attrs () { return outer_attrs; }
 
@@ -750,7 +750,7 @@ public:
 
   bool has_struct_pattern_elems () const { return !elems.is_empty (); }
 
-  Location get_locus () const override { return path.get_locus (); }
+  location_t get_locus () const override { return path.get_locus (); }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRPatternVisitor &vis) override;
@@ -982,7 +982,7 @@ public:
   TupleStructPattern (TupleStructPattern &&other) = default;
   TupleStructPattern &operator= (TupleStructPattern &&other) = default;
 
-  Location get_locus () const override { return path.get_locus (); }
+  location_t get_locus () const override { return path.get_locus (); }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRPatternVisitor &vis) override;
@@ -1214,7 +1214,7 @@ public:
     return *this;
   }
 
-  Location get_locus () const override { return locus; }
+  location_t get_locus () const override { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRPatternVisitor &vis) override;
@@ -1289,7 +1289,7 @@ public:
     return items;
   }
 
-  Location get_locus () const override { return locus; }
+  location_t get_locus () const override { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRPatternVisitor &vis) override;
@@ -1361,7 +1361,7 @@ public:
     return alts;
   }
 
-  Location get_locus () const override { return locus; }
+  location_t get_locus () const override { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRPatternVisitor &vis) override;
diff --git a/gcc/rust/hir/tree/rust-hir-stmt.h b/gcc/rust/hir/tree/rust-hir-stmt.h
index 212bf2a4142..a51dab7b82a 100644
--- a/gcc/rust/hir/tree/rust-hir-stmt.h
+++ b/gcc/rust/hir/tree/rust-hir-stmt.h
@@ -37,7 +37,7 @@ public:
     : Stmt (std::move (mappings)), locus (locus)
   {}
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRStmtVisitor &vis) override;
@@ -133,7 +133,7 @@ public:
   LetStmt (LetStmt &&other) = default;
   LetStmt &operator= (LetStmt &&other) = default;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRStmtVisitor &vis) override;
@@ -179,7 +179,7 @@ public:
 
   std::string as_string () const override;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRStmtVisitor &vis) override;
diff --git a/gcc/rust/hir/tree/rust-hir-type.h b/gcc/rust/hir/tree/rust-hir-type.h
index 91ac1d4ec50..08a389e11b3 100644
--- a/gcc/rust/hir/tree/rust-hir-type.h
+++ b/gcc/rust/hir/tree/rust-hir-type.h
@@ -56,7 +56,7 @@ public:
 
   std::string as_string () const override;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   void accept_vis (HIRFullVisitor &vis) override;
 
@@ -741,7 +741,7 @@ public:
     return MaybeNamedParam ({""}, UNNAMED, nullptr, UNDEF_LOCATION);
   }
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   std::unique_ptr<Type> &get_type () { return param_type; }
 
diff --git a/gcc/rust/hir/tree/rust-hir.h b/gcc/rust/hir/tree/rust-hir.h
index c5a027af624..aac4b2dac62 100644
--- a/gcc/rust/hir/tree/rust-hir.h
+++ b/gcc/rust/hir/tree/rust-hir.h
@@ -180,7 +180,7 @@ public:
 
   virtual void accept_vis (HIRStmtVisitor &vis) = 0;
 
-  virtual Location get_locus () const = 0;
+  virtual location_t get_locus () const = 0;
 
   virtual bool is_unit_check_needed () const { return false; }
 
@@ -320,7 +320,7 @@ public:
 
   virtual ~Expr () {}
 
-  virtual Location get_locus () const = 0;
+  virtual location_t get_locus () const = 0;
 
   const Analysis::NodeMapping &get_mappings () const { return mappings; }
 
@@ -422,7 +422,7 @@ public:
 
   virtual Analysis::NodeMapping get_pattern_mappings () const = 0;
 
-  virtual Location get_locus () const = 0;
+  virtual location_t get_locus () const = 0;
 
   virtual PatternType get_pattern_type () const = 0;
 
@@ -464,7 +464,7 @@ public:
   virtual void accept_vis (HIRTypeVisitor &vis) = 0;
 
   virtual Analysis::NodeMapping get_mappings () const { return mappings; }
-  virtual Location get_locus () const { return locus; }
+  virtual location_t get_locus () const { return locus; }
 
 protected:
   Type (Analysis::NodeMapping mappings, location_t locus)
@@ -529,7 +529,7 @@ public:
 
   virtual Analysis::NodeMapping get_mappings () const = 0;
 
-  virtual Location get_locus () const = 0;
+  virtual location_t get_locus () const = 0;
 
   virtual BoundType get_bound_type () const = 0;
 
@@ -579,7 +579,7 @@ public:
     return lifetime_type;
   }
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
   Analysis::NodeMapping get_mappings () const override final
   {
@@ -621,7 +621,7 @@ public:
 
   virtual std::string as_string () const = 0;
 
-  virtual Location get_locus () const = 0;
+  virtual location_t get_locus () const = 0;
 
   Analysis::NodeMapping get_mappings () const { return mappings; }
 
@@ -709,7 +709,7 @@ public:
 
   void accept_vis (HIRFullVisitor &vis) override;
 
-  Location get_locus () const override final { return locus; }
+  location_t get_locus () const override final { return locus; }
 
 protected:
   /* Use covariance to implement clone function as returning this object rather
@@ -746,7 +746,7 @@ public:
 
   void accept_vis (HIRFullVisitor &vis) override final;
 
-  Location get_locus () const override final { return locus; };
+  location_t get_locus () const override final { return locus; };
 
   bool has_default_expression () { return default_expression != nullptr; }
 
@@ -850,7 +850,7 @@ public:
 
   virtual Analysis::NodeMapping get_impl_mappings () const = 0;
 
-  virtual Location get_locus () const = 0;
+  virtual location_t get_locus () const = 0;
 
   virtual ImplItemType get_impl_item_type () const = 0;
 
diff --git a/gcc/rust/lex/rust-token.h b/gcc/rust/lex/rust-token.h
index 3d4861076a0..1783b1e24f9 100644
--- a/gcc/rust/lex/rust-token.h
+++ b/gcc/rust/lex/rust-token.h
@@ -384,7 +384,7 @@ public:
   TokenId get_id () const { return token_id; }
 
   // Gets location of the token.
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   // Set location of the token.
   void set_locus (location_t locus) { this->locus = locus; }
diff --git a/gcc/rust/resolve/rust-ast-resolve-pattern.h b/gcc/rust/resolve/rust-ast-resolve-pattern.h
index 78db070fa61..5974b503d6a 100644
--- a/gcc/rust/resolve/rust-ast-resolve-pattern.h
+++ b/gcc/rust/resolve/rust-ast-resolve-pattern.h
@@ -64,7 +64,7 @@ public:
 
   BindingTypeInfo (){};
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
   Mutability get_mut () const { return mut; }
   bool get_is_ref () const { return is_ref; }
 
diff --git a/gcc/rust/typecheck/rust-hir-trait-reference.h b/gcc/rust/typecheck/rust-hir-trait-reference.h
index 1722e0f95b3..a34463d3574 100644
--- a/gcc/rust/typecheck/rust-hir-trait-reference.h
+++ b/gcc/rust/typecheck/rust-hir-trait-reference.h
@@ -88,7 +88,7 @@ public:
 
   HIR::TraitItem *get_hir_trait_item () const;
 
-  Location get_locus () const;
+  location_t get_locus () const;
 
   const Analysis::NodeMapping get_mappings () const;
 
@@ -167,7 +167,7 @@ public:
     return trait_error_node;
   }
 
-  Location get_locus () const;
+  location_t get_locus () const;
 
   std::string get_name () const;
 
diff --git a/gcc/rust/typecheck/rust-tyty-bounds.h b/gcc/rust/typecheck/rust-tyty-bounds.h
index bcd51295345..bc63a6d412a 100644
--- a/gcc/rust/typecheck/rust-tyty-bounds.h
+++ b/gcc/rust/typecheck/rust-tyty-bounds.h
@@ -52,7 +52,7 @@ public:
 
   const TypeBoundPredicate *get_parent () const;
 
-  Location get_locus () const;
+  location_t get_locus () const;
 
 private:
   const TypeBoundPredicate *parent;
diff --git a/gcc/rust/typecheck/rust-tyty-call.h b/gcc/rust/typecheck/rust-tyty-call.h
index a06815e0020..895e58225d0 100644
--- a/gcc/rust/typecheck/rust-tyty-call.h
+++ b/gcc/rust/typecheck/rust-tyty-call.h
@@ -92,7 +92,7 @@ public:
     : mapping (mapping), argument_type (argument_type), locus (locus)
   {}
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   BaseType *get_argument_type () { return argument_type; }
 
diff --git a/gcc/rust/typecheck/rust-tyty-subst.h b/gcc/rust/typecheck/rust-tyty-subst.h
index e40e8e76f2a..9ccbafa8727 100644
--- a/gcc/rust/typecheck/rust-tyty-subst.h
+++ b/gcc/rust/typecheck/rust-tyty-subst.h
@@ -138,7 +138,7 @@ public:
   // ParamTy
   bool is_concrete () const;
 
-  Location get_locus () const;
+  location_t get_locus () const;
 
   size_t size () const;
 
diff --git a/gcc/rust/typecheck/rust-tyty-util.h b/gcc/rust/typecheck/rust-tyty-util.h
index ed13c6e6ac1..aa9f3227d98 100644
--- a/gcc/rust/typecheck/rust-tyty-util.h
+++ b/gcc/rust/typecheck/rust-tyty-util.h
@@ -56,7 +56,7 @@ public:
   explicit TyWithLocation (BaseType *ty);
 
   BaseType *get_ty () const { return ty; }
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
 private:
   BaseType *ty;
diff --git a/gcc/rust/typecheck/rust-tyty.h b/gcc/rust/typecheck/rust-tyty.h
index fa9561175de..cb844d71255 100644
--- a/gcc/rust/typecheck/rust-tyty.h
+++ b/gcc/rust/typecheck/rust-tyty.h
@@ -153,7 +153,7 @@ public:
   const BaseType *destructure () const;
 
   const RustIdent &get_ident () const;
-  Location get_locus () const;
+  location_t get_locus () const;
 
   bool has_subsititions_defined () const;
   bool needs_generic_substitutions () const;
@@ -329,7 +329,7 @@ public:
   StructFieldType *monomorphized_clone () const;
 
   void debug () const;
-  Location get_locus () const;
+  location_t get_locus () const;
   std::string as_string () const;
 
 private:
@@ -401,7 +401,7 @@ public:
 
   const Resolver::TraitReference *get () const;
 
-  Location get_locus () const { return locus; }
+  location_t get_locus () const { return locus; }
 
   std::string get_name () const;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-16 17:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-16 17:59 [gcc r14-7797] gccrs: Replace some more usages of Location with location_t Arthur Cohen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).