aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/resolve
diff options
context:
space:
mode:
authorOwen Avery <powerboat9.gamer@gmail.com>2025-02-25 10:16:18 -0500
committerCohenArthur <arthur.cohen@embecosm.com>2025-02-25 15:45:53 +0000
commit3ebd4c90f8c912ec53e229e506d458c3ca3cd9a1 (patch)
treedafd67217eb6ecff68ca5298234f60a69427b8ba /gcc/rust/resolve
parentb1e30683d9ba61181b68d21489a616f5f86d9263 (diff)
downloadgcc-3ebd4c90f8c912ec53e229e506d458c3ca3cd9a1.zip
gcc-3ebd4c90f8c912ec53e229e506d458c3ca3cd9a1.tar.gz
gcc-3ebd4c90f8c912ec53e229e506d458c3ca3cd9a1.tar.bz2
Adjust unknown macro error message
gcc/rust/ChangeLog: * resolve/rust-early-name-resolver-2.0.cc (Early::visit): Adjust error produced when macro resolution fails. * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): Likewise. gcc/testsuite/ChangeLog: * rust/compile/macros/mbe/macro43.rs: Adjust expected errors. * rust/compile/macros/mbe/macro44.rs: Likewise. * rust/compile/nested_macro_use2.rs: Likewise. * rust/compile/nr2/exclude: Remove entries. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
Diffstat (limited to 'gcc/rust/resolve')
-rw-r--r--gcc/rust/resolve/rust-early-name-resolver-2.0.cc3
-rw-r--r--gcc/rust/resolve/rust-early-name-resolver.cc3
2 files changed, 4 insertions, 2 deletions
diff --git a/gcc/rust/resolve/rust-early-name-resolver-2.0.cc b/gcc/rust/resolve/rust-early-name-resolver-2.0.cc
index 319bc1d..1b8f659 100644
--- a/gcc/rust/resolve/rust-early-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-early-name-resolver-2.0.cc
@@ -280,7 +280,8 @@ Early::visit (AST::MacroInvocation &invoc)
if (!definition.has_value ())
{
collect_error (Error (invoc.get_locus (), ErrorCode::E0433,
- "could not resolve macro invocation"));
+ "could not resolve macro invocation %qs",
+ path.as_string ().c_str ()));
return;
}
diff --git a/gcc/rust/resolve/rust-early-name-resolver.cc b/gcc/rust/resolve/rust-early-name-resolver.cc
index c67e45d..77c7182 100644
--- a/gcc/rust/resolve/rust-early-name-resolver.cc
+++ b/gcc/rust/resolve/rust-early-name-resolver.cc
@@ -477,7 +477,8 @@ EarlyNameResolver::visit (AST::MacroInvocation &invoc)
bool found = resolver.get_macro_scope ().lookup (seg, &resolved_node);
if (!found)
{
- rust_error_at (invoc.get_locus (), "unknown macro: [%s]",
+ rust_error_at (invoc.get_locus (), ErrorCode::E0433,
+ "could not resolve macro invocation %qs",
seg.get ().c_str ());
return;
}