summary refs log tree commit diff
path: root/src/libsyntax/ast.rs
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2016-04-20 14:44:07 -0400
committerManish Goregaokar <manishsmail@gmail.com>2016-04-24 18:10:57 +0530
commitecd10f04cea34352ff240b0462d40cd1d95a4e0f (patch)
treefb7f1f7adc4a1044d3a9316631fef61e46ce984b /src/libsyntax/ast.rs
parent23ccaddaa7d1cb71e49ef1b1f423b3245fa3a879 (diff)
downloadrust-ecd10f04cea34352ff240b0462d40cd1d95a4e0f.tar.gz
rust-ecd10f04cea34352ff240b0462d40cd1d95a4e0f.zip
thread tighter span for closures around
Track the span corresponding to the `|...|` part of the closure.
Diffstat (limited to 'src/libsyntax/ast.rs')
-rw-r--r--src/libsyntax/ast.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index df9f935446d..dc59d475286 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -986,7 +986,9 @@ pub enum ExprKind {
     /// A `match` block.
     Match(P<Expr>, Vec<Arm>),
     /// A closure (for example, `move |a, b, c| {a + b + c}`)
-    Closure(CaptureBy, P<FnDecl>, P<Block>),
+    ///
+    /// The final span is the span of the argument block `|...|`
+    Closure(CaptureBy, P<FnDecl>, P<Block>, Span),
     /// A block (`{ ... }`)
     Block(P<Block>),