summaryrefslogtreecommitdiff
path: root/src/expand/mod.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2019-10-06 15:21:42 +0800
committerJohn Hodge <tpg@ucc.asn.au>2019-10-06 15:21:42 +0800
commit16bd8829c108000e0d52d76329b88ab9e6a34e12 (patch)
tree12ebefa87f9c2b16f25dbc6988706383caff1bc1 /src/expand/mod.cpp
parenta110ad4d5ea36b33ec4e0045513baf952f297f6f (diff)
downloadmrust-16bd8829c108000e0d52d76329b88ab9e6a34e12.tar.gz
Expand - Hand attributes to item attribute handlers
Diffstat (limited to 'src/expand/mod.cpp')
-rw-r--r--src/expand/mod.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/expand/mod.cpp b/src/expand/mod.cpp
index 2e0d8b97..f19acda7 100644
--- a/src/expand/mod.cpp
+++ b/src/expand/mod.cpp
@@ -86,7 +86,8 @@ void Expand_Attrs_CfgAttr(AST::AttributeList& attrs)
auto& a = *it;
if( a.name() == "cfg_attr" ) {
if( check_cfg(a.span(), a.items().at(0)) ) {
- a = mv$(a.items().at(1));
+ auto inner_attr = mv$(a.items().at(1));
+ a = mv$(inner_attr);
++ it;
}
else {
@@ -103,7 +104,7 @@ void Expand_Attrs(const ::AST::AttributeList& attrs, AttrStage stage, ::AST::Cr
Expand_Attrs(attrs, stage, [&](const auto& sp, const auto& d, const auto& a){
if(!item.is_None()) {
// TODO: Pass attributes _after_ this attribute
- d.handle(sp, a, crate, path, mod, item/*, attrs*/);
+ d.handle(sp, a, crate, path, mod, slice<const AST::Attribute>(&a, &attrs.m_items.back() - &a), item);
}
});
}