about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser/expr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsyntax/parse/parser/expr.rs')
-rw-r--r--src/libsyntax/parse/parser/expr.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser/expr.rs b/src/libsyntax/parse/parser/expr.rs
index 97b1092452a..80ea8f380fb 100644
--- a/src/libsyntax/parse/parser/expr.rs
+++ b/src/libsyntax/parse/parser/expr.rs
@@ -1116,7 +1116,11 @@ impl<'a> Parser<'a> {
                 Err(self.span_fatal(token.span, &msg))
             }
             Err(err) => {
-                let (lit, span) = (token.expect_lit(), token.span);
+                let span = token.span;
+                let lit = match token.kind {
+                    token::Literal(lit) => lit,
+                    _ => unreachable!(),
+                };
                 self.bump();
                 self.error_literal_from_token(err, lit, span);
                 // Pack possible quotes and prefixes from the original literal into