diff options
author | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-04-06 23:23:39 +0200 |
---|---|---|
committer | P-E-P <32375388+P-E-P@users.noreply.github.com> | 2024-09-26 22:48:32 +0000 |
commit | c67b14ccc5b4ab16c237b448633a8e8718644153 (patch) | |
tree | ab4f4b2144cb72e1bdfbc37aecf6cf737ccb0bd8 /gcc | |
parent | bd669c43f256ebc5e5d565ec66504c955a34d8e1 (diff) | |
download | gcc-c67b14ccc5b4ab16c237b448633a8e8718644153.zip gcc-c67b14ccc5b4ab16c237b448633a8e8718644153.tar.gz gcc-c67b14ccc5b4ab16c237b448633a8e8718644153.tar.bz2 |
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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/resolve/rust-early-name-resolver-2.0.cc | 15 |
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 8bd3515..6c5446a 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 ( |