about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorvarkor <github@varkor.com>2019-02-07 14:58:47 +0100
committervarkor <github@varkor.com>2019-02-07 15:03:20 +0100
commit451f1287839451fc097a406fad1a9160c22c280a (patch)
treef0c297c45b058814c11166a7a134599375bb53fd /src/libsyntax/parse
parent9ad04b9960ed125d450fbf49f3c4c21702ab36ae (diff)
downloadrust-451f1287839451fc097a406fad1a9160c22c280a.tar.gz
rust-451f1287839451fc097a406fad1a9160c22c280a.zip
Parse negative literals in const generic arguments
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index d9195ebe312..d71145893c3 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -5796,8 +5796,7 @@ impl<'a> Parser<'a> {
                 } else {
                     // FIXME(const_generics): this currently conflicts with emplacement syntax
                     // with negative integer literals.
-                    let lit = self.parse_lit()?;
-                    self.mk_expr(lit.span, ExprKind::Lit(lit), ThinVec::new())
+                    self.parse_literal_maybe_minus()?
                 };
                 let value = AnonConst {
                     id: ast::DUMMY_NODE_ID,