]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax/parse/token.rs
parser: allow ABIs from literal macro fragments
[rust.git] / src / libsyntax / parse / token.rs
index 03e77b199cc3bacd754cbc24aafce912b149a84e..6f3da344ccf88e6cc7a5857d809dcef8a3fcda56 100644 (file)
@@ -381,9 +381,7 @@ pub fn can_begin_type(&self) -> bool {
         match self.kind {
             OpenDelim(Brace) => true,
             Interpolated(ref nt) => match **nt {
-                NtExpr(..) => true,
-                NtBlock(..) => true,
-                NtLiteral(..) => true,
+                NtExpr(..) | NtBlock(..) | NtLiteral(..) => true,
                 _ => false,
             }
             _ => self.can_begin_literal_or_bool(),
@@ -404,13 +402,6 @@ pub fn is_lit(&self) -> bool {
         }
     }
 
-    crate fn expect_lit(&self) -> Lit {
-        match self.kind {
-            Literal(lit) => lit,
-            _ => panic!("`expect_lit` called on non-literal"),
-        }
-    }
-
     /// Returns `true` if the token is any literal, a minus (which can prefix a literal,
     /// for example a '-42', or one of the boolean idents).
     pub fn can_begin_literal_or_bool(&self) -> bool {