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 ();
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",
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
}
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 *'. */
}
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;
// 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);
}
void
-rust_error_at (const RichLocation &location, const char *fmt, ...)
+rust_error_at (const rich_location &location, const char *fmt, ...)
{
va_list ap;
// 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
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);
typedef location_t Location;
-typedef rich_location RichLocation;
-
#endif // !defined(RUST_LOCATION_H)
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");
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%>",
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");
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");
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 ());
}
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);
= 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)
}
// 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"),
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);
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;
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;
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);
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);
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;
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;
// 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 (),
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 (
// 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 (),
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 (
// 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 (),
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"),
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 ();
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 "
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 (),
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 (),
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 (),
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 (),
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 (),
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 (),
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 (),
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 (),
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 (),
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 (),
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 (),
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 (),
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 (),
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 (),
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 (),
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 (),
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 (),
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 (),
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 (),
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 (),
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 (),
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 (),
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 (),
{
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 "
}
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 ());
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 (
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 (
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 ()));
{
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 ()));
// 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++)
{
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%>",
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%>",