https://gcc.gnu.org/g:124d56a328163a8de49e01e9d88aaf6f6c5aa3e9

commit 124d56a328163a8de49e01e9d88aaf6f6c5aa3e9
Author: Pierre-Emmanuel Patry <pierre-emmanuel.pa...@embecosm.com>
Date:   Wed Jan 17 13:53:21 2024 +0100

    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.pa...@embecosm.com>

Diff:
---
 gcc/rust/typecheck/rust-hir-type-check-path.cc | 6 ++++--
 1 file 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 cdb506dacbe5..b0e52c454e9d 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;

Reply via email to