about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-03-24 18:58:12 +0000
committerbors <bors@rust-lang.org>2018-03-24 18:58:12 +0000
commitf5631d9ac7745dd6eaea2bc6c236d5f8e54e9a18 (patch)
treedb5927a083fccf48ef3cd9b3b9f5325114a944fc /src/libsyntax/parse
parentb4aa80dd73df9708022cc383aad8da1dcf38d1df (diff)
parent297a6e580d4057b665f866e4d37069583d12c8c2 (diff)
downloadrust-f5631d9ac7745dd6eaea2bc6c236d5f8e54e9a18.tar.gz
rust-f5631d9ac7745dd6eaea2bc6c236d5f8e54e9a18.zip
Auto merge of #49337 - kennytm:rollup, r=kennytm
Rollup of 21 pull requests

- Successful merges: #49046, #49076, #49089, #49120, #49121, #49122, #49162, #49193, #49194, #49203, #49229, #49235, #49254, #49268, #49273, #49274, #49290, #49312, #49314, #49318, #49299
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index a07279acae2..98e2528d30f 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -3675,7 +3675,13 @@ impl<'a> Parser<'a> {
                 if self.token != token::CloseDelim(token::Brace) {
                     let token_str = self.this_token_to_string();
                     let mut err = self.fatal(&format!("expected `{}`, found `{}`", "}", token_str));
-                    err.span_label(self.span, "expected `}`");
+                    if self.token == token::Comma { // Issue #49257
+                        err.span_label(self.span,
+                                       "`..` must be in the last position, \
+                                        and cannot have a trailing comma");
+                    } else {
+                        err.span_label(self.span, "expected `}`");
+                    }
                     return Err(err);
                 }
                 etc = true;