rustc_expand: use collect_bang helper instead of manual reimplementation

This commit is contained in:
est31 2020-11-06 02:46:03 +01:00
parent f7801d6c7c
commit de2940ff63

View File

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