diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-10-03 07:38:12 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-10-03 07:38:12 -0700 |
| commit | 2a11f2b5440444181e20c3b4f2b0a01eb9fec385 (patch) | |
| tree | 77b87ee2f622bd04e6904d35dd784a4f807a52d2 /src/libsyntax/parse/parser.rs | |
| parent | 9a2286d3a13c4a97340c99c86c718654f6cb2ed6 (diff) | |
| parent | a667a6917b2be3bad44a625badcc11293a97910b (diff) | |
| download | rust-2a11f2b5440444181e20c3b4f2b0a01eb9fec385.tar.gz rust-2a11f2b5440444181e20c3b4f2b0a01eb9fec385.zip | |
rollup merge of #17215 : P1start/lints
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 7cce9c2dc3a..d2735a425f5 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -3402,9 +3402,10 @@ impl<'a> Parser<'a> { binding_mode: ast::BindingMode) -> ast::Pat_ { if !is_plain_ident(&self.token) { - let last_span = self.last_span; - self.span_fatal(last_span, - "expected identifier, found path"); + let span = self.span; + let tok_str = self.this_token_to_string(); + self.span_fatal(span, + format!("expected identifier, found `{}`", tok_str).as_slice()); } let ident = self.parse_ident(); let last_span = self.last_span; |
