diff options
Diffstat (limited to 'src/expand')
-rw-r--r-- | src/expand/derive.cpp | 6 | ||||
-rw-r--r-- | src/expand/macro_rules.cpp | 4 | ||||
-rw-r--r-- | src/expand/mod.cpp | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/expand/derive.cpp b/src/expand/derive.cpp index 5e97c888..a03992da 100644 --- a/src/expand/derive.cpp +++ b/src/expand/derive.cpp @@ -2236,15 +2236,15 @@ static void derive_item(const Span& sp, const AST::Crate& crate, AST::Module& mo bool found = false; for(const auto& mac_path : mod.m_macro_imports) { - if( mac_path.first.back() == mac_name ) + if( mac_path.name == mac_name ) { - if( mac_path.second ) { + if( mac_path.macro_ptr ) { // macro_rules! based derive? TODO(sp, "Custom derive using macro_rules?"); } else { // proc_macro - Invoke the handler. - auto lex = ProcMacro_Invoke(sp, crate, mac_path.first, path.nodes().back().name(), item); + auto lex = ProcMacro_Invoke(sp, crate, mac_path.path, path.nodes().back().name(), item); if( lex ) { Parse_ModRoot_Items(*lex, mod); diff --git a/src/expand/macro_rules.cpp b/src/expand/macro_rules.cpp index 89f394e1..3bacfcf7 100644 --- a/src/expand/macro_rules.cpp +++ b/src/expand/macro_rules.cpp @@ -61,8 +61,8 @@ class CMacroUseHandler: }); for(const auto& p : ec.m_hir->m_proc_macros) { - mod.m_macro_imports.push_back(::std::make_pair( p.path.m_components, nullptr )); - mod.m_macro_imports.back().first.insert( mod.m_macro_imports.back().first.begin(), p.path.m_crate_name ); + mod.m_macro_imports.push_back({ false, p.path.m_components.back(), p.path.m_components, nullptr }); + mod.m_macro_imports.back().path.insert( mod.m_macro_imports.back().path.begin(), p.path.m_crate_name ); } } ) diff --git a/src/expand/mod.cpp b/src/expand/mod.cpp index 34c47455..4dfd1224 100644 --- a/src/expand/mod.cpp +++ b/src/expand/mod.cpp @@ -1044,7 +1044,7 @@ void Expand_Mod(::AST::Crate& crate, LList<const AST::Module*> modstack, ::AST:: } } for( const auto& mi: mod.m_macro_imports ) - DEBUG("- Imports '" << mi.first << "'"); + DEBUG("- Imports '" << mi.path << "'"); } // Insert prelude if: Enabled for this module, present for the crate, and this module is not an anon |