1
Fork 0

parser::path: remove .fatal calls

This commit is contained in:
Mazdak Farrokhzad 2019-12-31 01:57:42 +01:00
parent 51fb599849
commit 6fba125912
3 changed files with 15 additions and 10 deletions

View file

@ -406,9 +406,11 @@ impl<'a> Parser<'a> {
if self.token.is_bool_lit() {
self.parse_literal_maybe_minus()?
} else {
return Err(
self.fatal("identifiers may currently not be used for const generics")
);
let span = self.token.span;
let msg = "identifiers may currently not be used for const generics";
self.struct_span_err(span, msg).emit();
let block = self.mk_block_err(span);
self.mk_expr(span, ast::ExprKind::Block(block, None), ast::AttrVec::new())
}
} else {
self.parse_literal_maybe_minus()?