summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/hir/serialise.cpp13
-rw-r--r--src/main.cpp8
2 files changed, 18 insertions, 3 deletions
diff --git a/src/hir/serialise.cpp b/src/hir/serialise.cpp
index c31c84fc..455d49ef 100644
--- a/src/hir/serialise.cpp
+++ b/src/hir/serialise.cpp
@@ -272,7 +272,18 @@ namespace {
}
serialise_strmap(crate.m_exported_macros);
- serialise_strmap(crate.m_lang_items);
+ {
+ decltype(crate.m_lang_items) lang_items_filtered;
+ for(const auto& ent : crate.m_lang_items)
+ {
+ if(ent.second.m_crate_name == "" || ent.second.m_crate_name == crate.m_crate_name)
+ {
+ ::std::cerr << "Lang item " << ent << ::std::endl;
+ lang_items_filtered.insert(ent);
+ }
+ }
+ serialise_strmap(lang_items_filtered);
+ }
m_out.write_count(crate.m_ext_crates.size());
for(const auto& ext : crate.m_ext_crates)
diff --git a/src/main.cpp b/src/main.cpp
index af82d549..a07cddd2 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -365,7 +365,9 @@ int main(int argc, char *argv[])
if( crate.m_crate_type == ::AST::Crate::Type::Executable || params.test_harness || crate.m_crate_type == ::AST::Crate::Type::ProcMacro )
{
bool allocator_crate_loaded = false;
+ ::std::string alloc_crate_name;
bool panic_runtime_loaded = false;
+ ::std::string panic_crate_name;
bool panic_runtime_needed = false;
for(const auto& ec : crate.m_extern_crates)
{
@@ -376,15 +378,17 @@ int main(int argc, char *argv[])
if(ec.second.m_hir->m_lang_items.count("mrustc-allocator"))
{
if( allocator_crate_loaded ) {
- ERROR(Span(), E0000, "Multiple allocator crates loaded");
+ ERROR(Span(), E0000, "Multiple allocator crates loaded - " << alloc_crate_name << " and " << ec.first);
}
+ alloc_crate_name = ec.first;
allocator_crate_loaded = true;
}
if(ec.second.m_hir->m_lang_items.count("mrustc-panic_runtime"))
{
if( panic_runtime_loaded ) {
- ERROR(Span(), E0000, "Multiple panic_runtime crates loaded");
+ ERROR(Span(), E0000, "Multiple panic_runtime crates loaded - " << panic_crate_name << " and " << ec.first);
}
+ panic_crate_name = ec.first;
panic_runtime_loaded = true;
}
if(ec.second.m_hir->m_lang_items.count("mrustc-needs_panic_runtime"))