aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2024-01-17 13:53:21 +0100
committerP-E-P <32375388+P-E-P@users.noreply.github.com>2024-03-26 17:35:02 +0000
commit124d56a328163a8de49e01e9d88aaf6f6c5aa3e9 (patch)
treef6f20a1281351818f485a4025f081ea303499aaf /gcc
parent4c40ba4bb28b83061f3963f806d26f0599497f93 (diff)
downloadgcc-124d56a328163a8de49e01e9d88aaf6f6c5aa3e9.zip
gcc-124d56a328163a8de49e01e9d88aaf6f6c5aa3e9.tar.gz
gcc-124d56a328163a8de49e01e9d88aaf6f6c5aa3e9.tar.bz2
Change error message to match test
Error message did not match the test from the previous name resolver when a given path cannot be resolved. gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path): Change error message to match old resolver and test case. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/typecheck/rust-hir-type-check-path.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/rust/typecheck/rust-hir-type-check-path.cc b/gcc/rust/typecheck/rust-hir-type-check-path.cc
index cdb506d..b0e52c4 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-path.cc
+++ b/gcc/rust/typecheck/rust-hir-type-check-path.cc
@@ -266,8 +266,10 @@ TypeCheckExpr::resolve_root_path (HIR::PathInExpression &expr, size_t *offset,
{
if (is_root)
{
- rust_error_at (seg.get_locus (),
- "failed to resolve root segment");
+ rust_error_at (expr.get_locus (), ErrorCode::E0425,
+ "cannot find value %qs in this scope",
+ expr.as_simple_path ().as_string ().c_str ());
+
return new TyTy::ErrorType (expr.get_mappings ().get_hirid ());
}
return root_tyty;