thread tighter span for closures around
Track the span corresponding to the `|...|` part of the closure.
This commit is contained in:
committed by
Manish Goregaokar
parent
23ccaddaa7
commit
ecd10f04ce
@@ -1241,10 +1241,11 @@ pub fn noop_fold_expr<T: Folder>(Expr {id, node, span, attrs}: Expr, folder: &mu
|
||||
ExprKind::Match(folder.fold_expr(expr),
|
||||
arms.move_map(|x| folder.fold_arm(x)))
|
||||
}
|
||||
ExprKind::Closure(capture_clause, decl, body) => {
|
||||
ExprKind::Closure(capture_clause, decl, body, span) => {
|
||||
ExprKind::Closure(capture_clause,
|
||||
folder.fold_fn_decl(decl),
|
||||
folder.fold_block(body))
|
||||
folder.fold_fn_decl(decl),
|
||||
folder.fold_block(body),
|
||||
folder.new_span(span))
|
||||
}
|
||||
ExprKind::Block(blk) => ExprKind::Block(folder.fold_block(blk)),
|
||||
ExprKind::Assign(el, er) => {
|
||||
|
||||
Reference in New Issue
Block a user