]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Remove RichLocation typedef
authorOwen Avery <powerboat9.gamer@gmail.com>
Mon, 10 Jul 2023 18:05:09 +0000 (14:05 -0400)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:49:36 +0000 (18:49 +0100)
gcc/rust/ChangeLog:

* rust-location.h
(typedef RichLocation): Remove.
* expand/rust-macro-expand.cc: Replace RichLocation with rich_location.
* hir/rust-ast-lower-base.cc: Likewise.
* resolve/rust-ast-resolve-implitem.h: Likewise.
* resolve/rust-ast-resolve-stmt.h: Likewise.
* resolve/rust-ast-resolve-toplevel.h: Likewise.
* rust-diagnostics.cc: Likewise.
* rust-diagnostics.h: Likewise.
* rust-session-manager.cc: Likewise.
* typecheck/rust-casts.cc: Likewise.
* typecheck/rust-coercion.cc: Likewise.
* typecheck/rust-hir-inherent-impl-overlap.h: Likewise.
* typecheck/rust-hir-path-probe.h: Likewise.
* typecheck/rust-hir-trait-reference.cc: Likewise.
* typecheck/rust-hir-type-check-expr.cc: Likewise.
* typecheck/rust-hir-type-check-implitem.cc: Likewise.
* typecheck/rust-hir-type-check-item.cc: Likewise.
* typecheck/rust-hir-type-check-pattern.cc: Likewise.
* typecheck/rust-tyty-cmp.h: Likewise.
* typecheck/rust-tyty-subst.cc: Likewise.
* typecheck/rust-tyty.cc: Likewise.
* typecheck/rust-unify.cc: Likewise.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
22 files changed:
gcc/rust/expand/rust-macro-expand.cc
gcc/rust/hir/rust-ast-lower-base.cc
gcc/rust/resolve/rust-ast-resolve-implitem.h
gcc/rust/resolve/rust-ast-resolve-stmt.h
gcc/rust/resolve/rust-ast-resolve-toplevel.h
gcc/rust/rust-diagnostics.cc
gcc/rust/rust-diagnostics.h
gcc/rust/rust-location.h
gcc/rust/rust-session-manager.cc
gcc/rust/typecheck/rust-casts.cc
gcc/rust/typecheck/rust-coercion.cc
gcc/rust/typecheck/rust-hir-inherent-impl-overlap.h
gcc/rust/typecheck/rust-hir-path-probe.h
gcc/rust/typecheck/rust-hir-trait-reference.cc
gcc/rust/typecheck/rust-hir-type-check-expr.cc
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-pattern.cc
gcc/rust/typecheck/rust-tyty-cmp.h
gcc/rust/typecheck/rust-tyty-subst.cc
gcc/rust/typecheck/rust-tyty.cc
gcc/rust/typecheck/rust-unify.cc

index c908e3b2745f35fbc636ef8bae265d0b94962edb..f8495c68de94dc50631fc149a266f4682b5b8254 100644 (file)
@@ -104,7 +104,7 @@ MacroExpander::expand_decl_macro (Location invoc_locus,
 
   if (matched_rule == nullptr)
     {
-      RichLocation r (line_table, invoc_locus);
+      rich_location r (line_table, invoc_locus);
       r.add_range (rules_def.get_locus ());
       rust_error_at (r, "Failed to match any rule within macro");
       return AST::Fragment::create_error ();
index 413a77243d42ffa9857a75811ab3cb8e69d99111..bd1797cba52d9c42491a02d541c8c0695cb905cd 100644 (file)
@@ -679,7 +679,7 @@ struct_field_name_exists (std::vector<HIR::StructField> &fields,
            new_field.get_field_name ().as_string ())
          == 0)
        {
-         RichLocation r (line_table, new_field.get_locus ());
+         rich_location r (line_table, new_field.get_locus ());
          r.add_range (field.get_locus ());
          rust_error_at (r, ErrorCode ("E0124"),
                         "field %qs is already declared",
index f8af57ab7c61195a70899715b0dbca180e695d5b..585db5aee7893e9a6ca62ab41329a1256cd8a158 100644 (file)
@@ -58,7 +58,7 @@ public:
     resolver->get_type_scope ().insert (
       path, type.get_node_id (), type.get_locus (), false, Rib::ItemType::Type,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, type.get_locus ());
+       rich_location r (line_table, type.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -74,7 +74,7 @@ public:
       path, constant.get_node_id (), constant.get_locus (), false,
       Rib::ItemType::Const,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, constant.get_locus ());
+       rich_location r (line_table, constant.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -91,7 +91,7 @@ public:
       path, function.get_node_id (), function.get_locus (), false,
       Rib::ItemType::Function,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, function.get_locus ());
+       rich_location r (line_table, function.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -107,7 +107,7 @@ public:
       path, method.get_node_id (), method.get_locus (), false,
       Rib::ItemType::Function,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, method.get_locus ());
+       rich_location r (line_table, method.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -147,7 +147,7 @@ public:
       path, function.get_node_id (), function.get_locus (), false,
       Rib::ItemType::Function,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, function.get_locus ());
+       rich_location r (line_table, function.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -167,7 +167,7 @@ public:
       path, method.get_node_id (), method.get_locus (), false,
       Rib::ItemType::Function,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, method.get_locus ());
+       rich_location r (line_table, method.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -187,7 +187,7 @@ public:
       path, constant.get_node_id (), constant.get_locus (), false,
       Rib::ItemType::Const,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, constant.get_locus ());
+       rich_location r (line_table, constant.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -205,7 +205,7 @@ public:
     resolver->get_type_scope ().insert (
       path, type.get_node_id (), type.get_locus (), false, Rib::ItemType::Type,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, type.get_locus ());
+       rich_location r (line_table, type.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -245,7 +245,7 @@ public:
       path, function.get_node_id (), function.get_locus (), false,
       Rib::ItemType::Function,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, function.get_locus ());
+       rich_location r (line_table, function.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -264,7 +264,7 @@ public:
       path, item.get_node_id (), item.get_locus (), false,
       Rib::ItemType::Static,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, item.get_locus ());
+       rich_location r (line_table, item.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
index 4ba44253fba1ec8cd9c73ed14859ea5cdf251fd9..ce350c332c29fcb07240967b763c460a6caa26ac 100644 (file)
@@ -60,7 +60,7 @@ public:
       path, constant.get_node_id (), constant.get_locus (), false,
       Rib::ItemType::Const,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, constant.get_locus ());
+       rich_location r (line_table, constant.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -95,7 +95,7 @@ public:
       path, struct_decl.get_node_id (), struct_decl.get_locus (), false,
       Rib::ItemType::Type,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, struct_decl.get_locus ());
+       rich_location r (line_table, struct_decl.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -128,7 +128,7 @@ public:
       path, enum_decl.get_node_id (), enum_decl.get_locus (), false,
       Rib::ItemType::Type,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, enum_decl.get_locus ());
+       rich_location r (line_table, enum_decl.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -160,7 +160,7 @@ public:
     resolver->get_type_scope ().insert (
       path, item.get_node_id (), item.get_locus (), false, Rib::ItemType::Type,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, item.get_locus ());
+       rich_location r (line_table, item.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -180,7 +180,7 @@ public:
     resolver->get_type_scope ().insert (
       path, item.get_node_id (), item.get_locus (), false, Rib::ItemType::Type,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, item.get_locus ());
+       rich_location r (line_table, item.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -206,7 +206,7 @@ public:
     resolver->get_type_scope ().insert (
       path, item.get_node_id (), item.get_locus (), false, Rib::ItemType::Type,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, item.get_locus ());
+       rich_location r (line_table, item.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -232,7 +232,7 @@ public:
     resolver->get_type_scope ().insert (
       path, item.get_node_id (), item.get_locus (), false, Rib::ItemType::Type,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, item.get_locus ());
+       rich_location r (line_table, item.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -253,7 +253,7 @@ public:
       path, struct_decl.get_node_id (), struct_decl.get_locus (), false,
       Rib::ItemType::Type,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, struct_decl.get_locus ());
+       rich_location r (line_table, struct_decl.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -291,7 +291,7 @@ public:
       path, union_decl.get_node_id (), union_decl.get_locus (), false,
       Rib::ItemType::Type,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, union_decl.get_locus ());
+       rich_location r (line_table, union_decl.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -327,7 +327,7 @@ public:
       path, function.get_node_id (), function.get_locus (), false,
       Rib::ItemType::Function,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, function.get_locus ());
+       rich_location r (line_table, function.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
index d72f4c9390595d8b7877c5100383d3debd56f6a7..f45f6e8af0c31a0cdfe36d912f0e275d9cefbb9e 100644 (file)
@@ -56,7 +56,7 @@ public:
       path, module.get_node_id (), module.get_locus (), false,
       Rib::ItemType::Module,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, module.get_locus ());
+       rich_location r (line_table, module.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -86,7 +86,7 @@ public:
       path, alias.get_node_id (), alias.get_locus (), false,
       Rib::ItemType::Type,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, alias.get_locus ());
+       rich_location r (line_table, alias.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -108,7 +108,7 @@ public:
       path, struct_decl.get_node_id (), struct_decl.get_locus (), false,
       Rib::ItemType::Type,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, struct_decl.get_locus ());
+       rich_location r (line_table, struct_decl.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -130,7 +130,7 @@ public:
       path, enum_decl.get_node_id (), enum_decl.get_locus (), false,
       Rib::ItemType::Type,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, enum_decl.get_locus ());
+       rich_location r (line_table, enum_decl.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -156,7 +156,7 @@ public:
     resolver->get_type_scope ().insert (
       path, item.get_node_id (), item.get_locus (), false, Rib::ItemType::Type,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, item.get_locus ());
+       rich_location r (line_table, item.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -178,7 +178,7 @@ public:
     resolver->get_type_scope ().insert (
       path, item.get_node_id (), item.get_locus (), false, Rib::ItemType::Type,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, item.get_locus ());
+       rich_location r (line_table, item.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -200,7 +200,7 @@ public:
     resolver->get_type_scope ().insert (
       path, item.get_node_id (), item.get_locus (), false, Rib::ItemType::Type,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, item.get_locus ());
+       rich_location r (line_table, item.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -222,7 +222,7 @@ public:
     resolver->get_type_scope ().insert (
       path, item.get_node_id (), item.get_locus (), false, Rib::ItemType::Type,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, item.get_locus ());
+       rich_location r (line_table, item.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -246,7 +246,7 @@ public:
       path, struct_decl.get_node_id (), struct_decl.get_locus (), false,
       Rib::ItemType::Type,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, struct_decl.get_locus ());
+       rich_location r (line_table, struct_decl.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -268,7 +268,7 @@ public:
       path, union_decl.get_node_id (), union_decl.get_locus (), false,
       Rib::ItemType::Type,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, union_decl.get_locus ());
+       rich_location r (line_table, union_decl.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -288,7 +288,7 @@ public:
     resolver->get_name_scope ().insert (
       path, var.get_node_id (), var.get_locus (), false, Rib::ItemType::Static,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, var.get_locus ());
+       rich_location r (line_table, var.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -309,7 +309,7 @@ public:
       path, constant.get_node_id (), constant.get_locus (), false,
       Rib::ItemType::Const,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, constant.get_locus ());
+       rich_location r (line_table, constant.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -331,7 +331,7 @@ public:
       path, function.get_node_id (), function.get_locus (), false,
       Rib::ItemType::Function,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, function.get_locus ());
+       rich_location r (line_table, function.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -375,7 +375,7 @@ public:
       impl_prefix, impl_block.get_node_id (), impl_block.get_locus (), false,
       Rib::ItemType::TraitImpl,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, impl_block.get_locus ());
+       rich_location r (line_table, impl_block.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -395,7 +395,7 @@ public:
       path, trait.get_node_id (), trait.get_locus (), false,
       Rib::ItemType::Trait,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, trait.get_locus ());
+       rich_location r (line_table, trait.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
@@ -471,7 +471,7 @@ public:
       decl, resolved_crate, extern_crate.get_locus (), false,
       Rib::ItemType::ExternCrate,
       [&] (const CanonicalPath &, NodeId, Location locus) -> void {
-       RichLocation r (line_table, extern_crate.get_locus ());
+       rich_location r (line_table, extern_crate.get_locus ());
        r.add_range (locus);
        rust_error_at (r, "redefined multiple times");
       });
index 0f9eb79fb5c7e325cb58552e0693447d30798cf2..f612273e3c69a0002f8e0386d25081a4867d74dc 100644 (file)
@@ -235,7 +235,7 @@ rust_error_at (const Location location, const ErrorCode code, const char *fmt,
 }
 
 void
-rust_be_error_at (const RichLocation &location, const ErrorCode code,
+rust_be_error_at (const rich_location &location, const ErrorCode code,
                  const std::string &errmsg)
 {
   /* TODO: 'error_at' would like a non-'const' 'rich_location *'.  */
@@ -247,7 +247,7 @@ rust_be_error_at (const RichLocation &location, const ErrorCode code,
 }
 
 void
-rust_error_at (const RichLocation &location, const ErrorCode code,
+rust_error_at (const rich_location &location, const ErrorCode code,
               const char *fmt, ...)
 {
   va_list ap;
@@ -308,7 +308,7 @@ rust_inform (const Location location, const char *fmt, ...)
 
 // Rich Locations
 void
-rust_be_error_at (const RichLocation &location, const std::string &errmsg)
+rust_be_error_at (const rich_location &location, const std::string &errmsg)
 {
   /* TODO: 'error_at' would like a non-'const' 'rich_location *'.  */
   rich_location &gcc_loc = const_cast<rich_location &> (location);
@@ -316,7 +316,7 @@ rust_be_error_at (const RichLocation &location, const std::string &errmsg)
 }
 
 void
-rust_error_at (const RichLocation &location, const char *fmt, ...)
+rust_error_at (const rich_location &location, const char *fmt, ...)
 {
   va_list ap;
 
index 50097ef4ef891763d2bd7a54106c990cf1ed5dbc..316d3e042dc3324dc20e09bebd32fc009cd29b0b 100644 (file)
@@ -85,10 +85,10 @@ rust_inform (const Location, const char *fmt, ...)
 
 // rich locations
 extern void
-rust_error_at (const RichLocation &, const char *fmt, ...)
+rust_error_at (const rich_location &, const char *fmt, ...)
   RUST_ATTRIBUTE_GCC_DIAG (2, 3);
 extern void
-rust_error_at (const RichLocation &, const ErrorCode, const char *fmt, ...)
+rust_error_at (const rich_location &, const ErrorCode, const char *fmt, ...)
   RUST_ATTRIBUTE_GCC_DIAG (3, 4);
 // clang-format on
 
@@ -116,9 +116,9 @@ extern void
 rust_be_error_at (const Location, const ErrorCode,
                  const std::string &errmsg);
 extern void
-rust_be_error_at (const RichLocation &, const std::string &errmsg);
+rust_be_error_at (const rich_location &, const std::string &errmsg);
 extern void
-rust_be_error_at (const RichLocation &, const ErrorCode,
+rust_be_error_at (const rich_location &, const ErrorCode,
                  const std::string &errmsg);
 extern void
 rust_be_warning_at (const Location, int opt, const std::string &warningmsg);
index ae38b2b96047a67433f8b45f87bb8235cafbe340..0b94d7ba3565f5e1a959f31a7095695adb856b19 100644 (file)
@@ -31,6 +31,4 @@
 
 typedef location_t Location;
 
-typedef rich_location RichLocation;
-
 #endif // !defined(RUST_LOCATION_H)
index 6de15655a964304f5cd15214020bfa27367e1abb..452f69272e6decfaa818436eab8f0dc777deaa1f 100644 (file)
@@ -882,7 +882,7 @@ Session::expansion (AST::Crate &crate)
 
       rust_assert (last_def && last_invoc);
 
-      RichLocation range (line_table, last_invoc->get_locus ());
+      rich_location range (line_table, last_invoc->get_locus ());
       range.add_range (last_def->get_locus ());
 
       rust_error_at (range, "reached recursion limit");
index d64851391605f6c2bbaef2c53bfcdd0aec21fad8..39791ae4e0e12085f95f93abc80bc2f48394202d 100644 (file)
@@ -301,7 +301,7 @@ void
 TypeCastRules::emit_cast_error () const
 {
   // error[E0604]
-  RichLocation r (line_table, locus);
+  rich_location r (line_table, locus);
   r.add_range (from.get_locus ());
   r.add_range (to.get_locus ());
   rust_error_at (r, ErrorCode ("E0054"), "invalid cast %<%s%> to %<%s%>",
index 5ee1c351ef8bcf6480555a6ab404d98f90421c95..216ac0edcd36a10c2e9d9e1370f6d4977c0d35ab 100644 (file)
@@ -464,7 +464,7 @@ TypeCoercionRules::mismatched_mutability_error (Location expr_locus,
   if (!emit_errors)
     return;
 
-  RichLocation r (line_table, expr_locus);
+  rich_location r (line_table, expr_locus);
   r.add_range (lhs);
   r.add_range (rhs);
   rust_error_at (r, "mismatched mutability");
@@ -477,7 +477,7 @@ TypeCoercionRules::object_unsafe_error (Location expr_locus, Location lhs,
   if (!emit_errors)
     return;
 
-  RichLocation r (line_table, expr_locus);
+  rich_location r (line_table, expr_locus);
   r.add_range (lhs);
   r.add_range (rhs);
   rust_error_at (r, "unsafe unsize coercion");
index be8f794b54dc8f2ef0ae118dd20838b8b30c2e15..ae5a5d57c8d21eec8e7db7f9178f17b9da76fa7c 100644 (file)
@@ -128,7 +128,7 @@ public:
   void collision_detected (HIR::ImplItem *query, HIR::ImplItem *dup,
                           const std::string &name)
   {
-    RichLocation r (line_table, dup->get_locus ());
+    rich_location r (line_table, dup->get_locus ());
     r.add_range (query->get_locus ());
     rust_error_at (r, "duplicate definitions with name %s", name.c_str ());
   }
index bf29060ee4e0da73a9ddb3077d41f948d4461a64..0e814ec4066f76a7b521250b345482977a143cac 100644 (file)
@@ -160,7 +160,7 @@ public:
   static void Report (std::set<PathProbeCandidate> &candidates,
                      const HIR::PathIdentSegment &query, Location query_locus)
   {
-    RichLocation r (line_table, query_locus);
+    rich_location r (line_table, query_locus);
     for (auto &c : candidates)
       r.add_range (c.locus);
 
index 8433103cb251658f3b7d6dda72d8a6d6a8cb67c5..6a33ec33ce6e1cddec21436003c7d9093d52ab5e 100644 (file)
@@ -402,7 +402,7 @@ TraitReference::is_object_safe (bool emit_error, Location locus) const
     = non_object_super_traits.empty () && non_object_safe_items.empty ();
   if (emit_error && !is_safe)
     {
-      RichLocation r (line_table, locus);
+      rich_location r (line_table, locus);
       for (auto &item : non_object_super_traits)
        r.add_range (item->get_locus ());
       for (auto &item : non_object_safe_items)
index d78da22694abc895514a1fb93e7f16219bab1467..e27bac1295841c1a9a77c91e75a0aefeaccff66a 100644 (file)
@@ -867,7 +867,7 @@ TypeCheckExpr::visit (HIR::ArrayIndexExpr &expr)
     }
 
   // error[E0277]: the type `[{integer}]` cannot be indexed by `u32`
-  RichLocation r (line_table, expr.get_locus ());
+  rich_location r (line_table, expr.get_locus ());
   r.add_range (expr.get_array_expr ()->get_locus ());
   r.add_range (expr.get_index_expr ()->get_locus ());
   rust_error_at (r, ErrorCode ("E0277"),
@@ -1054,7 +1054,7 @@ TypeCheckExpr::visit (HIR::MethodCallExpr &expr)
 
   if (candidates.size () > 1)
     {
-      RichLocation r (line_table, expr.get_method_name ().get_locus ());
+      rich_location r (line_table, expr.get_method_name ().get_locus ());
       for (auto &c : candidates)
        r.add_range (c.candidate.locus);
 
@@ -1096,7 +1096,7 @@ TypeCheckExpr::visit (HIR::MethodCallExpr &expr)
 
   if (lookup_tyty->get_kind () != TyTy::TypeKind::FNDEF)
     {
-      RichLocation r (line_table, expr.get_method_name ().get_locus ());
+      rich_location r (line_table, expr.get_method_name ().get_locus ());
       r.add_range (resolved_candidate.locus);
       rust_error_at (r, "associated impl item is not a method");
       return;
@@ -1106,7 +1106,7 @@ TypeCheckExpr::visit (HIR::MethodCallExpr &expr)
   TyTy::FnType *fn = static_cast<TyTy::FnType *> (lookup);
   if (!fn->is_method ())
     {
-      RichLocation r (line_table, expr.get_method_name ().get_locus ());
+      rich_location r (line_table, expr.get_method_name ().get_locus ());
       r.add_range (resolved_candidate.locus);
       rust_error_at (r, "associated function is not a method");
       return;
@@ -1637,7 +1637,7 @@ TypeCheckExpr::resolve_operator_overload (
   if (selected_candidates.size () > 1)
     {
       // mutliple candidates
-      RichLocation r (line_table, expr.get_locus ());
+      rich_location r (line_table, expr.get_locus ());
       for (auto &c : resolved_candidates)
        r.add_range (c.candidate.locus);
 
@@ -1883,7 +1883,7 @@ TypeCheckExpr::resolve_fn_trait_call (HIR::CallExpr &expr,
 
   if (candidates.size () > 1)
     {
-      RichLocation r (line_table, expr.get_locus ());
+      rich_location r (line_table, expr.get_locus ());
       for (auto &c : candidates)
        r.add_range (c.candidate.locus);
 
@@ -1929,7 +1929,7 @@ TypeCheckExpr::resolve_fn_trait_call (HIR::CallExpr &expr,
 
   if (lookup_tyty->get_kind () != TyTy::TypeKind::FNDEF)
     {
-      RichLocation r (line_table, expr.get_locus ());
+      rich_location r (line_table, expr.get_locus ());
       r.add_range (resolved_candidate.locus);
       rust_error_at (r, "associated impl item is not a method");
       return false;
@@ -1939,7 +1939,7 @@ TypeCheckExpr::resolve_fn_trait_call (HIR::CallExpr &expr,
   TyTy::FnType *fn = static_cast<TyTy::FnType *> (lookup);
   if (!fn->is_method ())
     {
-      RichLocation r (line_table, expr.get_locus ());
+      rich_location r (line_table, expr.get_locus ());
       r.add_range (resolved_candidate.locus);
       rust_error_at (r, "associated function is not a method");
       return false;
index d7fb36e48577ca0d612c02a1016c4e619558120b..0c850e1cafefe0cb6978b6d5a8a59756cdbb369d 100644 (file)
@@ -392,7 +392,7 @@ TypeCheckImplItemWithTrait::visit (HIR::ConstantItem &constant)
   // unknown trait item
   if (!found || raw_trait_item->is_error ())
     {
-      RichLocation r (line_table, constant.get_locus ());
+      rich_location r (line_table, constant.get_locus ());
       r.add_range (trait_reference.get_locus ());
       rust_error_at (r, "constant %<%s%> is not a member of trait %<%s%>",
                     constant.get_identifier ().as_string ().c_str (),
@@ -415,7 +415,7 @@ TypeCheckImplItemWithTrait::visit (HIR::ConstantItem &constant)
                         TyTy::TyWithLocation (lookup), constant.get_locus (),
                         true /*emit_errors*/))
     {
-      RichLocation r (line_table, constant.get_locus ());
+      rich_location r (line_table, constant.get_locus ());
       r.add_range (resolved_trait_item.get_locus ());
 
       rust_error_at (
@@ -443,7 +443,7 @@ TypeCheckImplItemWithTrait::visit (HIR::TypeAlias &type)
   // unknown trait item
   if (!found || raw_trait_item->is_error ())
     {
-      RichLocation r (line_table, type.get_locus ());
+      rich_location r (line_table, type.get_locus ());
       r.add_range (trait_reference.get_locus ());
       rust_error_at (r, "type alias %<%s%> is not a member of trait %<%s%>",
                     type.get_new_type_name ().as_string ().c_str (),
@@ -466,7 +466,7 @@ TypeCheckImplItemWithTrait::visit (HIR::TypeAlias &type)
                         TyTy::TyWithLocation (lookup), type.get_locus (),
                         true /*emit_errors*/))
     {
-      RichLocation r (line_table, type.get_locus ());
+      rich_location r (line_table, type.get_locus ());
       r.add_range (resolved_trait_item.get_locus ());
 
       rust_error_at (
@@ -503,7 +503,7 @@ TypeCheckImplItemWithTrait::visit (HIR::Function &function)
   // unknown trait item
   if (!found || raw_trait_item->is_error ())
     {
-      RichLocation r (line_table, function.get_locus ());
+      rich_location r (line_table, function.get_locus ());
       r.add_range (trait_reference.get_locus ());
       rust_error_at (r, "method %<%s%> is not a member of trait %<%s%>",
                     function.get_function_name ().as_string ().c_str (),
@@ -526,7 +526,7 @@ TypeCheckImplItemWithTrait::visit (HIR::Function &function)
                         TyTy::TyWithLocation (lookup), function.get_locus (),
                         true /*emit_errors*/))
     {
-      RichLocation r (line_table, function.get_locus ());
+      rich_location r (line_table, function.get_locus ());
       r.add_range (resolved_trait_item.get_locus ());
 
       rust_error_at (r, ErrorCode ("E0053"),
index 800057985f992ca21fc7bdf901685890e763194f..b6a21ad525060047bb12d9f704cf8cf86dc0253c 100644 (file)
@@ -648,7 +648,7 @@ TypeCheckItem::validate_trait_impl_block (
       if (missing_trait_items.size () > 0)
        {
          std::string missing_items_buf;
-         RichLocation r (line_table, impl_block.get_locus ());
+         rich_location r (line_table, impl_block.get_locus ());
          for (size_t i = 0; i < missing_trait_items.size (); i++)
            {
              bool has_more = (i + 1) < missing_trait_items.size ();
index 421ec27b2387379a4cba0b5596904902d5b5192d..d9cdd338e196b3b814460e21df32e1046a539800 100644 (file)
@@ -412,7 +412,7 @@ TypeCheckPattern::emit_pattern_size_error (const HIR::Pattern &pattern,
                                           size_t expected_field_count,
                                           size_t got_field_count)
 {
-  RichLocation r (line_table, pattern.get_locus ());
+  rich_location r (line_table, pattern.get_locus ());
   r.add_range (mappings->lookup_location (parent->get_ref ()));
   rust_error_at (r,
                 "expected a tuple with %lu %s, found one "
index 459628819db9856d5373854f9b8a772864c32ae6..3c2ae578e799a7f66c4ab6f8ca5b8a7a580796df 100644 (file)
@@ -65,7 +65,7 @@ public:
        Location ref_locus = mappings->lookup_location (type.get_ref ());
        Location base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
-       RichLocation r (line_table, ref_locus);
+       rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
        rust_error_at (r, "expected [%s] got [%s]",
                       get_base ()->as_string ().c_str (),
@@ -81,7 +81,7 @@ public:
        Location ref_locus = mappings->lookup_location (type.get_ref ());
        Location base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
-       RichLocation r (line_table, ref_locus);
+       rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
        rust_error_at (r, "expected [%s] got [%s]",
                       get_base ()->as_string ().c_str (),
@@ -97,7 +97,7 @@ public:
        Location ref_locus = mappings->lookup_location (type.get_ref ());
        Location base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
-       RichLocation r (line_table, ref_locus);
+       rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
        rust_error_at (r, "expected [%s] got [%s]",
                       get_base ()->as_string ().c_str (),
@@ -113,7 +113,7 @@ public:
        Location ref_locus = mappings->lookup_location (type.get_ref ());
        Location base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
-       RichLocation r (line_table, ref_locus);
+       rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
        rust_error_at (r, "expected [%s] got [%s]",
                       get_base ()->as_string ().c_str (),
@@ -129,7 +129,7 @@ public:
        Location ref_locus = mappings->lookup_location (type.get_ref ());
        Location base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
-       RichLocation r (line_table, ref_locus);
+       rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
        rust_error_at (r, "expected [%s] got [%s]",
                       get_base ()->as_string ().c_str (),
@@ -145,7 +145,7 @@ public:
        Location ref_locus = mappings->lookup_location (type.get_ref ());
        Location base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
-       RichLocation r (line_table, ref_locus);
+       rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
        rust_error_at (r, "expected [%s] got [%s]",
                       get_base ()->as_string ().c_str (),
@@ -161,7 +161,7 @@ public:
        Location ref_locus = mappings->lookup_location (type.get_ref ());
        Location base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
-       RichLocation r (line_table, ref_locus);
+       rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
        rust_error_at (r, "expected [%s] got [%s]",
                       get_base ()->as_string ().c_str (),
@@ -177,7 +177,7 @@ public:
        Location ref_locus = mappings->lookup_location (type.get_ref ());
        Location base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
-       RichLocation r (line_table, ref_locus);
+       rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
        rust_error_at (r, "expected [%s] got [%s]",
                       get_base ()->as_string ().c_str (),
@@ -193,7 +193,7 @@ public:
        Location ref_locus = mappings->lookup_location (type.get_ref ());
        Location base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
-       RichLocation r (line_table, ref_locus);
+       rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
        rust_error_at (r, "expected [%s] got [%s]",
                       get_base ()->as_string ().c_str (),
@@ -209,7 +209,7 @@ public:
        Location ref_locus = mappings->lookup_location (type.get_ref ());
        Location base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
-       RichLocation r (line_table, ref_locus);
+       rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
        rust_error_at (r, "expected [%s] got [%s]",
                       get_base ()->as_string ().c_str (),
@@ -225,7 +225,7 @@ public:
        Location ref_locus = mappings->lookup_location (type.get_ref ());
        Location base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
-       RichLocation r (line_table, ref_locus);
+       rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
        rust_error_at (r, "expected [%s] got [%s]",
                       get_base ()->as_string ().c_str (),
@@ -241,7 +241,7 @@ public:
        Location ref_locus = mappings->lookup_location (type.get_ref ());
        Location base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
-       RichLocation r (line_table, ref_locus);
+       rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
        rust_error_at (r, "expected [%s] got [%s]",
                       get_base ()->as_string ().c_str (),
@@ -257,7 +257,7 @@ public:
        Location ref_locus = mappings->lookup_location (type.get_ref ());
        Location base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
-       RichLocation r (line_table, ref_locus);
+       rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
        rust_error_at (r, "expected [%s] got [%s]",
                       get_base ()->as_string ().c_str (),
@@ -273,7 +273,7 @@ public:
        Location ref_locus = mappings->lookup_location (type.get_ref ());
        Location base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
-       RichLocation r (line_table, ref_locus);
+       rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
        rust_error_at (r, "expected [%s] got [%s]",
                       get_base ()->as_string ().c_str (),
@@ -289,7 +289,7 @@ public:
        Location ref_locus = mappings->lookup_location (type.get_ref ());
        Location base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
-       RichLocation r (line_table, ref_locus);
+       rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
        rust_error_at (r, "expected [%s] got [%s]",
                       get_base ()->as_string ().c_str (),
@@ -305,7 +305,7 @@ public:
        Location ref_locus = mappings->lookup_location (type.get_ref ());
        Location base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
-       RichLocation r (line_table, ref_locus);
+       rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
        rust_error_at (r, "expected [%s] got [%s]",
                       get_base ()->as_string ().c_str (),
@@ -321,7 +321,7 @@ public:
        Location ref_locus = mappings->lookup_location (type.get_ref ());
        Location base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
-       RichLocation r (line_table, ref_locus);
+       rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
        rust_error_at (r, "expected [%s] got [%s]",
                       get_base ()->as_string ().c_str (),
@@ -337,7 +337,7 @@ public:
        Location ref_locus = mappings->lookup_location (type.get_ref ());
        Location base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
-       RichLocation r (line_table, ref_locus);
+       rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
        rust_error_at (r, "expected [%s] got [%s]",
                       get_base ()->as_string ().c_str (),
@@ -353,7 +353,7 @@ public:
        Location ref_locus = mappings->lookup_location (type.get_ref ());
        Location base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
-       RichLocation r (line_table, ref_locus);
+       rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
        rust_error_at (r, "expected [%s] got [%s]",
                       get_base ()->as_string ().c_str (),
@@ -369,7 +369,7 @@ public:
        Location ref_locus = mappings->lookup_location (type.get_ref ());
        Location base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
-       RichLocation r (line_table, ref_locus);
+       rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
        rust_error_at (r, "expected [%s] got [%s]",
                       get_base ()->as_string ().c_str (),
@@ -391,7 +391,7 @@ public:
        Location ref_locus = mappings->lookup_location (type.get_ref ());
        Location base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
-       RichLocation r (line_table, ref_locus);
+       rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
        rust_error_at (r, "expected [%s] got [%s]",
                       get_base ()->as_string ().c_str (),
@@ -407,7 +407,7 @@ public:
        Location ref_locus = mappings->lookup_location (type.get_ref ());
        Location base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
-       RichLocation r (line_table, ref_locus);
+       rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
        rust_error_at (r, "expected [%s] got [%s]",
                       get_base ()->as_string ().c_str (),
@@ -423,7 +423,7 @@ public:
        Location ref_locus = mappings->lookup_location (type.get_ref ());
        Location base_locus
          = mappings->lookup_location (get_base ()->get_ref ());
-       RichLocation r (line_table, ref_locus);
+       rich_location r (line_table, ref_locus);
        r.add_range (base_locus);
        rust_error_at (r, "expected [%s] got [%s]",
                       get_base ()->as_string ().c_str (),
index bf440dfe2e1d0bee57e52c1a87187ee8f59da4fe..483883e8ce8671fb6361dc1a1b5b54ff5a32041e 100644 (file)
@@ -563,7 +563,7 @@ SubstitutionRef::get_mappings_from_generic_args (HIR::GenericArgs &args)
        {
          if (args.get_binding_args ().size () > get_num_associated_bindings ())
            {
-             RichLocation r (line_table, args.get_locus ());
+             rich_location r (line_table, args.get_locus ());
 
              rust_error_at (r,
                             "generic item takes at most %lu type binding "
@@ -602,7 +602,7 @@ SubstitutionRef::get_mappings_from_generic_args (HIR::GenericArgs &args)
        }
       else
        {
-         RichLocation r (line_table, args.get_locus ());
+         rich_location r (line_table, args.get_locus ());
          for (auto &binding : args.get_binding_args ())
            r.add_range (binding.get_locus ());
 
@@ -616,7 +616,7 @@ SubstitutionRef::get_mappings_from_generic_args (HIR::GenericArgs &args)
   size_t offs = used_arguments.size ();
   if (args.get_type_args ().size () + offs > substitutions.size ())
     {
-      RichLocation r (line_table, args.get_locus ());
+      rich_location r (line_table, args.get_locus ());
       r.add_range (substitutions.front ().get_param_locus ());
 
       rust_error_at (
@@ -629,7 +629,7 @@ SubstitutionRef::get_mappings_from_generic_args (HIR::GenericArgs &args)
 
   if (args.get_type_args ().size () + offs < min_required_substitutions ())
     {
-      RichLocation r (line_table, args.get_locus ());
+      rich_location r (line_table, args.get_locus ());
       r.add_range (substitutions.front ().get_param_locus ());
 
       rust_error_at (
@@ -884,7 +884,7 @@ SubstitutionRef::monomorphize ()
              const auto &type_param = subst.get_generic_param ();
              const auto *trait_ref = bound.get ();
 
-             RichLocation r (line_table, type_param.get_locus ());
+             rich_location r (line_table, type_param.get_locus ());
              r.add_range (bound.get_locus ());
              r.add_range (mappings.lookup_location (binding->get_ref ()));
 
index e64b89cd82cc309a677a8dd72b99891c18613c8c..14786cfd612a4656be83a8818db9a461b7da56eb 100644 (file)
@@ -346,8 +346,8 @@ BaseType::satisfies_bound (const TypeBoundPredicate &predicate,
                {
                  if (emit_error)
                    {
-                     RichLocation r (line_table,
-                                     mappings->lookup_location (get_ref ()));
+                     rich_location r (line_table,
+                                      mappings->lookup_location (get_ref ()));
                      r.add_range (predicate.get_locus ());
                      r.add_range (mappings->lookup_location (i.get_hirid ()));
 
@@ -382,7 +382,7 @@ BaseType::bounds_compatible (const BaseType &other, Location locus,
   // lets emit a single error for this
   if (unsatisfied_bounds.size () > 0)
     {
-      RichLocation r (line_table, locus);
+      rich_location r (line_table, locus);
       std::string missing_preds;
       for (size_t i = 0; i < unsatisfied_bounds.size (); i++)
        {
index 39bc7ca4ac6fce0116a0aea2cd3fb19f366f4129..2b47cafb037f9f2285247d48ce28fcf2a3f0fe0a 100644 (file)
@@ -119,7 +119,7 @@ UnifyRules::emit_type_mismatch () const
   TyTy::BaseType *expected = lhs.get_ty ();
   TyTy::BaseType *expr = rhs.get_ty ();
 
-  RichLocation r (line_table, locus);
+  rich_location r (line_table, locus);
   r.add_range (lhs.get_locus ());
   r.add_range (rhs.get_locus ());
   rust_error_at (r, "expected %<%s%> got %<%s%>",
@@ -130,7 +130,7 @@ void
 UnifyRules::emit_abi_mismatch (const TyTy::FnType &expected,
                               const TyTy::FnType &got) const
 {
-  RichLocation r (line_table, locus);
+  rich_location r (line_table, locus);
   r.add_range (lhs.get_locus ());
   r.add_range (rhs.get_locus ());
   rust_error_at (r, "mistached abi %<%s%> got %<%s%>",