diff options
author | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2023-06-15 16:37:07 +0200 |
---|---|---|
committer | P-E-P <32375388+P-E-P@users.noreply.github.com> | 2023-07-21 09:06:09 +0000 |
commit | 5539f28018b492b68db4c1b6af0c4fe3acbfb19f (patch) | |
tree | e4029617c482e378d2b067003bfb6008391671d9 /gcc/rust/expand | |
parent | 071e02ed91dffe4d85bb1f21ef96ad8061486aa9 (diff) | |
download | gcc-5539f28018b492b68db4c1b6af0c4fe3acbfb19f.zip gcc-5539f28018b492b68db4c1b6af0c4fe3acbfb19f.tar.gz gcc-5539f28018b492b68db4c1b6af0c4fe3acbfb19f.tar.bz2 |
import: Load procedural macros into external crate
Load the procedural macro array into the external crate structure.
gcc/rust/ChangeLog:
* metadata/rust-imports.cc (Import::try_package_in_directory):
Add call to load macros before loading metadatas.
* expand/rust-proc-macro.cc: Return empty vector instead of
panicking on error.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc/rust/expand')
-rw-r--r-- | gcc/rust/expand/rust-proc-macro.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/rust/expand/rust-proc-macro.cc b/gcc/rust/expand/rust-proc-macro.cc index 6ba87b6..acd7f71 100644 --- a/gcc/rust/expand/rust-proc-macro.cc +++ b/gcc/rust/expand/rust-proc-macro.cc @@ -115,7 +115,7 @@ load_macros (std::string path) const ProcMacro::ProcmacroArray *array = load_macros_array (path); // Did not load the proc macro if (array == nullptr) - rust_unreachable (); + return {}; rust_debug ("Found %lu procedural macros", array->length); |