Don't create an empty LazyTokenStream

This commit is contained in:
Aaron Hill 2020-10-22 10:09:08 -04:00
parent 37b25e8a49
commit 920bed1213
No known key found for this signature in database
GPG key ID: B4087E510E98B164
5 changed files with 25 additions and 19 deletions

View file

@ -1116,7 +1116,7 @@ impl<'a> Parser<'a> {
) -> PResult<'a, P<Expr>> {
if needs_tokens {
let (mut expr, tokens) = self.collect_tokens(f)?;
expr.tokens = Some(tokens);
expr.tokens = tokens;
Ok(expr)
} else {
f(self)