Teach rustfmt to handle postfix yield
This involved fixing the span when parsing .yield
This commit is contained in:
parent
c5093ac122
commit
9b0e7f6264
5 changed files with 23 additions and 24 deletions
|
@ -1315,9 +1315,8 @@ impl<'a> Parser<'a> {
|
|||
if self.eat_keyword(exp!(Yield)) {
|
||||
let yield_span = self.prev_token.span;
|
||||
self.psess.gated_spans.gate(sym::yield_expr, yield_span);
|
||||
return Ok(
|
||||
self.mk_expr(yield_span, ExprKind::Yield(Some(self_arg), YieldKind::Postfix))
|
||||
);
|
||||
return Ok(self
|
||||
.mk_expr(lo.to(yield_span), ExprKind::Yield(Some(self_arg), YieldKind::Postfix)));
|
||||
}
|
||||
|
||||
let fn_span_lo = self.token.span;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue