Skip to content

Commit 0f257df

Browse files
committed
Preserve span when lowering ExprKind::Paren
1 parent 786b26d commit 0f257df

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/librustc/hir/lowering.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1260,8 +1260,9 @@ impl<'a> LoweringContext<'a> {
12601260
maybe_expr.as_ref().map(|x| self.lower_expr(x)))
12611261
}
12621262
ExprKind::Paren(ref ex) => {
1263-
// merge attributes into the inner expression.
12641263
return self.lower_expr(ex).map(|mut ex| {
1264+
ex.span = e.span;
1265+
// merge attributes into the inner expression.
12651266
ex.attrs.update(|attrs| {
12661267
attrs.prepend(e.attrs.clone())
12671268
});

0 commit comments

Comments
 (0)