aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2024-04-06 23:23:39 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2025-03-19 15:32:13 +0100
commit924446743f6e21efa745ec1b051e9f37887e32f9 (patch)
treee56edbe583274cff9e0bae5bcf2855accf02a6c4
parent9047b32383a05b5ef5909de5eed35a0cd3c9a76a (diff)
downloadgcc-924446743f6e21efa745ec1b051e9f37887e32f9.zip
gcc-924446743f6e21efa745ec1b051e9f37887e32f9.tar.gz
gcc-924446743f6e21efa745ec1b051e9f37887e32f9.tar.bz2
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.
-rw-r--r--gcc/rust/resolve/rust-early-name-resolver-2.0.cc15
1 files 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 ac8eb94..47582a6 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 (