]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Replace usages of Location with location_t in typechecking
authorOwen Avery <powerboat9.gamer@gmail.com>
Tue, 11 Jul 2023 02:19:51 +0000 (22:19 -0400)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:56:02 +0000 (18:56 +0100)
gcc/rust/ChangeLog:

* typecheck/rust-autoderef.cc: Replace Location with location_t.
* typecheck/rust-coercion.cc: Likewise.
* typecheck/rust-coercion.h: Likewise.
* typecheck/rust-hir-path-probe.h: Likewise.
* typecheck/rust-hir-trait-reference.cc: Likewise.
* typecheck/rust-hir-trait-resolve.cc: Likewise.
* typecheck/rust-hir-type-check-base.cc: Likewise.
* typecheck/rust-hir-type-check-expr.cc: Likewise.
* typecheck/rust-hir-type-check-expr.h: Likewise.
* typecheck/rust-hir-type-check-implitem.cc: Likewise.
* typecheck/rust-hir-type-check-item.cc: Likewise.
* typecheck/rust-hir-type-check-path.cc: Likewise.
* typecheck/rust-hir-type-check-pattern.cc: Likewise.
* typecheck/rust-hir-type-check-stmt.cc: Likewise.
* typecheck/rust-hir-type-check-struct.cc: Likewise.
* typecheck/rust-hir-type-check-type.cc: Likewise.
* typecheck/rust-hir-type-check-type.h: Likewise.
* typecheck/rust-type-util.cc: Likewise.
* typecheck/rust-type-util.h: Likewise.
* typecheck/rust-tyty-bounds.cc: Likewise.
* typecheck/rust-tyty-call.cc: Likewise.
* typecheck/rust-tyty-call.h: Likewise.
* typecheck/rust-tyty-cmp.h: Likewise.
* typecheck/rust-tyty-subst.cc: Likewise.
* typecheck/rust-tyty-subst.h: Likewise.
* typecheck/rust-tyty.cc: Likewise.

26 files changed:
gcc/rust/typecheck/rust-autoderef.cc
gcc/rust/typecheck/rust-coercion.cc
gcc/rust/typecheck/rust-coercion.h
gcc/rust/typecheck/rust-hir-path-probe.h
gcc/rust/typecheck/rust-hir-trait-reference.cc
gcc/rust/typecheck/rust-hir-trait-resolve.cc
gcc/rust/typecheck/rust-hir-type-check-base.cc
gcc/rust/typecheck/rust-hir-type-check-expr.cc
gcc/rust/typecheck/rust-hir-type-check-expr.h
gcc/rust/typecheck/rust-hir-type-check-implitem.cc
gcc/rust/typecheck/rust-hir-type-check-item.cc
gcc/rust/typecheck/rust-hir-type-check-path.cc
gcc/rust/typecheck/rust-hir-type-check-pattern.cc
gcc/rust/typecheck/rust-hir-type-check-stmt.cc
gcc/rust/typecheck/rust-hir-type-check-struct.cc
gcc/rust/typecheck/rust-hir-type-check-type.cc
gcc/rust/typecheck/rust-hir-type-check-type.h
gcc/rust/typecheck/rust-type-util.cc
gcc/rust/typecheck/rust-type-util.h
gcc/rust/typecheck/rust-tyty-bounds.cc
gcc/rust/typecheck/rust-tyty-call.cc
gcc/rust/typecheck/rust-tyty-call.h
gcc/rust/typecheck/rust-tyty-cmp.h
gcc/rust/typecheck/rust-tyty-subst.cc
gcc/rust/typecheck/rust-tyty-subst.h
gcc/rust/typecheck/rust-tyty.cc

index 9437f3fe0d664de46bc3a46fcfa9adc3a3226fa8..9966c5469c5521cbf1380839b53dccbacde2fd9c 100644 (file)
@@ -296,7 +296,7 @@ resolve_operator_overload_fn (
          rust_assert (lookup->get_kind () == TyTy::TypeKind::FNDEF);
          fn = static_cast<TyTy::FnType *> (lookup);
 
-         Location unify_locus = mappings->lookup_location (lhs->get_ref ());
+         location_t unify_locus = mappings->lookup_location (lhs->get_ref ());
          unify_site (lhs->get_ref (),
                      TyTy::TyWithLocation (fn->get_self_type ()),
                      TyTy::TyWithLocation (adjusted_self), unify_locus);
index cd2a6661539fe42e80d30c2b14fad64aaaca0d3a..97f99df9de97bbe13ca8542b63763fd18abf1d73 100644 (file)
@@ -116,8 +116,8 @@ TypeCoercionRules::do_coercion (TyTy::BaseType *receiver)
     }
   else if (unsafe_error)
     {
-      // Location lhs = mappings->lookup_location (receiver->get_ref ());
-      // Location rhs = mappings->lookup_location (expected->get_ref ());
+      // location_t lhs = mappings->lookup_location (receiver->get_ref ());
+      // location_t rhs = mappings->lookup_location (expected->get_ref ());
       // object_unsafe_error (locus, lhs, rhs);
       return false;
     }
@@ -215,8 +215,8 @@ TypeCoercionRules::coerce_unsafe_ptr (TyTy::BaseType *receiver,
 
   if (!coerceable_mutability (from_mutbl, to_mutbl))
     {
-      Location lhs = mappings->lookup_location (receiver->get_ref ());
-      Location rhs = mappings->lookup_location (expected->get_ref ());
+      location_t lhs = mappings->lookup_location (receiver->get_ref ());
+      location_t rhs = mappings->lookup_location (expected->get_ref ());
       mismatched_mutability_error (locus, lhs, rhs);
       return TypeCoercionRules::CoercionResult::get_error ();
     }
@@ -294,8 +294,8 @@ TypeCoercionRules::coerce_borrowed_pointer (TyTy::BaseType *receiver,
 
   if (!coerceable_mutability (from_mutbl, to_mutbl))
     {
-      Location lhs = mappings->lookup_location (receiver->get_ref ());
-      Location rhs = mappings->lookup_location (expected->get_ref ());
+      location_t lhs = mappings->lookup_location (receiver->get_ref ());
+      location_t rhs = mappings->lookup_location (expected->get_ref ());
       mismatched_mutability_error (locus, lhs, rhs);
       return TypeCoercionRules::CoercionResult::get_error ();
     }
@@ -339,8 +339,8 @@ TypeCoercionRules::coerce_unsized (TyTy::BaseType *source,
       if (!coerceable_mutability (from_mutbl, to_mutbl))
        {
          unsafe_error = true;
-         Location lhs = mappings->lookup_location (source->get_ref ());
-         Location rhs = mappings->lookup_location (target->get_ref ());
+         location_t lhs = mappings->lookup_location (source->get_ref ());
+         location_t rhs = mappings->lookup_location (target->get_ref ());
          mismatched_mutability_error (locus, lhs, rhs);
          return TypeCoercionRules::CoercionResult::get_error ();
        }
@@ -364,8 +364,8 @@ TypeCoercionRules::coerce_unsized (TyTy::BaseType *source,
       if (!coerceable_mutability (from_mutbl, to_mutbl))
        {
          unsafe_error = true;
-         Location lhs = mappings->lookup_location (source->get_ref ());
-         Location rhs = mappings->lookup_location (target->get_ref ());
+         location_t lhs = mappings->lookup_location (source->get_ref ());
+         location_t rhs = mappings->lookup_location (target->get_ref ());
          mismatched_mutability_error (locus, lhs, rhs);
          return TypeCoercionRules::CoercionResult::get_error ();
        }
@@ -459,8 +459,8 @@ TypeCoercionRules::coerceable_mutability (Mutability from_mutbl,
 }
 
 void
-TypeCoercionRules::mismatched_mutability_error (Location expr_locus,
-                                               Location lhs, Location rhs)
+TypeCoercionRules::mismatched_mutability_error (location_t expr_locus,
+                                               location_t lhs, location_t rhs)
 {
   if (!emit_errors)
     return;
@@ -472,8 +472,8 @@ TypeCoercionRules::mismatched_mutability_error (Location expr_locus,
 }
 
 void
-TypeCoercionRules::object_unsafe_error (Location expr_locus, Location lhs,
-                                       Location rhs)
+TypeCoercionRules::object_unsafe_error (location_t expr_locus, location_t lhs,
+                                       location_t rhs)
 {
   if (!emit_errors)
     return;
index b8e557351bcbcf2aaf78448d84858411b1d9bd36..069927beaac76357c2b6fb26ee6cbe1d7209a198 100644 (file)
@@ -65,9 +65,10 @@ public:
   static bool coerceable_mutability (Mutability from_mutbl,
                                     Mutability to_mutbl);
 
-  void mismatched_mutability_error (Location expr_locus, Location lhs,
-                                   Location rhs);
-  void object_unsafe_error (Location expr_locus, Location lhs, Location rhs);
+  void mismatched_mutability_error (location_t expr_locus, location_t lhs,
+                                   location_t rhs);
+  void object_unsafe_error (location_t expr_locus, location_t lhs,
+                           location_t rhs);
 
 protected:
   TypeCoercionRules (TyTy::BaseType *expected, location_t locus,
index e70372bf1014c83121a6b4717553d74d452b3131..3fd96e631052f8ae221417bcfa51d8781d220e39 100644 (file)
@@ -158,7 +158,8 @@ class ReportMultipleCandidateError : private TypeCheckBase
 {
 public:
   static void Report (std::set<PathProbeCandidate> &candidates,
-                     const HIR::PathIdentSegment &query, Location query_locus)
+                     const HIR::PathIdentSegment &query,
+                     location_t query_locus)
   {
     rich_location r (line_table, query_locus);
     for (auto &c : candidates)
index d089e23b0585c809325f489df12f4fcd8b72183f..e32ab5335922080be9992f6f1c125cd798aa8696 100644 (file)
@@ -57,7 +57,7 @@ TraitItemReference::get_hir_trait_item () const
   return hir_trait_item;
 }
 
-Location
+location_t
 TraitItemReference::get_locus () const
 {
   return locus;
@@ -148,7 +148,7 @@ TraitReference::is_error () const
   return hir_trait_ref == nullptr;
 }
 
-Location
+location_t
 TraitReference::get_locus () const
 {
   return hir_trait_ref->get_locus ();
index 37132a73131d736284c43b8df427840e11b1f439..97fec48909a1f764ff42177bca010e82e5257c12 100644 (file)
@@ -349,7 +349,7 @@ TraitItemReference::resolve_item (HIR::TraitItemFunc &func)
 
   auto block_expr_ty = TypeCheckExpr::Resolve (func.get_block_expr ().get ());
 
-  Location fn_return_locus
+  location_t fn_return_locus
     = func.get_decl ().has_return_type ()
        ? func.get_decl ().get_return_type ()->get_locus ()
        : func.get_locus ();
index f0f820c2c1b10ec37b28e51f2e6bf473f5eb4e7e..ae433e859acd3690f8c3ee724e06eee7c0f89800 100644 (file)
@@ -44,7 +44,7 @@ TypeCheckBase::check_for_unconstrained (
     return check_result;
 
   std::set<HirId> symbols_to_constrain;
-  std::map<HirId, Location> symbol_to_location;
+  std::map<HirId, location_t> symbol_to_location;
   for (const auto &p : params_to_constrain)
     {
       HirId ref = p.get_param_ty ()->get_ref ();
index 0b72fb617a58e54a365cf0b3e4f201946035c6ab..7a7b3ac731427b2b018362488e5544aedb954494 100644 (file)
@@ -151,8 +151,9 @@ void
 TypeCheckExpr::visit (HIR::ReturnExpr &expr)
 {
   auto fn_return_tyty = context->peek_return_type ();
-  Location expr_locus = expr.has_return_expr () ? expr.get_expr ()->get_locus ()
-                                               : expr.get_locus ();
+  location_t expr_locus = expr.has_return_expr ()
+                           ? expr.get_expr ()->get_locus ()
+                           : expr.get_locus ();
   TyTy::BaseType *expr_ty
     = expr.has_return_expr ()
        ? TypeCheckExpr::Resolve (expr.get_expr ().get ())
@@ -1503,9 +1504,9 @@ TypeCheckExpr::visit (HIR::ClosureExpr &expr)
                           parameter_types);
   context->insert_implicit_type (closure_args);
 
-  Location result_type_locus = expr.has_return_type ()
-                                ? expr.get_return_type ()->get_locus ()
-                                : expr.get_locus ();
+  location_t result_type_locus = expr.has_return_type ()
+                                  ? expr.get_return_type ()->get_locus ()
+                                  : expr.get_locus ();
   TyTy::TyVar result_type
     = expr.has_return_type ()
        ? TyTy::TyVar (
@@ -1513,7 +1514,7 @@ TypeCheckExpr::visit (HIR::ClosureExpr &expr)
        : TyTy::TyVar::get_implicit_infer_var (expr.get_locus ());
 
   // resolve the block
-  Location closure_expr_locus = expr.get_expr ()->get_locus ();
+  location_t closure_expr_locus = expr.get_expr ()->get_locus ();
   TyTy::BaseType *closure_expr_ty
     = TypeCheckExpr::Resolve (expr.get_expr ().get ());
   coercion_site (expr.get_mappings ().get_hirid (),
index 724eee8d9b55720688434bf3db8bf79eb641751f..e9890da60c50f445d720fd316479f74137d0aa82 100644 (file)
@@ -118,7 +118,7 @@ private:
                         std::vector<HIR::PathExprSegment> &segments,
                         size_t offset, TyTy::BaseType *tyseg,
                         const Analysis::NodeMapping &expr_mappings,
-                        Location expr_locus);
+                        location_t expr_locus);
 
   bool
   validate_arithmetic_type (const TyTy::BaseType *tyty,
index f63f2d1542064451c6a337c597e4f5e1a41b7354..5fb6fa3190e4ab28ff11c3184ffe89fcb5f5e2c0 100644 (file)
@@ -317,9 +317,9 @@ TypeCheckImplItem::visit (HIR::Function &function)
   auto block_expr_ty
     = TypeCheckExpr::Resolve (function.get_definition ().get ());
 
-  Location fn_return_locus = function.has_function_return_type ()
-                              ? function.get_return_type ()->get_locus ()
-                              : function.get_locus ();
+  location_t fn_return_locus = function.has_function_return_type ()
+                                ? function.get_return_type ()->get_locus ()
+                                : function.get_locus ();
 
   coercion_site (function.get_definition ()->get_mappings ().get_hirid (),
                 TyTy::TyWithLocation (expected_ret_tyty, fn_return_locus),
index e8a4f97ed2595d31811e10585371bd42ffc405c1..98c5c1a4fec02fb985716c1571b131a58a8d2d8d 100644 (file)
@@ -495,9 +495,9 @@ TypeCheckItem::visit (HIR::Function &function)
   auto block_expr_ty
     = TypeCheckExpr::Resolve (function.get_definition ().get ());
 
-  Location fn_return_locus = function.has_function_return_type ()
-                              ? function.get_return_type ()->get_locus ()
-                              : function.get_locus ();
+  location_t fn_return_locus = function.has_function_return_type ()
+                                ? function.get_return_type ()->get_locus ()
+                                : function.get_locus ();
   coercion_site (function.get_definition ()->get_mappings ().get_hirid (),
                 TyTy::TyWithLocation (expected_ret_tyty, fn_return_locus),
                 TyTy::TyWithLocation (block_expr_ty),
index daa5ac7887869ab2d16141fe61d03a461c85f734..43a779dc1e83901137e47ccae806aed219e31e63 100644 (file)
@@ -320,7 +320,7 @@ TypeCheckExpr::resolve_segments (NodeId root_resolved_node_id,
                                 std::vector<HIR::PathExprSegment> &segments,
                                 size_t offset, TyTy::BaseType *tyseg,
                                 const Analysis::NodeMapping &expr_mappings,
-                                Location expr_locus)
+                                location_t expr_locus)
 {
   NodeId resolved_node_id = root_resolved_node_id;
   TyTy::BaseType *prev_segment = tyseg;
index 67af3c6364715fe970bce1395956b8fc0219f421..97370454bbd12ed873056c4c28060b0044dcdb80 100644 (file)
@@ -140,7 +140,7 @@ TypeCheckPattern::visit (HIR::TupleStructPattern &pattern)
 }
 
 void
-emit_invalid_field_error (Location loc, Rust::TyTy::VariantDef *variant,
+emit_invalid_field_error (location_t loc, Rust::TyTy::VariantDef *variant,
                          const std::string &name)
 {
   rust_error_at (loc, ErrorCode::E0026,
index 4efbd40e1a40898c88d2ea7d8710870129e796d1..99eb41d6e0cd483ccbee8b5142a74e5e4367c291 100644 (file)
@@ -78,7 +78,7 @@ TypeCheckStmt::visit (HIR::LetStmt &stmt)
 
   HIR::Pattern &stmt_pattern = *stmt.get_pattern ();
   TyTy::BaseType *init_expr_ty = nullptr;
-  Location init_expr_locus = UNKNOWN_LOCATION;
+  location_t init_expr_locus = UNKNOWN_LOCATION;
   if (stmt.has_init_expr ())
     {
       init_expr_locus = stmt.get_init_expr ()->get_locus ();
@@ -91,7 +91,7 @@ TypeCheckStmt::visit (HIR::LetStmt &stmt)
     }
 
   TyTy::BaseType *specified_ty = nullptr;
-  Location specified_ty_locus;
+  location_t specified_ty_locus;
   if (stmt.has_type ())
     {
       specified_ty = TypeCheckType::Resolve (stmt.get_type ().get ());
index 5688aafe7b4abebc8dcd8d181ff24720f2181362..f2dd8b6aa6eaafa683a56dbac422aa35bc0f07c1 100644 (file)
@@ -259,7 +259,7 @@ TypeCheckStructExpr::visit (HIR::StructExprFieldIdentifierValue &field)
     }
 
   TyTy::BaseType *value = TypeCheckExpr::Resolve (field.get_value ().get ());
-  Location value_locus = field.get_value ()->get_locus ();
+  location_t value_locus = field.get_value ()->get_locus ();
 
   HirId coercion_site_id = field.get_mappings ().get_hirid ();
   resolved_field_value_expr
@@ -296,7 +296,7 @@ TypeCheckStructExpr::visit (HIR::StructExprFieldIndexValue &field)
     }
 
   TyTy::BaseType *value = TypeCheckExpr::Resolve (field.get_value ().get ());
-  Location value_locus = field.get_value ()->get_locus ();
+  location_t value_locus = field.get_value ()->get_locus ();
 
   HirId coercion_site_id = field.get_mappings ().get_hirid ();
   resolved_field_value_expr
@@ -343,7 +343,7 @@ TypeCheckStructExpr::visit (HIR::StructExprFieldIdentifier &field)
   HIR::PathInExpression expr (mappings_copy2, {seg}, field.get_locus (), false,
                              {});
   TyTy::BaseType *value = TypeCheckExpr::Resolve (&expr);
-  Location value_locus = expr.get_locus ();
+  location_t value_locus = expr.get_locus ();
 
   HirId coercion_site_id = field.get_mappings ().get_hirid ();
   resolved_field_value_expr
index 779e7fd50de2ae834850e1be82ad186632ec6444..c3bc14b09893d6d270cae969e1c1fb423786ce01 100644 (file)
@@ -450,7 +450,7 @@ TypeCheckType::resolve_segments (
   NodeId root_resolved_node_id, HirId expr_id,
   std::vector<std::unique_ptr<HIR::TypePathSegment>> &segments, size_t offset,
   TyTy::BaseType *tyseg, const Analysis::NodeMapping &expr_mappings,
-  Location expr_locus)
+  location_t expr_locus)
 {
   NodeId resolved_node_id = root_resolved_node_id;
   TyTy::BaseType *prev_segment = tyseg;
index 05b41abaec32dc23a4afe198e3620a5aa6054615..b9b129b06671c6a44a99991b1862038f8d2ccd8d 100644 (file)
@@ -88,7 +88,7 @@ private:
     NodeId root_resolved_node_id, HirId expr_id,
     std::vector<std::unique_ptr<HIR::TypePathSegment>> &segments, size_t offset,
     TyTy::BaseType *tyseg, const Analysis::NodeMapping &expr_mappings,
-    Location expr_locus);
+    location_t expr_locus);
 
   TyTy::BaseType *translated;
 };
index e5b42df9cc55b73bea54a3a349082ae0ecd440f7..eed3ff417c8f3c634823317d5ea8c960f6660da1 100644 (file)
@@ -115,7 +115,7 @@ query_type (HirId reference, TyTy::BaseType **result)
     }
 
   // more?
-  Location possible_locus = mappings->lookup_location (reference);
+  location_t possible_locus = mappings->lookup_location (reference);
   rust_debug_loc (possible_locus, "query system failed to resolve: [%u]",
                  reference);
   context->query_completed (reference);
@@ -125,7 +125,7 @@ query_type (HirId reference, TyTy::BaseType **result)
 
 bool
 types_compatable (TyTy::TyWithLocation lhs, TyTy::TyWithLocation rhs,
-                 Location unify_locus, bool emit_errors)
+                 location_t unify_locus, bool emit_errors)
 {
   TyTy::BaseType *result
     = unify_site_and (UNKNOWN_HIRID, lhs, rhs, unify_locus, emit_errors,
@@ -135,7 +135,7 @@ types_compatable (TyTy::TyWithLocation lhs, TyTy::TyWithLocation rhs,
 
 TyTy::BaseType *
 unify_site (HirId id, TyTy::TyWithLocation lhs, TyTy::TyWithLocation rhs,
-           Location unify_locus)
+           location_t unify_locus)
 {
   TyTy::BaseType *expected = lhs.get_ty ();
   TyTy::BaseType *expr = rhs.get_ty ();
@@ -152,7 +152,7 @@ unify_site (HirId id, TyTy::TyWithLocation lhs, TyTy::TyWithLocation rhs,
 
 TyTy::BaseType *
 unify_site_and (HirId id, TyTy::TyWithLocation lhs, TyTy::TyWithLocation rhs,
-               Location unify_locus, bool emit_errors, bool commit_if_ok,
+               location_t unify_locus, bool emit_errors, bool commit_if_ok,
                bool implicit_infer_vars, bool cleanup)
 {
   TypeCheckContext &context = *TypeCheckContext::get ();
@@ -251,7 +251,7 @@ try_coercion (HirId id, TyTy::TyWithLocation lhs, TyTy::TyWithLocation rhs,
 
 TyTy::BaseType *
 cast_site (HirId id, TyTy::TyWithLocation from, TyTy::TyWithLocation to,
-          Location cast_locus)
+          location_t cast_locus)
 {
   rust_debug ("cast_site id={%u} from={%s} to={%s}", id,
              from.get_ty ()->debug_str ().c_str (),
index 595388ef34f747d1be9a936184d32421b53fa48f..d7b00ed6d951b5eb1c83e1705a1bd5a9c05da297 100644 (file)
@@ -30,28 +30,28 @@ query_type (HirId reference, TyTy::BaseType **result);
 
 bool
 types_compatable (TyTy::TyWithLocation lhs, TyTy::TyWithLocation rhs,
-                 Location unify_locus, bool emit_errors);
+                 location_t unify_locus, bool emit_errors);
 
 TyTy::BaseType *
 unify_site (HirId id, TyTy::TyWithLocation lhs, TyTy::TyWithLocation rhs,
-           Location unify_locus);
+           location_t unify_locus);
 
 TyTy::BaseType *
 unify_site_and (HirId id, TyTy::TyWithLocation lhs, TyTy::TyWithLocation rhs,
-               Location unify_locus, bool emit_errors, bool commit_if_ok,
+               location_t unify_locus, bool emit_errors, bool commit_if_ok,
                bool implicit_infer_vars, bool cleanup);
 
 TyTy::BaseType *
 coercion_site (HirId id, TyTy::TyWithLocation lhs, TyTy::TyWithLocation rhs,
-              Location coercion_locus);
+              location_t coercion_locus);
 
 TyTy::BaseType *
 try_coercion (HirId id, TyTy::TyWithLocation lhs, TyTy::TyWithLocation rhs,
-             Location coercion_locus);
+             location_t coercion_locus);
 
 TyTy::BaseType *
 cast_site (HirId id, TyTy::TyWithLocation from, TyTy::TyWithLocation to,
-          Location cast_locus);
+          location_t cast_locus);
 
 AssociatedImplTrait *
 lookup_associated_impl_block (const TyTy::TypeBoundPredicate &bound,
index c17f27b9e13d25dbc44fe637bb3dbcff98a50180..805028f147a1f41ad6b752ce3cd3267daa213d9e 100644 (file)
@@ -236,7 +236,7 @@ TypeCheckBase::get_predicate_from_bound (HIR::TypePath &type_path,
          Analysis::RustLangItem::ItemType::FN_ONCE_OUTPUT);
 
        std::vector<HIR::GenericArgsBinding> bindings;
-       Location output_locus = fn.get_return_type ()->get_locus ();
+       location_t output_locus = fn.get_return_type ()->get_locus ();
        HIR::GenericArgsBinding binding (Identifier (
                                           trait_item->trait_identifier ()),
                                         fn.get_return_type ()->clone_type (),
@@ -732,7 +732,7 @@ TypeBoundPredicateItem::needs_implementation () const
   return !get_raw_item ()->is_optional ();
 }
 
-Location
+location_t
 TypeBoundPredicateItem::get_locus () const
 {
   return get_raw_item ()->get_locus ();
index f2e5e85e4846986ac4746c2e18e206b7ab1d0dd1..9ba3fd83f0eaee9fe88738da16d1b2db4e89cce7 100644 (file)
@@ -24,7 +24,7 @@ namespace Rust {
 namespace TyTy {
 
 void
-emit_unexpected_argument_error (Location loc,
+emit_unexpected_argument_error (location_t loc,
                                unsigned long unexpected_arg_count,
                                unsigned long expected_arg_count)
 {
@@ -78,7 +78,7 @@ TypeCheckCallExpr::visit (ADTType &type)
     {
       StructFieldType *field = variant.get_field_at_index (i);
       BaseType *field_tyty = field->get_field_type ();
-      Location arg_locus = argument->get_locus ();
+      location_t arg_locus = argument->get_locus ();
 
       BaseType *arg = Resolver::TypeCheckExpr::Resolve (argument.get ());
       if (arg->get_kind () == TyTy::TypeKind::ERROR)
@@ -138,7 +138,7 @@ TypeCheckCallExpr::visit (FnType &type)
   size_t i = 0;
   for (auto &argument : call.get_arguments ())
     {
-      Location arg_locus = argument->get_locus ();
+      location_t arg_locus = argument->get_locus ();
       auto argument_expr_tyty
        = Resolver::TypeCheckExpr::Resolve (argument.get ());
       if (argument_expr_tyty->get_kind () == TyTy::TypeKind::ERROR)
@@ -155,7 +155,7 @@ TypeCheckCallExpr::visit (FnType &type)
          auto fnparam = type.param_at (i);
          HIR::Pattern *fn_param_pattern = fnparam.first;
          BaseType *param_ty = fnparam.second;
-         Location param_locus
+         location_t param_locus
            = fn_param_pattern == nullptr
                ? mappings->lookup_location (param_ty->get_ref ())
                : fn_param_pattern->get_locus ();
@@ -255,7 +255,7 @@ TypeCheckCallExpr::visit (FnPtr &type)
   size_t i = 0;
   for (auto &argument : call.get_arguments ())
     {
-      Location arg_locus = argument->get_locus ();
+      location_t arg_locus = argument->get_locus ();
       BaseType *fnparam = type.param_at (i);
       auto argument_expr_tyty
        = Resolver::TypeCheckExpr::Resolve (argument.get ());
@@ -292,8 +292,8 @@ TypeCheckCallExpr::visit (FnPtr &type)
 
 TypeCheckMethodCallExpr::TypeCheckMethodCallExpr (
   Analysis::NodeMapping call_mappings, std::vector<Argument> &args,
-  Location call_locus, Location receiver_locus, TyTy::BaseType *adjusted_self,
-  Resolver::TypeCheckContext *context)
+  location_t call_locus, location_t receiver_locus,
+  TyTy::BaseType *adjusted_self, Resolver::TypeCheckContext *context)
   : call_mappings (call_mappings), arguments (args), call_locus (call_locus),
     receiver_locus (receiver_locus), adjusted_self (adjusted_self),
     context (context), mappings (Analysis::Mappings::get ())
@@ -329,8 +329,8 @@ TypeCheckMethodCallExpr::go (FnType *ref, HIR::MethodCallExpr &call,
 
 BaseType *
 TypeCheckMethodCallExpr::go (FnType *ref, Analysis::NodeMapping call_mappings,
-                            std::vector<Argument> &args, Location call_locus,
-                            Location receiver_locus,
+                            std::vector<Argument> &args, location_t call_locus,
+                            location_t receiver_locus,
                             TyTy::BaseType *adjusted_self,
                             Resolver::TypeCheckContext *context)
 {
@@ -360,12 +360,12 @@ TypeCheckMethodCallExpr::check (FnType &type)
   size_t i = 1;
   for (auto &argument : arguments)
     {
-      Location arg_locus = argument.get_locus ();
+      location_t arg_locus = argument.get_locus ();
 
       auto fnparam = type.param_at (i);
       HIR::Pattern *fn_param_pattern = fnparam.first;
       BaseType *param_ty = fnparam.second;
-      Location param_locus
+      location_t param_locus
        = fn_param_pattern == nullptr
            ? mappings->lookup_location (param_ty->get_ref ())
            : fn_param_pattern->get_locus ();
index 895e58225d02822f6f5f01a106d8220960a7f343..0d3c0c64d18d269bc577d52b0a411fd356192cc3 100644 (file)
@@ -112,23 +112,23 @@ public:
                       Resolver::TypeCheckContext *context);
 
   static BaseType *go (FnType *ref, Analysis::NodeMapping call_mappings,
-                      std::vector<Argument> &args, Location call_locus,
-                      Location receiver_locus, TyTy::BaseType *adjusted_self,
+                      std::vector<Argument> &args, location_t call_locus,
+                      location_t receiver_locus, TyTy::BaseType *adjusted_self,
                       Resolver::TypeCheckContext *context);
 
 protected:
   BaseType *check (FnType &type);
 
   TypeCheckMethodCallExpr (Analysis::NodeMapping call_mappings,
-                          std::vector<Argument> &args, Location call_locus,
-                          Location receiver_locus,
+                          std::vector<Argument> &args, location_t call_locus,
+                          location_t receiver_locus,
                           TyTy::BaseType *adjusted_self,
                           Resolver::TypeCheckContext *context);
 
   Analysis::NodeMapping call_mappings;
   std::vector<Argument> &arguments;
-  Location call_locus;
-  Location receiver_locus;
+  location_t call_locus;
+  location_t receiver_locus;
   TyTy::BaseType *adjusted_self;
   Resolver::TypeCheckContext *context;
   Analysis::Mappings *mappings;
index 3c2ae578e799a7f66c4ab6f8ca5b8a7a580796df..6d4bc16bf6e5b5c8185a6e510f1d339d3bb07a98 100644 (file)
@@ -62,8 +62,8 @@ public:
 
     if (emit_error_flag)
       {
-       Location ref_locus = mappings->lookup_location (type.get_ref ());
-       Location base_locus
+       location_t ref_locus = mappings->lookup_location (type.get_ref ());
+       location_t base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
        rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
@@ -78,8 +78,8 @@ public:
     ok = false;
     if (emit_error_flag)
       {
-       Location ref_locus = mappings->lookup_location (type.get_ref ());
-       Location base_locus
+       location_t ref_locus = mappings->lookup_location (type.get_ref ());
+       location_t base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
        rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
@@ -94,8 +94,8 @@ public:
     ok = false;
     if (emit_error_flag)
       {
-       Location ref_locus = mappings->lookup_location (type.get_ref ());
-       Location base_locus
+       location_t ref_locus = mappings->lookup_location (type.get_ref ());
+       location_t base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
        rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
@@ -110,8 +110,8 @@ public:
     ok = false;
     if (emit_error_flag)
       {
-       Location ref_locus = mappings->lookup_location (type.get_ref ());
-       Location base_locus
+       location_t ref_locus = mappings->lookup_location (type.get_ref ());
+       location_t base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
        rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
@@ -126,8 +126,8 @@ public:
     ok = false;
     if (emit_error_flag)
       {
-       Location ref_locus = mappings->lookup_location (type.get_ref ());
-       Location base_locus
+       location_t ref_locus = mappings->lookup_location (type.get_ref ());
+       location_t base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
        rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
@@ -142,8 +142,8 @@ public:
     ok = false;
     if (emit_error_flag)
       {
-       Location ref_locus = mappings->lookup_location (type.get_ref ());
-       Location base_locus
+       location_t ref_locus = mappings->lookup_location (type.get_ref ());
+       location_t base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
        rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
@@ -158,8 +158,8 @@ public:
     ok = false;
     if (emit_error_flag)
       {
-       Location ref_locus = mappings->lookup_location (type.get_ref ());
-       Location base_locus
+       location_t ref_locus = mappings->lookup_location (type.get_ref ());
+       location_t base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
        rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
@@ -174,8 +174,8 @@ public:
     ok = false;
     if (emit_error_flag)
       {
-       Location ref_locus = mappings->lookup_location (type.get_ref ());
-       Location base_locus
+       location_t ref_locus = mappings->lookup_location (type.get_ref ());
+       location_t base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
        rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
@@ -190,8 +190,8 @@ public:
     ok = false;
     if (emit_error_flag)
       {
-       Location ref_locus = mappings->lookup_location (type.get_ref ());
-       Location base_locus
+       location_t ref_locus = mappings->lookup_location (type.get_ref ());
+       location_t base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
        rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
@@ -206,8 +206,8 @@ public:
     ok = false;
     if (emit_error_flag)
       {
-       Location ref_locus = mappings->lookup_location (type.get_ref ());
-       Location base_locus
+       location_t ref_locus = mappings->lookup_location (type.get_ref ());
+       location_t base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
        rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
@@ -222,8 +222,8 @@ public:
     ok = false;
     if (emit_error_flag)
       {
-       Location ref_locus = mappings->lookup_location (type.get_ref ());
-       Location base_locus
+       location_t ref_locus = mappings->lookup_location (type.get_ref ());
+       location_t base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
        rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
@@ -238,8 +238,8 @@ public:
     ok = false;
     if (emit_error_flag)
       {
-       Location ref_locus = mappings->lookup_location (type.get_ref ());
-       Location base_locus
+       location_t ref_locus = mappings->lookup_location (type.get_ref ());
+       location_t base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
        rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
@@ -254,8 +254,8 @@ public:
     ok = false;
     if (emit_error_flag)
       {
-       Location ref_locus = mappings->lookup_location (type.get_ref ());
-       Location base_locus
+       location_t ref_locus = mappings->lookup_location (type.get_ref ());
+       location_t base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
        rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
@@ -270,8 +270,8 @@ public:
     ok = false;
     if (emit_error_flag)
       {
-       Location ref_locus = mappings->lookup_location (type.get_ref ());
-       Location base_locus
+       location_t ref_locus = mappings->lookup_location (type.get_ref ());
+       location_t base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
        rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
@@ -286,8 +286,8 @@ public:
     ok = false;
     if (emit_error_flag)
       {
-       Location ref_locus = mappings->lookup_location (type.get_ref ());
-       Location base_locus
+       location_t ref_locus = mappings->lookup_location (type.get_ref ());
+       location_t base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
        rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
@@ -302,8 +302,8 @@ public:
     ok = false;
     if (emit_error_flag)
       {
-       Location ref_locus = mappings->lookup_location (type.get_ref ());
-       Location base_locus
+       location_t ref_locus = mappings->lookup_location (type.get_ref ());
+       location_t base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
        rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
@@ -318,8 +318,8 @@ public:
     ok = false;
     if (emit_error_flag)
       {
-       Location ref_locus = mappings->lookup_location (type.get_ref ());
-       Location base_locus
+       location_t ref_locus = mappings->lookup_location (type.get_ref ());
+       location_t base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
        rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
@@ -334,8 +334,8 @@ public:
     ok = false;
     if (emit_error_flag)
       {
-       Location ref_locus = mappings->lookup_location (type.get_ref ());
-       Location base_locus
+       location_t ref_locus = mappings->lookup_location (type.get_ref ());
+       location_t base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
        rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
@@ -350,8 +350,8 @@ public:
     ok = false;
     if (emit_error_flag)
       {
-       Location ref_locus = mappings->lookup_location (type.get_ref ());
-       Location base_locus
+       location_t ref_locus = mappings->lookup_location (type.get_ref ());
+       location_t base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
        rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
@@ -366,8 +366,8 @@ public:
     ok = false;
     if (emit_error_flag)
       {
-       Location ref_locus = mappings->lookup_location (type.get_ref ());
-       Location base_locus
+       location_t ref_locus = mappings->lookup_location (type.get_ref ());
+       location_t base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
        rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
@@ -388,8 +388,8 @@ public:
     ok = false;
     if (emit_error_flag)
       {
-       Location ref_locus = mappings->lookup_location (type.get_ref ());
-       Location base_locus
+       location_t ref_locus = mappings->lookup_location (type.get_ref ());
+       location_t base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
        rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
@@ -404,8 +404,8 @@ public:
     ok = false;
     if (emit_error_flag)
       {
-       Location ref_locus = mappings->lookup_location (type.get_ref ());
-       Location base_locus
+       location_t ref_locus = mappings->lookup_location (type.get_ref ());
+       location_t base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
        rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
@@ -420,8 +420,8 @@ public:
     ok = false;
     if (emit_error_flag)
       {
-       Location ref_locus = mappings->lookup_location (type.get_ref ());
-       Location base_locus
+       location_t ref_locus = mappings->lookup_location (type.get_ref ());
+       location_t base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
        rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
@@ -1561,7 +1561,7 @@ public:
        return;
       }
 
-    Location ref_locus = mappings->lookup_location (type.get_ref ());
+    location_t ref_locus = mappings->lookup_location (type.get_ref ());
     ok = base->bounds_compatible (type, ref_locus, false);
   }
 
index ba23eafee6f9b1559b22212e26c1feba42e8c932..64ae256f856eb1bf712f4979cf1eebf0689cf511 100644 (file)
@@ -76,7 +76,7 @@ SubstitutionParamMapping::needs_substitution () const
   return !(get_param_ty ()->is_concrete ());
 }
 
-Location
+location_t
 SubstitutionParamMapping::get_param_locus () const
 {
   return generic.get_locus ();
@@ -333,7 +333,7 @@ SubstitutionArgumentMappings::is_concrete () const
   return true;
 }
 
-Location
+location_t
 SubstitutionArgumentMappings::get_locus () const
 {
   return locus;
index 9ccbafa8727323e607e46a2c2d12385381de7a0e..d9d179d426ff64c47af4f20a82aaf6075acb934f 100644 (file)
@@ -56,7 +56,7 @@ public:
 
   bool needs_substitution () const;
 
-  Location get_param_locus () const;
+  location_t get_param_locus () const;
 
   bool param_has_default_ty () const;
 
index a4cb8f2da942042f3325afd8367940e750c0f0c8..d5c1a4aca57ce087b234aedc9648b0e69c9d8247 100644 (file)
@@ -265,7 +265,7 @@ BaseType::get_ident () const
   return ident;
 }
 
-Location
+location_t
 BaseType::get_locus () const
 {
   return ident.locus;
@@ -1349,7 +1349,7 @@ StructFieldType::debug () const
   rust_debug ("%s", as_string ().c_str ());
 }
 
-Location
+location_t
 StructFieldType::get_locus () const
 {
   return locus;