1
Fork 0

Unconditionally capture tokens for attributes.

This allows us to avoid synthesizing tokens in `prepend_attr`, since we
have the original tokens available.

We still need to synthesize tokens when expanding `cfg_attr`,
but this is an unavoidable consequence of the syntax of `cfg_attr` -
the user does not supply the `#` and `[]` tokens that a `cfg_attr`
expands to.
This commit is contained in:
Aaron Hill 2020-09-26 19:33:42 -04:00
parent 1eaadebb3d
commit b9b2546417
No known key found for this signature in database
GPG key ID: B4087E510E98B164
15 changed files with 153 additions and 120 deletions

View file

@ -1785,6 +1785,7 @@ impl<'a, 'b> MutVisitor for InvocationCollector<'a, 'b> {
span: at.span,
id: at.id,
style: at.style,
tokens: None,
};
} else {
noop_visit_attribute(at, self)