about summary refs log tree commit diff
path: root/src/librustc_parse/parser/expr.rs
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2020-01-11 12:36:15 +0100
committerGitHub <noreply@github.com>2020-01-11 12:36:15 +0100
commit4eee796679bd13e0935c16f41a5e6e2ab0d5c018 (patch)
treefc35ad7fae01337e6873d43c00087dd53c3992db /src/librustc_parse/parser/expr.rs
parent50d76d647191bdff875e854ed2ee2282ab274a09 (diff)
parent883932c6baf7acd28ab712b80ddeda960f6e37da (diff)
downloadrust-4eee796679bd13e0935c16f41a5e6e2ab0d5c018.tar.gz
rust-4eee796679bd13e0935c16f41a5e6e2ab0d5c018.zip
Rollup merge of #68120 - Centril:ban-range-to-dotdotdot, r=oli-obk
Ban `...X` pats, harden tests, and improve diagnostics

Follow up to https://github.com/rust-lang/rust/pull/67258#issuecomment-565656155 and https://github.com/rust-lang/rust/pull/67258#discussion_r357879932.

r? @cramertj @oli-obk
Diffstat (limited to 'src/librustc_parse/parser/expr.rs')
-rw-r--r--src/librustc_parse/parser/expr.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_parse/parser/expr.rs b/src/librustc_parse/parser/expr.rs
index b0c78ad7e4b..dd2b6ab9971 100644
--- a/src/librustc_parse/parser/expr.rs
+++ b/src/librustc_parse/parser/expr.rs
@@ -1966,7 +1966,7 @@ impl<'a> Parser<'a> {
         limits: RangeLimits,
     ) -> PResult<'a, ExprKind> {
         if end.is_none() && limits == RangeLimits::Closed {
-            self.error_inclusive_range_with_no_end(self.token.span);
+            self.error_inclusive_range_with_no_end(self.prev_span);
             Ok(ExprKind::Err)
         } else {
             Ok(ExprKind::Range(start, end, limits))