From: Arthur Cohen Date: Sat, 6 Apr 2024 21:23:39 +0000 (+0200) Subject: early: Do not emit errors for unresolved imports, store them instead X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c67b14ccc5b4ab16c237b448633a8e8718644153;p=thirdparty%2Fgcc.git 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 --git a/gcc/rust/resolve/rust-early-name-resolver-2.0.cc b/gcc/rust/resolve/rust-early-name-resolver-2.0.cc index 8bd351571fc3..6c5446a4f95e 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 &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 &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 (