about summary refs log tree commit diff
path: root/src/libsyntax/parse/token.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-01-20 08:26:12 +0000
committerbors <bors@rust-lang.org>2019-01-20 08:26:12 +0000
commit2ab5d8ac447f1f3f865dbae5bafbdeacacdea6d9 (patch)
tree277e74cb41d08c97b79f8b372ed0b35cb719581d /src/libsyntax/parse/token.rs
parent588f94b37d020aefe54b0c00ced2fdd7ccc61dfb (diff)
parent4005d3a8cb082f84f6bfb8c2168387a747aabf1e (diff)
downloadrust-2ab5d8ac447f1f3f865dbae5bafbdeacacdea6d9.tar.gz
rust-2ab5d8ac447f1f3f865dbae5bafbdeacacdea6d9.zip
Auto merge of #57651 - JohnTitor:give-char-type, r=estebank
Implement new literal type `Err`

Fixes #57384

I removed `return Ok`, otherwise, two errors occur. Any solutions?

r? @estebank
Diffstat (limited to 'src/libsyntax/parse/token.rs')
-rw-r--r--src/libsyntax/parse/token.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index 25a4da38c8c..f06e975a6d9 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -60,6 +60,7 @@ impl DelimToken {
 pub enum Lit {
     Byte(ast::Name),
     Char(ast::Name),
+    Err(ast::Name),
     Integer(ast::Name),
     Float(ast::Name),
     Str_(ast::Name),
@@ -73,6 +74,7 @@ impl Lit {
         match *self {
             Byte(_) => "byte literal",
             Char(_) => "char literal",
+            Err(_) => "invalid literal",
             Integer(_) => "integer literal",
             Float(_) => "float literal",
             Str_(_) | StrRaw(..) => "string literal",
@@ -471,8 +473,7 @@ impl Token {
 
             Le | EqEq | Ne | Ge | AndAnd | OrOr | Tilde | BinOpEq(..) | At | DotDotDot |
             DotDotEq | Comma | Semi | ModSep | RArrow | LArrow | FatArrow | Pound | Dollar |
-            Question | OpenDelim(..) | CloseDelim(..) => return None,
-
+            Question | OpenDelim(..) | CloseDelim(..) |
             Literal(..) | Ident(..) | Lifetime(..) | Interpolated(..) | DocComment(..) |
             Whitespace | Comment | Shebang(..) | Eof => return None,
         })