1
Fork 0

Rollup merge of #60583 - varkor:const-generics-emplace, r=petrochenkov

Fix parsing issue with negative literals as const generic arguments
This commit is contained in:
Mazdak Farrokhzad 2019-05-07 19:30:09 +02:00 committed by GitHub
commit 9995bb5855
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 11 deletions

View file

@ -2319,7 +2319,8 @@ impl<'a> Parser<'a> {
let ident = self.parse_path_segment_ident()?;
let is_args_start = |token: &token::Token| match *token {
token::Lt | token::BinOp(token::Shl) | token::OpenDelim(token::Paren) => true,
token::Lt | token::BinOp(token::Shl) | token::OpenDelim(token::Paren)
| token::LArrow => true,
_ => false,
};
let check_args_start = |this: &mut Self| {
@ -6056,8 +6057,6 @@ impl<'a> Parser<'a> {
self.fatal("identifiers may currently not be used for const generics")
);
} else {
// FIXME(const_generics): this currently conflicts with emplacement syntax
// with negative integer literals.
self.parse_literal_maybe_minus()?
};
let value = AnonConst {