public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-7987] gccrs: Supress error with proc macro crates
@ 2024-01-16 18:11 Arthur Cohen
0 siblings, 0 replies; only message in thread
From: Arthur Cohen @ 2024-01-16 18:11 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:ccef457297594c5eadf57ec402122f260c1edc8f
commit r14-7987-gccef457297594c5eadf57ec402122f260c1edc8f
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date: Tue Aug 1 18:32:46 2023 +0200
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 <pierre-emmanuel.patry@embecosm.com>
Diff:
---
gcc/rust/metadata/rust-imports.cc | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/gcc/rust/metadata/rust-imports.cc b/gcc/rust/metadata/rust-imports.cc
index fc6bcdb2d95..17451fbcb9b 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);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-01-16 18:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-16 18:11 [gcc r14-7987] gccrs: Supress error with proc macro crates Arthur Cohen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).