aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/resolve/rust-ast-resolve-expr.cc
diff options
context:
space:
mode:
authorMuhammad Mahad <mahadtxt@gmail.com>2023-07-06 17:37:46 +0500
committerCohenArthur <arthur.cohen@embecosm.com>2023-07-07 10:53:25 +0000
commit65553ce9a9821591d0296f2b20286a91e25be8da (patch)
tree48ad1e4efb24bc82385b0c3a47c36bae8dedc035 /gcc/rust/resolve/rust-ast-resolve-expr.cc
parenta5abd7d778bdfc2b2d7899d09e428d2d02d88027 (diff)
downloadgcc-65553ce9a9821591d0296f2b20286a91e25be8da.zip
gcc-65553ce9a9821591d0296f2b20286a91e25be8da.tar.gz
gcc-65553ce9a9821591d0296f2b20286a91e25be8da.tar.bz2
gccrs: [E0425] Use of unresolved name
Refactored error message similiar to rustc. gcc/rust/ChangeLog: * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): called error function and changed error message similiar to rustc. gcc/testsuite/ChangeLog: * rust/compile/break-rust2.rs: Updated comment to pass testcase. * rust/compile/const_generics_3.rs: likewise. * rust/compile/const_generics_4.rs: likewise. * rust/compile/not_find_value_in_scope.rs: New test. Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
Diffstat (limited to 'gcc/rust/resolve/rust-ast-resolve-expr.cc')
-rw-r--r--gcc/rust/resolve/rust-ast-resolve-expr.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/rust/resolve/rust-ast-resolve-expr.cc b/gcc/rust/resolve/rust-ast-resolve-expr.cc
index a26f385..9c790e8 100644
--- a/gcc/rust/resolve/rust-ast-resolve-expr.cc
+++ b/gcc/rust/resolve/rust-ast-resolve-expr.cc
@@ -173,7 +173,8 @@ ResolveExpr::visit (AST::IdentifierExpr &expr)
}
else
{
- rust_error_at (expr.get_locus (), "failed to find name: %s",
+ rust_error_at (expr.get_locus (), ErrorCode ("E0425"),
+ "cannot find value %qs in this scope",
expr.as_string ().c_str ());
}
}