]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Change error message to match test
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Wed, 17 Jan 2024 12:53:21 +0000 (13:53 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 1 Aug 2024 14:52:26 +0000 (16:52 +0200)
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>
gcc/rust/typecheck/rust-hir-type-check-path.cc

index cdb506dacbe54f61f3f60ae4d126e31cff7c0181..b0e52c454e9d44be97f592102557b28d93fe95cf 100644 (file)
@@ -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;