aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMarc Poulhiès <dkm@kataplop.net>2021-06-06 15:08:03 +0200
committerMarc Poulhiès <dkm@kataplop.net>2021-06-19 14:49:09 +0200
commit09d26b3e0b11859bc9fa27f9a4b176da47bc7add (patch)
tree9eb9d8b2bde0de1c2b59e68016cf943cf4d405cd /gcc
parenta0c1c0b4001f68c2f4827e65ec23e21fedc2a88d (diff)
downloadgcc-09d26b3e0b11859bc9fa27f9a4b176da47bc7add.zip
gcc-09d26b3e0b11859bc9fa27f9a4b176da47bc7add.tar.gz
gcc-09d26b3e0b11859bc9fa27f9a4b176da47bc7add.tar.bz2
Make 3 error messages slightly more informational
Add more context to some internal error messages (ie. not intended for user)
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/backend/rust-compile-expr.h6
-rw-r--r--gcc/rust/typecheck/rust-hir-type-check-type.h10
2 files changed, 10 insertions, 6 deletions
diff --git a/gcc/rust/backend/rust-compile-expr.h b/gcc/rust/backend/rust-compile-expr.h
index 59ae815..09652f1 100644
--- a/gcc/rust/backend/rust-compile-expr.h
+++ b/gcc/rust/backend/rust-compile-expr.h
@@ -183,8 +183,10 @@ public:
if (!ctx->get_tyctx ()->lookup_type (
expr.get_mappings ().get_hirid (), &tyty))
{
- rust_fatal_error (expr.get_locus (),
- "did not resolve type for this literal expr");
+ rust_fatal_error (
+ expr.get_locus (),
+ "did not resolve type for this literal expr (HirId %d)",
+ expr.get_mappings ().get_hirid ());
return;
}
diff --git a/gcc/rust/typecheck/rust-hir-type-check-type.h b/gcc/rust/typecheck/rust-hir-type-check-type.h
index 70b9cfa..136c0c2 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-type.h
+++ b/gcc/rust/typecheck/rust-hir-type-check-type.h
@@ -118,18 +118,20 @@ public:
{
// lookup the Node this resolves to
NodeId ref;
- if (!resolver->lookup_resolved_type (path.get_mappings ().get_nodeid (),
- &ref))
+ auto nid = path.get_mappings ().get_nodeid ();
+ if (!resolver->lookup_resolved_type (nid, &ref))
{
rust_fatal_error (path.get_locus (),
- "Failed to resolve node id to HIR");
+ "failed to resolve node '%d' to HIR", nid);
return;
}
HirId hir_lookup;
if (!context->lookup_type_by_node_id (ref, &hir_lookup))
{
- rust_error_at (path.get_locus (), "failed to lookup HIR node");
+ rust_error_at (path.get_locus (),
+ "failed to lookup HIR %d for node '%s'", ref,
+ path.as_string ().c_str ());
return;
}