Preserve yield position during pretty printing
This commit is contained in:
parent
edf65e735c
commit
1c0916a2b3
12 changed files with 55 additions and 18 deletions
|
@ -351,7 +351,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
|||
rest,
|
||||
)
|
||||
}
|
||||
ExprKind::Yield(opt_expr) => self.lower_expr_yield(e.span, opt_expr.as_deref()),
|
||||
ExprKind::Yield(opt_expr, _) => self.lower_expr_yield(e.span, opt_expr.as_deref()),
|
||||
ExprKind::Err(guar) => hir::ExprKind::Err(*guar),
|
||||
|
||||
ExprKind::UnsafeBinderCast(kind, expr, ty) => hir::ExprKind::UnsafeBinderCast(
|
||||
|
|
|
@ -642,7 +642,7 @@ fn may_contain_yield_point(e: &ast::Expr) -> bool {
|
|||
type Result = ControlFlow<()>;
|
||||
|
||||
fn visit_expr(&mut self, e: &ast::Expr) -> ControlFlow<()> {
|
||||
if let ast::ExprKind::Await(_, _) | ast::ExprKind::Yield(_) = e.kind {
|
||||
if let ast::ExprKind::Await(_, _) | ast::ExprKind::Yield(_, _) = e.kind {
|
||||
ControlFlow::Break(())
|
||||
} else {
|
||||
visit::walk_expr(self, e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue