diff options
author | John Hodge <tpg@ucc.asn.au> | 2019-03-24 10:57:31 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2019-03-24 10:58:24 +0800 |
commit | 866ae6ef036fe26026a0247decb2f8cd67aafcd9 (patch) | |
tree | d32078c240938cf56ea9bacba4eebbccb776a8c8 /src/hir/from_ast.cpp | |
parent | 5fd6eeedff9834ba03cffdb6a95d5a38b84eee12 (diff) | |
download | mrust-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.cpp | 6 |
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 ); |