From b75357f4a1835dcd288df67402340b4cb6b96c12 Mon Sep 17 00:00:00 2001 From: Owen Avery Date: Mon, 10 Jul 2023 11:42:12 -0400 Subject: Change class RichLocation into typedef gcc/rust/ChangeLog: * rust-linemap.cc (RichLocation::RichLocation): Remove. (RichLocation::~RichLocation): Remove. (RichLocation::add_range): Remove. (RichLocation::add_fixit_insert_before): Remove. (RichLocation::add_fixit_insert_after): Remove. * rust-location.h (class RichLocation): Remove. * rust-diagnostics.cc (rust_be_error_at): Remove RichLocation::get invocation. * expand/rust-macro-expand.cc: Fix RichLocation constructor. * 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-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 --- gcc/rust/resolve/rust-ast-resolve-implitem.h | 20 ++++++++--------- gcc/rust/resolve/rust-ast-resolve-stmt.h | 20 ++++++++--------- gcc/rust/resolve/rust-ast-resolve-toplevel.h | 32 ++++++++++++++-------------- 3 files changed, 36 insertions(+), 36 deletions(-) (limited to 'gcc/rust/resolve') diff --git a/gcc/rust/resolve/rust-ast-resolve-implitem.h b/gcc/rust/resolve/rust-ast-resolve-implitem.h index 8731bcc..956a414 100644 --- a/gcc/rust/resolve/rust-ast-resolve-implitem.h +++ b/gcc/rust/resolve/rust-ast-resolve-implitem.h @@ -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 (type.get_locus ()); + RichLocation 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 (constant.get_locus ()); + RichLocation 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 (function.get_locus ()); + RichLocation 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 (method.get_locus ()); + RichLocation 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 (function.get_locus ()); + RichLocation 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 (method.get_locus ()); + RichLocation 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 (constant.get_locus ()); + RichLocation 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 (type.get_locus ()); + RichLocation 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 (function.get_locus ()); + RichLocation 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 (item.get_locus ()); + RichLocation r (line_table, item.get_locus ()); r.add_range (locus); rust_error_at (r, "redefined multiple times"); }); diff --git a/gcc/rust/resolve/rust-ast-resolve-stmt.h b/gcc/rust/resolve/rust-ast-resolve-stmt.h index 9703387..9eb683a 100644 --- a/gcc/rust/resolve/rust-ast-resolve-stmt.h +++ b/gcc/rust/resolve/rust-ast-resolve-stmt.h @@ -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 (constant.get_locus ()); + RichLocation 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 (struct_decl.get_locus ()); + RichLocation 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 (enum_decl.get_locus ()); + RichLocation 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 (item.get_locus ()); + RichLocation 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 (item.get_locus ()); + RichLocation 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 (item.get_locus ()); + RichLocation 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 (item.get_locus ()); + RichLocation 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 (struct_decl.get_locus ()); + RichLocation 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 (union_decl.get_locus ()); + RichLocation 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 (function.get_locus ()); + RichLocation r (line_table, function.get_locus ()); r.add_range (locus); rust_error_at (r, "redefined multiple times"); }); diff --git a/gcc/rust/resolve/rust-ast-resolve-toplevel.h b/gcc/rust/resolve/rust-ast-resolve-toplevel.h index a55ce74..17c7286 100644 --- a/gcc/rust/resolve/rust-ast-resolve-toplevel.h +++ b/gcc/rust/resolve/rust-ast-resolve-toplevel.h @@ -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 (module.get_locus ()); + RichLocation 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 (alias.get_locus ()); + RichLocation 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 (struct_decl.get_locus ()); + RichLocation 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 (enum_decl.get_locus ()); + RichLocation 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 (item.get_locus ()); + RichLocation 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 (item.get_locus ()); + RichLocation 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 (item.get_locus ()); + RichLocation 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 (item.get_locus ()); + RichLocation 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 (struct_decl.get_locus ()); + RichLocation 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 (union_decl.get_locus ()); + RichLocation 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 (var.get_locus ()); + RichLocation 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 (constant.get_locus ()); + RichLocation 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 (function.get_locus ()); + RichLocation 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 (impl_block.get_locus ()); + RichLocation 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 (trait.get_locus ()); + RichLocation 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 (extern_crate.get_locus ()); + RichLocation r (line_table, extern_crate.get_locus ()); r.add_range (locus); rust_error_at (r, "redefined multiple times"); }); -- cgit v1.1