From: Pierre-Emmanuel Patry Date: Tue, 1 Aug 2023 16:32:46 +0000 (+0200) Subject: gccrs: Supress error with proc macro crates X-Git-Tag: basepoints/gcc-15~2152 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccef457297594c5eadf57ec402122f260c1edc8f;p=thirdparty%2Fgcc.git gccrs: Supress error with proc macro crates This error was emitted when a valid proc macro crate was loaded. Proc macros do not contain any import data for now. gcc/rust/ChangeLog: * metadata/rust-imports.cc (Import::try_package_in_directory): Remove error when some macro are found even if no import data is available. Signed-off-by: Pierre-Emmanuel Patry --- diff --git a/gcc/rust/metadata/rust-imports.cc b/gcc/rust/metadata/rust-imports.cc index fc6bcdb2d95c..17451fbcb9ba 100644 --- a/gcc/rust/metadata/rust-imports.cc +++ b/gcc/rust/metadata/rust-imports.cc @@ -174,9 +174,10 @@ Import::try_package_in_directory (const std::string &filename, close (fd); - rust_error_at (location, - "%s exists but does not contain any Rust export data", - found_filename.c_str ()); + if (macros.empty ()) + rust_error_at (location, + "%s exists but does not contain any Rust export data", + found_filename.c_str ()); return std::make_pair (NULL, macros); }