From 3a360fca78b415d31783ec715a2c9024a89eeb75 Mon Sep 17 00:00:00 2001 From: Marcus Klaas Date: Mon, 31 Aug 2015 00:26:02 +0200 Subject: [PATCH] Fix overly long spans for break and continue The spans of break and continue would include the next token. --- src/libsyntax/parse/parser.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 4966215a9f2d..0772d124db8e 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2149,7 +2149,7 @@ impl<'a> Parser<'a> { } else { ExprAgain(None) }; - let hi = self.span.hi; + let hi = self.last_span.hi; return Ok(self.mk_expr(lo, hi, ex)); } if try!(self.eat_keyword(keywords::Match) ){ @@ -2178,7 +2178,7 @@ impl<'a> Parser<'a> { } else { ex = ExprBreak(None); } - hi = self.span.hi; + hi = self.last_span.hi; } else if self.check(&token::ModSep) || self.token.is_ident() && !self.check_keyword(keywords::True) &&