diff options
| author | Georg Brandl <georg@python.org> | 2016-05-02 18:22:03 +0200 |
|---|---|---|
| committer | Georg Brandl <g.brandl@fz-juelich.de> | 2016-05-24 14:22:14 +0200 |
| commit | 2e812e10f4ece10d90ae3315aba16b88c5e870eb (patch) | |
| tree | 1830b86f86bf0bee4561763cbe4b1a4f183e1a3d /src/libsyntax/ast.rs | |
| parent | dd6e8d45e183861d44ed91a99f0a50403b2776a3 (diff) | |
| download | rust-2e812e10f4ece10d90ae3315aba16b88c5e870eb.tar.gz rust-2e812e10f4ece10d90ae3315aba16b88c5e870eb.zip | |
syntax/hir: give loop labels a span
This makes the "shadowing labels" warning *not* print the entire loop as a span, but only the lifetime. Also makes #31719 go away, but does not fix its root cause (the span of the expanded loop is still wonky, but not used anymore).
Diffstat (limited to 'src/libsyntax/ast.rs')
| -rw-r--r-- | src/libsyntax/ast.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index d9409d3bbd9..4a94d8b01a3 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -1007,23 +1007,23 @@ pub enum ExprKind { /// A while loop, with an optional label /// /// `'label: while expr { block }` - While(P<Expr>, P<Block>, Option<Ident>), + While(P<Expr>, P<Block>, Option<SpannedIdent>), /// A while-let loop, with an optional label /// /// `'label: while let pat = expr { block }` /// /// This is desugared to a combination of `loop` and `match` expressions. - WhileLet(P<Pat>, P<Expr>, P<Block>, Option<Ident>), + WhileLet(P<Pat>, P<Expr>, P<Block>, Option<SpannedIdent>), /// A for loop, with an optional label /// /// `'label: for pat in expr { block }` /// /// This is desugared to a combination of `loop` and `match` expressions. - ForLoop(P<Pat>, P<Expr>, P<Block>, Option<Ident>), + ForLoop(P<Pat>, P<Expr>, P<Block>, Option<SpannedIdent>), /// Conditionless loop (can be exited with break, continue, or return) /// /// `'label: loop { block }` - Loop(P<Block>, Option<Ident>), + Loop(P<Block>, Option<SpannedIdent>), /// A `match` block. Match(P<Expr>, Vec<Arm>), /// A closure (for example, `move |a, b, c| {a + b + c}`) |
