summaryrefslogtreecommitdiff
path: root/src/hir/from_ast.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2019-03-24 10:57:31 +0800
committerJohn Hodge <tpg@ucc.asn.au>2019-03-24 10:58:24 +0800
commit866ae6ef036fe26026a0247decb2f8cd67aafcd9 (patch)
treed32078c240938cf56ea9bacba4eebbccb776a8c8 /src/hir/from_ast.cpp
parent5fd6eeedff9834ba03cffdb6a95d5a38b84eee12 (diff)
downloadmrust-866ae6ef036fe26026a0247decb2f8cd67aafcd9.tar.gz
HIR Macro Export - Hacky workarounds and defensive asserts with macro exports
Diffstat (limited to 'src/hir/from_ast.cpp')
-rw-r--r--src/hir/from_ast.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/hir/from_ast.cpp b/src/hir/from_ast.cpp
index fb8096f7..014b744c 100644
--- a/src/hir/from_ast.cpp
+++ b/src/hir/from_ast.cpp
@@ -1834,6 +1834,9 @@ public:
auto res = macros.insert( mv$(v) );
DEBUG("- Import " << mac.name << "! (from \"" << res.first->second->m_source_crate << "\")");
}
+ else if( v.second->m_rules.empty() ) {
+ // Skip
+ }
else {
DEBUG("- Replace " << mac.name << "! (from \"" << it->second->m_source_crate << "\") with one from \"" << v.second->m_source_crate << "\"");
it->second = mv$( v.second );
@@ -1853,6 +1856,9 @@ public:
auto res = macros.insert( mv$(v) );
DEBUG("- Import " << mac.name << "! (from \"" << res.first->second->m_source_crate << "\")");
}
+ else if( v.second->m_rules.empty() ) {
+ // Skip
+ }
else {
DEBUG("- Replace " << mac.name << "! (from \"" << it->second->m_source_crate << "\") with one from \"" << v.second->m_source_crate << "\"");
it->second = mv$( v.second );