summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-08-27 21:09:47 +0800
committerJohn Hodge <tpg@mutabah.net>2016-08-27 21:09:47 +0800
commitd2f604f09befa888dd9a8915189c8928053ae908 (patch)
treeb84d12aba874aca364176862d837410db89e1377
parent87c547878f2907787acca9f7113e5b07849887b9 (diff)
downloadmrust-d2f604f09befa888dd9a8915189c8928053ae908.tar.gz
Expand - Import macros from std/core
-rw-r--r--src/expand/mod.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/expand/mod.cpp b/src/expand/mod.cpp
index 5fd91c48..b57c852c 100644
--- a/src/expand/mod.cpp
+++ b/src/expand/mod.cpp
@@ -854,11 +854,17 @@ void Expand(::AST::Crate& crate)
if( crate.m_prelude_path != AST::Path() )
crate.m_prelude_path = AST::Path("std", {AST::PathNode("prelude"), AST::PathNode("v1")});
crate.load_extern_crate("std");
+ crate.m_extern_crates.at("std").with_all_macros([&](const auto& name, const auto& mac) {
+ crate.m_root_module.add_macro_import( name, mac );
+ });
break;
case ::AST::Crate::LOAD_CORE:
if( crate.m_prelude_path != AST::Path() )
crate.m_prelude_path = AST::Path("core", {AST::PathNode("prelude")});
crate.load_extern_crate("core");
+ crate.m_extern_crates.at("core").with_all_macros([&](const auto& name, const auto& mac) {
+ crate.m_root_module.add_macro_import( name, mac );
+ });
break;
case ::AST::Crate::LOAD_NONE:
break;