diff options
| author | Seo Sanghyeon <sanxiyn@gmail.com> | 2016-05-17 20:37:07 +0900 |
|---|---|---|
| committer | Seo Sanghyeon <sanxiyn@gmail.com> | 2016-05-17 20:37:07 +0900 |
| commit | 0f257df31a1c7684f8d1824a4b0e776236d23a0e (patch) | |
| tree | fa718a21711ac71b092cf6fb20526ef25ff8ef21 | |
| parent | 786b26d7b48accffc638f8c2767a6e4a6f1991a5 (diff) | |
| download | rust-0f257df31a1c7684f8d1824a4b0e776236d23a0e.tar.gz rust-0f257df31a1c7684f8d1824a4b0e776236d23a0e.zip | |
Preserve span when lowering ExprKind::Paren
| -rw-r--r-- | src/librustc/hir/lowering.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs index 0c3c190064b..ea47b0924bc 100644 --- a/src/librustc/hir/lowering.rs +++ b/src/librustc/hir/lowering.rs @@ -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()) }); |
