summaryrefslogtreecommitdiff
path: root/src/expand/derive.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2017-11-12 21:14:29 +0800
committerJohn Hodge <tpg@ucc.asn.au>2017-11-12 21:14:29 +0800
commit853fad9d38c97823d606711fc43d7567dd89d780 (patch)
treeae8fe788680af992cafb67836dd6ba65a075400f /src/expand/derive.cpp
parent1392ffdbf7a682222b99304946253aa0b70b8dc5 (diff)
downloadmrust-853fad9d38c97823d606711fc43d7567dd89d780.tar.gz
Expand derive - Mark success if a proc_macro applied
Diffstat (limited to 'src/expand/derive.cpp')
-rw-r--r--src/expand/derive.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/expand/derive.cpp b/src/expand/derive.cpp
index d0328e98..25cc6742 100644
--- a/src/expand/derive.cpp
+++ b/src/expand/derive.cpp
@@ -2215,6 +2215,7 @@ static void derive_item(const Span& sp, const AST::Crate& crate, AST::Module& mo
// Support custom derive
auto mac_name = FMT("derive#" << trait.name());
// - Requires support all through the chain.
+ bool found = false;
for(const auto& mac_path : mod.m_macro_imports)
{
if( mac_path.first.back() == mac_name )
@@ -2227,9 +2228,13 @@ static void derive_item(const Span& sp, const AST::Crate& crate, AST::Module& mo
// proc_macro - Invoke the handler.
auto lex = ProcMacro_Invoke(sp, crate, mac_path.first, path.nodes().back().name(), item);
Parse_ModRoot_Items(*lex, mod);
+ found = true;
+ break;
}
}
}
+ if( found )
+ continue ;
DEBUG("> No handler for " << trait.name());
missing_handlers.push_back( trait.name() );