thread tighter span for closures around

Track the span corresponding to the `|...|` part of the closure.
This commit is contained in:
Niko Matsakis
2016-04-20 14:44:07 -04:00
committed by Manish Goregaokar
parent 23ccaddaa7
commit ecd10f04ce
29 changed files with 87 additions and 53 deletions

View File

@@ -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) => {