Skip to content

Commit

Permalink
Preserve span when lowering ExprKind::Paren
Browse files Browse the repository at this point in the history
  • Loading branch information
sanxiyn committed May 17, 2016
1 parent 786b26d commit 0f257df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/librustc/hir/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1260,8 +1260,9 @@ impl<'a> LoweringContext<'a> {
maybe_expr.as_ref().map(|x| self.lower_expr(x)))
}
ExprKind::Paren(ref ex) => {
// merge attributes into the inner expression.
return self.lower_expr(ex).map(|mut ex| {
ex.span = e.span;
// merge attributes into the inner expression.
ex.attrs.update(|attrs| {
attrs.prepend(e.attrs.clone())
});
Expand Down

0 comments on commit 0f257df

Please sign in to comment.