aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-08-01 18:32:46 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 19:04:33 +0100
commitccef457297594c5eadf57ec402122f260c1edc8f (patch)
tree3afd850217342741ae205bb232a50cdf2b0f4d80 /gcc
parent86a3d1582f98dec4f663b1170e2f63bd7c3d2b85 (diff)
downloadgcc-ccef457297594c5eadf57ec402122f260c1edc8f.zip
gcc-ccef457297594c5eadf57ec402122f260c1edc8f.tar.gz
gcc-ccef457297594c5eadf57ec402122f260c1edc8f.tar.bz2
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>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/metadata/rust-imports.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/rust/metadata/rust-imports.cc b/gcc/rust/metadata/rust-imports.cc
index fc6bcdb..17451fbc 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);
}