if (matched_rule == nullptr)
{
- RichLocation r (invoc_locus);
+ RichLocation 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 ();
new_field.get_field_name ().as_string ())
== 0)
{
- RichLocation r (new_field.get_locus ());
+ RichLocation r (line_table, new_field.get_locus ());
r.add_range (field.get_locus ());
rust_error_at (r, ErrorCode ("E0124"),
"field %qs is already declared",
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
const std::string &errmsg)
{
/* TODO: 'error_at' would like a non-'const' 'rich_location *'. */
- rich_location &gcc_loc = const_cast<rich_location &> (location.get ());
+ rich_location &gcc_loc = const_cast<rich_location &> (location);
diagnostic_metadata m;
rust_error_code_rule rule (code);
m.add_rule (rule);
rust_be_error_at (const RichLocation &location, const std::string &errmsg)
{
/* TODO: 'error_at' would like a non-'const' 'rich_location *'. */
- rich_location &gcc_loc = const_cast<rich_location &> (location.get ());
+ rich_location &gcc_loc = const_cast<rich_location &> (location);
error_at (&gcc_loc, "%s", errmsg.c_str ());
}
{
return new Linemap;
}
-
-RichLocation::RichLocation (Location root) : gcc_rich_loc (line_table, root)
-{
- /*rich_location (line_maps *set, location_t loc,
- const range_label *label = NULL);*/
-}
-
-RichLocation::~RichLocation () {}
-
-void
-RichLocation::add_range (Location loc)
-{
- gcc_rich_loc.add_range (loc);
-}
-
-void
-RichLocation::add_fixit_insert_before (const std::string &new_parent)
-{
- gcc_rich_loc.add_fixit_insert_before (new_parent.c_str ());
-}
-
-void
-RichLocation::add_fixit_insert_before (Location where,
- const std::string &new_parent)
-{
- gcc_rich_loc.add_fixit_insert_before (where, new_parent.c_str ());
-}
-
-void
-RichLocation::add_fixit_insert_after (const std::string &new_parent)
-{
- gcc_rich_loc.add_fixit_insert_after (new_parent.c_str ());
-}
-
-void
-RichLocation::add_fixit_insert_after (Location where,
- const std::string &new_parent)
-{
- gcc_rich_loc.add_fixit_insert_after (where, new_parent.c_str ());
-}
typedef location_t Location;
-class RichLocation
-{
-public:
- RichLocation (Location root);
- ~RichLocation ();
-
- void add_range (Location loc);
-
- void add_fixit_insert_before (const std::string &new_parent);
-
- void add_fixit_insert_before (Location where, const std::string &new_parent);
-
- void add_fixit_insert_after (const std::string &new_parent);
-
- void add_fixit_insert_after (Location where, const std::string &new_parent);
-
- const rich_location &get () const { return gcc_rich_loc; }
-
-private:
- rich_location gcc_rich_loc;
-};
+typedef rich_location RichLocation;
#endif // !defined(RUST_LOCATION_H)
rust_assert (last_def && last_invoc);
- RichLocation range (last_invoc->get_locus ());
+ RichLocation range (line_table, last_invoc->get_locus ());
range.add_range (last_def->get_locus ());
rust_error_at (range, "reached recursion limit");
TypeCastRules::emit_cast_error () const
{
// error[E0604]
- RichLocation r (locus);
+ RichLocation 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%>",
if (!emit_errors)
return;
- RichLocation r (expr_locus);
+ RichLocation r (line_table, expr_locus);
r.add_range (lhs);
r.add_range (rhs);
rust_error_at (r, "mismatched mutability");
if (!emit_errors)
return;
- RichLocation r (expr_locus);
+ RichLocation r (line_table, expr_locus);
r.add_range (lhs);
r.add_range (rhs);
rust_error_at (r, "unsafe unsize coercion");
void collision_detected (HIR::ImplItem *query, HIR::ImplItem *dup,
const std::string &name)
{
- RichLocation r (dup->get_locus ());
+ RichLocation r (line_table, dup->get_locus ());
r.add_range (query->get_locus ());
rust_error_at (r, "duplicate definitions with name %s", name.c_str ());
}
static void Report (std::set<PathProbeCandidate> &candidates,
const HIR::PathIdentSegment &query, Location query_locus)
{
- RichLocation r (query_locus);
+ RichLocation r (line_table, query_locus);
for (auto &c : candidates)
r.add_range (c.locus);
= non_object_super_traits.empty () && non_object_safe_items.empty ();
if (emit_error && !is_safe)
{
- RichLocation r (locus);
+ RichLocation r (line_table, locus);
for (auto &item : non_object_super_traits)
r.add_range (item->get_locus ());
for (auto &item : non_object_safe_items)
}
// error[E0277]: the type `[{integer}]` cannot be indexed by `u32`
- RichLocation r (expr.get_locus ());
+ RichLocation 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"),
if (candidates.size () > 1)
{
- RichLocation r (expr.get_method_name ().get_locus ());
+ RichLocation r (line_table, expr.get_method_name ().get_locus ());
for (auto &c : candidates)
r.add_range (c.candidate.locus);
if (lookup_tyty->get_kind () != TyTy::TypeKind::FNDEF)
{
- RichLocation r (expr.get_method_name ().get_locus ());
+ RichLocation 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;
TyTy::FnType *fn = static_cast<TyTy::FnType *> (lookup);
if (!fn->is_method ())
{
- RichLocation r (expr.get_method_name ().get_locus ());
+ RichLocation 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;
if (selected_candidates.size () > 1)
{
// mutliple candidates
- RichLocation r (expr.get_locus ());
+ RichLocation r (line_table, expr.get_locus ());
for (auto &c : resolved_candidates)
r.add_range (c.candidate.locus);
if (candidates.size () > 1)
{
- RichLocation r (expr.get_locus ());
+ RichLocation r (line_table, expr.get_locus ());
for (auto &c : candidates)
r.add_range (c.candidate.locus);
if (lookup_tyty->get_kind () != TyTy::TypeKind::FNDEF)
{
- RichLocation r (expr.get_locus ());
+ RichLocation 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;
TyTy::FnType *fn = static_cast<TyTy::FnType *> (lookup);
if (!fn->is_method ())
{
- RichLocation r (expr.get_locus ());
+ RichLocation r (line_table, expr.get_locus ());
r.add_range (resolved_candidate.locus);
rust_error_at (r, "associated function is not a method");
return false;
// unknown trait item
if (!found || raw_trait_item->is_error ())
{
- RichLocation r (constant.get_locus ());
+ RichLocation 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 (),
TyTy::TyWithLocation (lookup), constant.get_locus (),
true /*emit_errors*/))
{
- RichLocation r (constant.get_locus ());
+ RichLocation r (line_table, constant.get_locus ());
r.add_range (resolved_trait_item.get_locus ());
rust_error_at (
// unknown trait item
if (!found || raw_trait_item->is_error ())
{
- RichLocation r (type.get_locus ());
+ RichLocation 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 (),
TyTy::TyWithLocation (lookup), type.get_locus (),
true /*emit_errors*/))
{
- RichLocation r (type.get_locus ());
+ RichLocation r (line_table, type.get_locus ());
r.add_range (resolved_trait_item.get_locus ());
rust_error_at (
// unknown trait item
if (!found || raw_trait_item->is_error ())
{
- RichLocation r (function.get_locus ());
+ RichLocation 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 (),
TyTy::TyWithLocation (lookup), function.get_locus (),
true /*emit_errors*/))
{
- RichLocation r (function.get_locus ());
+ RichLocation r (line_table, function.get_locus ());
r.add_range (resolved_trait_item.get_locus ());
rust_error_at (r, ErrorCode ("E0053"),
if (missing_trait_items.size () > 0)
{
std::string missing_items_buf;
- RichLocation r (impl_block.get_locus ());
+ RichLocation 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 ();
size_t expected_field_count,
size_t got_field_count)
{
- RichLocation r (pattern.get_locus ());
+ RichLocation 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 "
Location ref_locus = mappings->lookup_location (type.get_ref ());
Location base_locus
= mappings->lookup_location (get_base ()->get_ref ());
- RichLocation r (ref_locus);
+ RichLocation r (line_table, ref_locus);
r.add_range (base_locus);
rust_error_at (r, "expected [%s] got [%s]",
get_base ()->as_string ().c_str (),
Location ref_locus = mappings->lookup_location (type.get_ref ());
Location base_locus
= mappings->lookup_location (get_base ()->get_ref ());
- RichLocation r (ref_locus);
+ RichLocation r (line_table, ref_locus);
r.add_range (base_locus);
rust_error_at (r, "expected [%s] got [%s]",
get_base ()->as_string ().c_str (),
Location ref_locus = mappings->lookup_location (type.get_ref ());
Location base_locus
= mappings->lookup_location (get_base ()->get_ref ());
- RichLocation r (ref_locus);
+ RichLocation r (line_table, ref_locus);
r.add_range (base_locus);
rust_error_at (r, "expected [%s] got [%s]",
get_base ()->as_string ().c_str (),
Location ref_locus = mappings->lookup_location (type.get_ref ());
Location base_locus
= mappings->lookup_location (get_base ()->get_ref ());
- RichLocation r (ref_locus);
+ RichLocation r (line_table, ref_locus);
r.add_range (base_locus);
rust_error_at (r, "expected [%s] got [%s]",
get_base ()->as_string ().c_str (),
Location ref_locus = mappings->lookup_location (type.get_ref ());
Location base_locus
= mappings->lookup_location (get_base ()->get_ref ());
- RichLocation r (ref_locus);
+ RichLocation r (line_table, ref_locus);
r.add_range (base_locus);
rust_error_at (r, "expected [%s] got [%s]",
get_base ()->as_string ().c_str (),
Location ref_locus = mappings->lookup_location (type.get_ref ());
Location base_locus
= mappings->lookup_location (get_base ()->get_ref ());
- RichLocation r (ref_locus);
+ RichLocation r (line_table, ref_locus);
r.add_range (base_locus);
rust_error_at (r, "expected [%s] got [%s]",
get_base ()->as_string ().c_str (),
Location ref_locus = mappings->lookup_location (type.get_ref ());
Location base_locus
= mappings->lookup_location (get_base ()->get_ref ());
- RichLocation r (ref_locus);
+ RichLocation r (line_table, ref_locus);
r.add_range (base_locus);
rust_error_at (r, "expected [%s] got [%s]",
get_base ()->as_string ().c_str (),
Location ref_locus = mappings->lookup_location (type.get_ref ());
Location base_locus
= mappings->lookup_location (get_base ()->get_ref ());
- RichLocation r (ref_locus);
+ RichLocation r (line_table, ref_locus);
r.add_range (base_locus);
rust_error_at (r, "expected [%s] got [%s]",
get_base ()->as_string ().c_str (),
Location ref_locus = mappings->lookup_location (type.get_ref ());
Location base_locus
= mappings->lookup_location (get_base ()->get_ref ());
- RichLocation r (ref_locus);
+ RichLocation r (line_table, ref_locus);
r.add_range (base_locus);
rust_error_at (r, "expected [%s] got [%s]",
get_base ()->as_string ().c_str (),
Location ref_locus = mappings->lookup_location (type.get_ref ());
Location base_locus
= mappings->lookup_location (get_base ()->get_ref ());
- RichLocation r (ref_locus);
+ RichLocation r (line_table, ref_locus);
r.add_range (base_locus);
rust_error_at (r, "expected [%s] got [%s]",
get_base ()->as_string ().c_str (),
Location ref_locus = mappings->lookup_location (type.get_ref ());
Location base_locus
= mappings->lookup_location (get_base ()->get_ref ());
- RichLocation r (ref_locus);
+ RichLocation r (line_table, ref_locus);
r.add_range (base_locus);
rust_error_at (r, "expected [%s] got [%s]",
get_base ()->as_string ().c_str (),
Location ref_locus = mappings->lookup_location (type.get_ref ());
Location base_locus
= mappings->lookup_location (get_base ()->get_ref ());
- RichLocation r (ref_locus);
+ RichLocation r (line_table, ref_locus);
r.add_range (base_locus);
rust_error_at (r, "expected [%s] got [%s]",
get_base ()->as_string ().c_str (),
Location ref_locus = mappings->lookup_location (type.get_ref ());
Location base_locus
= mappings->lookup_location (get_base ()->get_ref ());
- RichLocation r (ref_locus);
+ RichLocation r (line_table, ref_locus);
r.add_range (base_locus);
rust_error_at (r, "expected [%s] got [%s]",
get_base ()->as_string ().c_str (),
Location ref_locus = mappings->lookup_location (type.get_ref ());
Location base_locus
= mappings->lookup_location (get_base ()->get_ref ());
- RichLocation r (ref_locus);
+ RichLocation r (line_table, ref_locus);
r.add_range (base_locus);
rust_error_at (r, "expected [%s] got [%s]",
get_base ()->as_string ().c_str (),
Location ref_locus = mappings->lookup_location (type.get_ref ());
Location base_locus
= mappings->lookup_location (get_base ()->get_ref ());
- RichLocation r (ref_locus);
+ RichLocation r (line_table, ref_locus);
r.add_range (base_locus);
rust_error_at (r, "expected [%s] got [%s]",
get_base ()->as_string ().c_str (),
Location ref_locus = mappings->lookup_location (type.get_ref ());
Location base_locus
= mappings->lookup_location (get_base ()->get_ref ());
- RichLocation r (ref_locus);
+ RichLocation r (line_table, ref_locus);
r.add_range (base_locus);
rust_error_at (r, "expected [%s] got [%s]",
get_base ()->as_string ().c_str (),
Location ref_locus = mappings->lookup_location (type.get_ref ());
Location base_locus
= mappings->lookup_location (get_base ()->get_ref ());
- RichLocation r (ref_locus);
+ RichLocation r (line_table, ref_locus);
r.add_range (base_locus);
rust_error_at (r, "expected [%s] got [%s]",
get_base ()->as_string ().c_str (),
Location ref_locus = mappings->lookup_location (type.get_ref ());
Location base_locus
= mappings->lookup_location (get_base ()->get_ref ());
- RichLocation r (ref_locus);
+ RichLocation r (line_table, ref_locus);
r.add_range (base_locus);
rust_error_at (r, "expected [%s] got [%s]",
get_base ()->as_string ().c_str (),
Location ref_locus = mappings->lookup_location (type.get_ref ());
Location base_locus
= mappings->lookup_location (get_base ()->get_ref ());
- RichLocation r (ref_locus);
+ RichLocation r (line_table, ref_locus);
r.add_range (base_locus);
rust_error_at (r, "expected [%s] got [%s]",
get_base ()->as_string ().c_str (),
Location ref_locus = mappings->lookup_location (type.get_ref ());
Location base_locus
= mappings->lookup_location (get_base ()->get_ref ());
- RichLocation r (ref_locus);
+ RichLocation r (line_table, ref_locus);
r.add_range (base_locus);
rust_error_at (r, "expected [%s] got [%s]",
get_base ()->as_string ().c_str (),
Location ref_locus = mappings->lookup_location (type.get_ref ());
Location base_locus
= mappings->lookup_location (get_base ()->get_ref ());
- RichLocation r (ref_locus);
+ RichLocation r (line_table, ref_locus);
r.add_range (base_locus);
rust_error_at (r, "expected [%s] got [%s]",
get_base ()->as_string ().c_str (),
Location ref_locus = mappings->lookup_location (type.get_ref ());
Location base_locus
= mappings->lookup_location (get_base ()->get_ref ());
- RichLocation r (ref_locus);
+ RichLocation r (line_table, ref_locus);
r.add_range (base_locus);
rust_error_at (r, "expected [%s] got [%s]",
get_base ()->as_string ().c_str (),
Location ref_locus = mappings->lookup_location (type.get_ref ());
Location base_locus
= mappings->lookup_location (get_base ()->get_ref ());
- RichLocation r (ref_locus);
+ RichLocation r (line_table, ref_locus);
r.add_range (base_locus);
rust_error_at (r, "expected [%s] got [%s]",
get_base ()->as_string ().c_str (),
{
if (args.get_binding_args ().size () > get_num_associated_bindings ())
{
- RichLocation r (args.get_locus ());
+ RichLocation r (line_table, args.get_locus ());
rust_error_at (r,
"generic item takes at most %lu type binding "
}
else
{
- RichLocation r (args.get_locus ());
+ RichLocation r (line_table, args.get_locus ());
for (auto &binding : args.get_binding_args ())
r.add_range (binding.get_locus ());
size_t offs = used_arguments.size ();
if (args.get_type_args ().size () + offs > substitutions.size ())
{
- RichLocation r (args.get_locus ());
+ RichLocation r (line_table, args.get_locus ());
r.add_range (substitutions.front ().get_param_locus ());
rust_error_at (
if (args.get_type_args ().size () + offs < min_required_substitutions ())
{
- RichLocation r (args.get_locus ());
+ RichLocation r (line_table, args.get_locus ());
r.add_range (substitutions.front ().get_param_locus ());
rust_error_at (
const auto &type_param = subst.get_generic_param ();
const auto *trait_ref = bound.get ();
- RichLocation r (type_param.get_locus ());
+ RichLocation r (line_table, type_param.get_locus ());
r.add_range (bound.get_locus ());
r.add_range (mappings.lookup_location (binding->get_ref ()));
{
if (emit_error)
{
- RichLocation r (mappings->lookup_location (get_ref ()));
+ RichLocation r (line_table,
+ mappings->lookup_location (get_ref ()));
r.add_range (predicate.get_locus ());
r.add_range (mappings->lookup_location (i.get_hirid ()));
// lets emit a single error for this
if (unsatisfied_bounds.size () > 0)
{
- RichLocation r (locus);
+ RichLocation r (line_table, locus);
std::string missing_preds;
for (size_t i = 0; i < unsatisfied_bounds.size (); i++)
{
TyTy::BaseType *expected = lhs.get_ty ();
TyTy::BaseType *expr = rhs.get_ty ();
- RichLocation r (locus);
+ RichLocation r (line_table, locus);
r.add_range (lhs.get_locus ());
r.add_range (rhs.get_locus ());
rust_error_at (r, "expected %<%s%> got %<%s%>",
UnifyRules::emit_abi_mismatch (const TyTy::FnType &expected,
const TyTy::FnType &got) const
{
- RichLocation r (locus);
+ RichLocation 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%>",