Rollup merge of #88450 - notriddle:notriddle/maybe_whole_expr, r=cjgillot

fix(rustc_parse): correct span in `maybe_whole_expr!`

Fixes #87812
This commit is contained in:
Mara Bos 2021-08-31 10:41:22 +02:00 committed by GitHub
commit 7696aca55f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 64 additions and 2 deletions

View file

@ -41,7 +41,7 @@ macro_rules! maybe_whole_expr {
let path = path.clone();
$p.bump();
return Ok($p.mk_expr(
$p.token.span,
$p.prev_token.span,
ExprKind::Path(None, path),
AttrVec::new(),
));
@ -50,7 +50,7 @@ macro_rules! maybe_whole_expr {
let block = block.clone();
$p.bump();
return Ok($p.mk_expr(
$p.token.span,
$p.prev_token.span,
ExprKind::Block(block, None),
AttrVec::new(),
));