From: Pierre-Emmanuel Patry Date: Wed, 17 Jan 2024 12:53:21 +0000 (+0100) Subject: gccrs: Change error message to match test X-Git-Tag: basepoints/gcc-16~6993 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=54d806b3f11bf1043499dd0a4240be177d40be71;p=thirdparty%2Fgcc.git gccrs: 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 --- diff --git a/gcc/rust/typecheck/rust-hir-type-check-path.cc b/gcc/rust/typecheck/rust-hir-type-check-path.cc index cdb506dacbe..b0e52c454e9 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;