[gcc r15-8396] gccrs: early: Do not emit errors for unresolved imports, store them instead
Arthur Cohen
cohenarthur@gcc.gnu.org
Wed Mar 19 14:42:50 GMT 2025
https://gcc.gnu.org/g:924446743f6e21efa745ec1b051e9f37887e32f9
commit r15-8396-g924446743f6e21efa745ec1b051e9f37887e32f9
Author: Arthur Cohen <arthur.cohen@embecosm.com>
Date: Sat Apr 6 23:23:39 2024 +0200
gccrs: early: Do not emit errors for unresolved imports, store them instead
gcc/rust/ChangeLog:
* resolve/rust-early-name-resolver-2.0.cc (Early::visit_attributes):
Store errors for later.
Diff:
---
gcc/rust/resolve/rust-early-name-resolver-2.0.cc | 15 +++++++++------
1 file changed, 9 insertions(+), 6 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 ac8eb940c8d5..47582a6f339a 100644
--- a/gcc/rust/resolve/rust-early-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-early-name-resolver-2.0.cc
@@ -161,8 +161,9 @@ Early::build_import_mapping (
}
if (!found)
- rust_error_at (path.get_final_segment ().get_locus (), ErrorCode::E0433,
- "unresolved import %qs", path.as_string ().c_str ());
+ collect_error (Error (path.get_final_segment ().get_locus (),
+ ErrorCode::E0433, "unresolved import %qs",
+ path.as_string ().c_str ()));
}
}
@@ -303,8 +304,9 @@ Early::visit_attributes (std::vector<AST::Attribute> &attrs)
if (!definition.has_value ())
{
// FIXME: Change to proper error message
- rust_error_at (trait.get ().get_locus (),
- "could not resolve trait");
+ collect_error (Error (trait.get ().get_locus (),
+ "could not resolve trait %qs",
+ trait.get ().as_string ().c_str ()));
continue;
}
@@ -326,8 +328,9 @@ Early::visit_attributes (std::vector<AST::Attribute> &attrs)
if (!definition.has_value ())
{
// FIXME: Change to proper error message
- rust_error_at (attr.get_locus (),
- "could not resolve attribute macro invocation");
+ collect_error (
+ Error (attr.get_locus (),
+ "could not resolve attribute macro invocation"));
return;
}
auto pm_def = mappings.lookup_attribute_proc_macro_def (
More information about the Gcc-cvs
mailing list