Rollup merge of #78794 - est31:collect_bang, r=oli-obk

rustc_expand: use collect_bang helper instead of manual reimplementation
This commit is contained in:
Yuki Okushi 2020-11-07 01:02:26 +09:00 committed by GitHub
commit 09a40af85e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1436,9 +1436,9 @@ impl<'a, 'b> MutVisitor for InvocationCollector<'a, 'b> {
item.attrs = attrs;
self.check_attributes(&item.attrs);
item.and_then(|item| match item.kind {
ItemKind::MacCall(mac) => self
.collect(AstFragmentKind::Items, InvocationKind::Bang { mac, span })
.make_items(),
ItemKind::MacCall(mac) => {
self.collect_bang(mac, span, AstFragmentKind::Items).make_items()
}
_ => unreachable!(),
})
}