summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/expand/mod.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/expand/mod.cpp b/src/expand/mod.cpp
index 4dfd1224..f63f7ab5 100644
--- a/src/expand/mod.cpp
+++ b/src/expand/mod.cpp
@@ -1188,6 +1188,15 @@ void Expand_Mod(::AST::Crate& crate, LList<const AST::Module*> modstack, ::AST::
)
Expand_Attrs(var.m_attrs, AttrStage::Post, [&](const auto& sp, const auto& d, const auto& a){ d.handle(sp, a, crate, var); });
}
+ // Handle cfg on variants (kinda hacky)
+ for(auto it = e.variants().begin(); it != e.variants().end(); ) {
+ if( it->m_name == "" ) {
+ it = e.variants().erase(it);
+ }
+ else {
+ ++ it;
+ }
+ }
),
(Union,
Expand_GenericParams(crate, modstack, mod, e.m_params);